A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1209 lines
60 KiB

  1. <?php
  2. /**
  3. * This is a MetaControl class, providing a QForm or QPanel access to event handlers
  4. * and QControls to perform the Create, Edit, and Delete functionality
  5. * of the ContentItem class. This code-generated class
  6. * contains all the basic elements to help a QPanel or QForm display an HTML form that can
  7. * manipulate a single ContentItem object.
  8. *
  9. * To take advantage of some (or all) of these control objects, you
  10. * must create a new QForm or QPanel which instantiates a ContentItemMetaControl
  11. * class.
  12. *
  13. * Any and all changes to this file will be overwritten with any subsequent
  14. * code re-generation.
  15. *
  16. * @package Quinta CMS
  17. * @subpackage MetaControls
  18. * property-read ContentItem $ContentItem the actual ContentItem data class being edited
  19. * property QLabel $IdControl
  20. * property-read QLabel $IdLabel
  21. * property QTextBox $NameControl
  22. * property-read QLabel $NameLabel
  23. * property QTextBox $CssclassControl
  24. * property-read QLabel $CssclassLabel
  25. * property QTextBox $TitleControl
  26. * property-read QLabel $TitleLabel
  27. * property QTextBox $DescriptionControl
  28. * property-read QLabel $DescriptionLabel
  29. * property QTextBox $TextControl
  30. * property-read QLabel $TextLabel
  31. * property QIntegerTextBox $SortOrderControl
  32. * property-read QLabel $SortOrderLabel
  33. * property QCheckBox $ShowTitleControl
  34. * property-read QLabel $ShowTitleLabel
  35. * property QCheckBox $ShowDescriptionControl
  36. * property-read QLabel $ShowDescriptionLabel
  37. * property QCheckBox $ShowCreatorControl
  38. * property-read QLabel $ShowCreatorLabel
  39. * property QCheckBox $ShowCreationDateControl
  40. * property-read QLabel $ShowCreationDateLabel
  41. * property QCheckBox $ShowLastModificationControl
  42. * property-read QLabel $ShowLastModificationLabel
  43. * property QListBox $CreatorIdControl
  44. * property-read QLabel $CreatorIdLabel
  45. * property QTextBox $CopyrightNoticeControl
  46. * property-read QLabel $CopyrightNoticeLabel
  47. * property QLabel $CreationDateControl
  48. * property-read QLabel $CreationDateLabel
  49. * property QLabel $LastModificationControl
  50. * property-read QLabel $LastModificationLabel
  51. * property QListBox $TypeIdControl
  52. * property-read QLabel $TypeIdLabel
  53. * property QListBox $StatusIdControl
  54. * property-read QLabel $StatusIdLabel
  55. * property QListBox $ContentBlockControl
  56. * property-read QLabel $ContentBlockLabel
  57. * property QListBox $ContentCategoryControl
  58. * property-read QLabel $ContentCategoryLabel
  59. * property QListBox $UsergroupControl
  60. * property-read QLabel $UsergroupLabel
  61. * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
  62. * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
  63. */
  64. class ContentItemMetaControlGen extends QBaseClass {
  65. // General Variables
  66. protected $objContentItem;
  67. protected $objParentObject;
  68. protected $strTitleVerb;
  69. protected $blnEditMode;
  70. // Controls that allow the editing of ContentItem's individual data fields
  71. protected $lblId;
  72. protected $txtName;
  73. protected $txtCssclass;
  74. protected $txtTitle;
  75. protected $txtDescription;
  76. protected $txtText;
  77. protected $txtSortOrder;
  78. protected $chkShowTitle;
  79. protected $chkShowDescription;
  80. protected $chkShowCreator;
  81. protected $chkShowCreationDate;
  82. protected $chkShowLastModification;
  83. protected $lstCreator;
  84. protected $txtCopyrightNotice;
  85. protected $lblCreationDate;
  86. protected $lblLastModification;
  87. protected $lstType;
  88. protected $lstStatus;
  89. // Controls that allow the viewing of ContentItem's individual data fields
  90. protected $lblName;
  91. protected $lblCssclass;
  92. protected $lblTitle;
  93. protected $lblDescription;
  94. protected $lblText;
  95. protected $lblSortOrder;
  96. protected $lblShowTitle;
  97. protected $lblShowDescription;
  98. protected $lblShowCreator;
  99. protected $lblShowCreationDate;
  100. protected $lblShowLastModification;
  101. protected $lblCreatorId;
  102. protected $lblCopyrightNotice;
  103. protected $lblTypeId;
  104. protected $lblStatusId;
  105. // QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References
  106. protected $lstContentBlocks;
  107. protected $lstContentCategories;
  108. protected $lstUsergroups;
  109. // QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References
  110. protected $lblContentBlocks;
  111. protected $lblContentCategories;
  112. protected $lblUsergroups;
  113. /**
  114. * Main constructor. Constructor OR static create methods are designed to be called in either
  115. * a parent QPanel or the main QForm when wanting to create a
  116. * ContentItemMetaControl to edit a single ContentItem object within the
  117. * QPanel or QForm.
  118. *
  119. * This constructor takes in a single ContentItem object, while any of the static
  120. * create methods below can be used to construct based off of individual PK ID(s).
  121. *
  122. * @param mixed $objParentObject QForm or QPanel which will be using this ContentItemMetaControl
  123. * @param ContentItem $objContentItem new or existing ContentItem object
  124. */
  125. public function __construct($objParentObject, ContentItem $objContentItem) {
  126. // Setup Parent Object (e.g. QForm or QPanel which will be using this ContentItemMetaControl)
  127. $this->objParentObject = $objParentObject;
  128. // Setup linked ContentItem object
  129. $this->objContentItem = $objContentItem;
  130. // Figure out if we're Editing or Creating New
  131. if ($this->objContentItem->__Restored) {
  132. $this->strTitleVerb = QApplication::Translate('Edit');
  133. $this->blnEditMode = true;
  134. } else {
  135. $this->strTitleVerb = QApplication::Translate('Create');
  136. $this->blnEditMode = false;
  137. }
  138. }
  139. /**
  140. * Static Helper Method to Create using PK arguments
  141. * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  142. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  143. * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
  144. * edit, or if we are also allowed to create a new one, etc.
  145. *
  146. * @param mixed $objParentObject QForm or QPanel which will be using this ContentItemMetaControl
  147. * @param integer $intId primary key value
  148. * @param QMetaControlCreateType $intCreateType rules governing ContentItem object creation - defaults to CreateOrEdit
  149. * @return ContentItemMetaControl
  150. */
  151. public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  152. // Attempt to Load from PK Arguments
  153. if (strlen($intId)) {
  154. $objContentItem = ContentItem::Load($intId);
  155. // ContentItem was found -- return it!
  156. if ($objContentItem)
  157. return new ContentItemMetaControl($objParentObject, $objContentItem);
  158. // If CreateOnRecordNotFound not specified, throw an exception
  159. else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
  160. throw new QCallerException('Could not find a ContentItem object with PK arguments: ' . $intId);
  161. // If EditOnly is specified, throw an exception
  162. } else if ($intCreateType == QMetaControlCreateType::EditOnly)
  163. throw new QCallerException('No PK arguments specified');
  164. // If we are here, then we need to create a new record
  165. return new ContentItemMetaControl($objParentObject, new ContentItem());
  166. }
  167. /**
  168. * Static Helper Method to Create using PathInfo arguments
  169. *
  170. * @param mixed $objParentObject QForm or QPanel which will be using this ContentItemMetaControl
  171. * @param QMetaControlCreateType $intCreateType rules governing ContentItem object creation - defaults to CreateOrEdit
  172. * @return ContentItemMetaControl
  173. */
  174. public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  175. $intId = QApplication::PathInfo(0);
  176. return ContentItemMetaControl::Create($objParentObject, $intId, $intCreateType);
  177. }
  178. /**
  179. * Static Helper Method to Create using QueryString arguments
  180. *
  181. * @param mixed $objParentObject QForm or QPanel which will be using this ContentItemMetaControl
  182. * @param QMetaControlCreateType $intCreateType rules governing ContentItem object creation - defaults to CreateOrEdit
  183. * @return ContentItemMetaControl
  184. */
  185. public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  186. $intId = QApplication::QueryString('intId');
  187. return ContentItemMetaControl::Create($objParentObject, $intId, $intCreateType);
  188. }
  189. ///////////////////////////////////////////////
  190. // PUBLIC CREATE and REFRESH METHODS
  191. ///////////////////////////////////////////////
  192. /**
  193. * Create and setup QLabel lblId
  194. * @param string $strControlId optional ControlId to use
  195. * @return QLabel
  196. */
  197. public function lblId_Create($strControlId = null) {
  198. $this->lblId = new QLabel($this->objParentObject, $strControlId);
  199. $this->lblId->Name = QApplication::Translate('Id');
  200. if ($this->blnEditMode)
  201. $this->lblId->Text = $this->objContentItem->Id;
  202. else
  203. $this->lblId->Text = 'N/A';
  204. return $this->lblId;
  205. }
  206. /**
  207. * Create and setup QTextBox txtName
  208. * @param string $strControlId optional ControlId to use
  209. * @return QTextBox
  210. */
  211. public function txtName_Create($strControlId = null) {
  212. $this->txtName = new QTextBox($this->objParentObject, $strControlId);
  213. $this->txtName->Name = QApplication::Translate('Name');
  214. $this->txtName->Text = $this->objContentItem->Name;
  215. $this->txtName->Required = true;
  216. $this->txtName->MaxLength = ContentItem::NameMaxLength;
  217. return $this->txtName;
  218. }
  219. /**
  220. * Create and setup QLabel lblName
  221. * @param string $strControlId optional ControlId to use
  222. * @return QLabel
  223. */
  224. public function lblName_Create($strControlId = null) {
  225. $this->lblName = new QLabel($this->objParentObject, $strControlId);
  226. $this->lblName->Name = QApplication::Translate('Name');
  227. $this->lblName->Text = $this->objContentItem->Name;
  228. $this->lblName->Required = true;
  229. return $this->lblName;
  230. }
  231. /**
  232. * Create and setup QTextBox txtCssclass
  233. * @param string $strControlId optional ControlId to use
  234. * @return QTextBox
  235. */
  236. public function txtCssclass_Create($strControlId = null) {
  237. $this->txtCssclass = new QTextBox($this->objParentObject, $strControlId);
  238. $this->txtCssclass->Name = QApplication::Translate('Cssclass');
  239. $this->txtCssclass->Text = $this->objContentItem->Cssclass;
  240. $this->txtCssclass->MaxLength = ContentItem::CssclassMaxLength;
  241. return $this->txtCssclass;
  242. }
  243. /**
  244. * Create and setup QLabel lblCssclass
  245. * @param string $strControlId optional ControlId to use
  246. * @return QLabel
  247. */
  248. public function lblCssclass_Create($strControlId = null) {
  249. $this->lblCssclass = new QLabel($this->objParentObject, $strControlId);
  250. $this->lblCssclass->Name = QApplication::Translate('Cssclass');
  251. $this->lblCssclass->Text = $this->objContentItem->Cssclass;
  252. return $this->lblCssclass;
  253. }
  254. /**
  255. * Create and setup QTextBox txtTitle
  256. * @param string $strControlId optional ControlId to use
  257. * @return QTextBox
  258. */
  259. public function txtTitle_Create($strControlId = null) {
  260. $this->txtTitle = new QTextBox($this->objParentObject, $strControlId);
  261. $this->txtTitle->Name = QApplication::Translate('Title');
  262. $this->txtTitle->Text = $this->objContentItem->Title;
  263. $this->txtTitle->MaxLength = ContentItem::TitleMaxLength;
  264. return $this->txtTitle;
  265. }
  266. /**
  267. * Create and setup QLabel lblTitle
  268. * @param string $strControlId optional ControlId to use
  269. * @return QLabel
  270. */
  271. public function lblTitle_Create($strControlId = null) {
  272. $this->lblTitle = new QLabel($this->objParentObject, $strControlId);
  273. $this->lblTitle->Name = QApplication::Translate('Title');
  274. $this->lblTitle->Text = $this->objContentItem->Title;
  275. return $this->lblTitle;
  276. }
  277. /**
  278. * Create and setup QTextBox txtDescription
  279. * @param string $strControlId optional ControlId to use
  280. * @return QTextBox
  281. */
  282. public function txtDescription_Create($strControlId = null) {
  283. $this->txtDescription = new QTextBox($this->objParentObject, $strControlId);
  284. $this->txtDescription->Name = QApplication::Translate('Description');
  285. $this->txtDescription->Text = $this->objContentItem->Description;
  286. $this->txtDescription->MaxLength = ContentItem::DescriptionMaxLength;
  287. return $this->txtDescription;
  288. }
  289. /**
  290. * Create and setup QLabel lblDescription
  291. * @param string $strControlId optional ControlId to use
  292. * @return QLabel
  293. */
  294. public function lblDescription_Create($strControlId = null) {
  295. $this->lblDescription = new QLabel($this->objParentObject, $strControlId);
  296. $this->lblDescription->Name = QApplication::Translate('Description');
  297. $this->lblDescription->Text = $this->objContentItem->Description;
  298. return $this->lblDescription;
  299. }
  300. /**
  301. * Create and setup QTextBox txtText
  302. * @param string $strControlId optional ControlId to use
  303. * @return QTextBox
  304. */
  305. public function txtText_Create($strControlId = null) {
  306. $this->txtText = new QTextBox($this->objParentObject, $strControlId);
  307. $this->txtText->Name = QApplication::Translate('Text');
  308. $this->txtText->Text = $this->objContentItem->Text;
  309. $this->txtText->TextMode = QTextMode::MultiLine;
  310. return $this->txtText;
  311. }
  312. /**
  313. * Create and setup QLabel lblText
  314. * @param string $strControlId optional ControlId to use
  315. * @return QLabel
  316. */
  317. public function lblText_Create($strControlId = null) {
  318. $this->lblText = new QLabel($this->objParentObject, $strControlId);
  319. $this->lblText->Name = QApplication::Translate('Text');
  320. $this->lblText->Text = $this->objContentItem->Text;
  321. return $this->lblText;
  322. }
  323. /**
  324. * Create and setup QIntegerTextBox txtSortOrder
  325. * @param string $strControlId optional ControlId to use
  326. * @return QIntegerTextBox
  327. */
  328. public function txtSortOrder_Create($strControlId = null) {
  329. $this->txtSortOrder = new QIntegerTextBox($this->objParentObject, $strControlId);
  330. $this->txtSortOrder->Name = QApplication::Translate('Sort Order');
  331. $this->txtSortOrder->Text = $this->objContentItem->SortOrder;
  332. return $this->txtSortOrder;
  333. }
  334. /**
  335. * Create and setup QLabel lblSortOrder
  336. * @param string $strControlId optional ControlId to use
  337. * @param string $strFormat optional sprintf format to use
  338. * @return QLabel
  339. */
  340. public function lblSortOrder_Create($strControlId = null, $strFormat = null) {
  341. $this->lblSortOrder = new QLabel($this->objParentObject, $strControlId);
  342. $this->lblSortOrder->Name = QApplication::Translate('Sort Order');
  343. $this->lblSortOrder->Text = $this->objContentItem->SortOrder;
  344. $this->lblSortOrder->Format = $strFormat;
  345. return $this->lblSortOrder;
  346. }
  347. /**
  348. * Create and setup QCheckBox chkShowTitle
  349. * @param string $strControlId optional ControlId to use
  350. * @return QCheckBox
  351. */
  352. public function chkShowTitle_Create($strControlId = null) {
  353. $this->chkShowTitle = new QCheckBox($this->objParentObject, $strControlId);
  354. $this->chkShowTitle->Name = QApplication::Translate('Show Title');
  355. $this->chkShowTitle->Checked = $this->objContentItem->ShowTitle;
  356. return $this->chkShowTitle;
  357. }
  358. /**
  359. * Create and setup QLabel lblShowTitle
  360. * @param string $strControlId optional ControlId to use
  361. * @return QLabel
  362. */
  363. public function lblShowTitle_Create($strControlId = null) {
  364. $this->lblShowTitle = new QLabel($this->objParentObject, $strControlId);
  365. $this->lblShowTitle->Name = QApplication::Translate('Show Title');
  366. $this->lblShowTitle->Text = ($this->objContentItem->ShowTitle) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  367. return $this->lblShowTitle;
  368. }
  369. /**
  370. * Create and setup QCheckBox chkShowDescription
  371. * @param string $strControlId optional ControlId to use
  372. * @return QCheckBox
  373. */
  374. public function chkShowDescription_Create($strControlId = null) {
  375. $this->chkShowDescription = new QCheckBox($this->objParentObject, $strControlId);
  376. $this->chkShowDescription->Name = QApplication::Translate('Show Description');
  377. $this->chkShowDescription->Checked = $this->objContentItem->ShowDescription;
  378. return $this->chkShowDescription;
  379. }
  380. /**
  381. * Create and setup QLabel lblShowDescription
  382. * @param string $strControlId optional ControlId to use
  383. * @return QLabel
  384. */
  385. public function lblShowDescription_Create($strControlId = null) {
  386. $this->lblShowDescription = new QLabel($this->objParentObject, $strControlId);
  387. $this->lblShowDescription->Name = QApplication::Translate('Show Description');
  388. $this->lblShowDescription->Text = ($this->objContentItem->ShowDescription) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  389. return $this->lblShowDescription;
  390. }
  391. /**
  392. * Create and setup QCheckBox chkShowCreator
  393. * @param string $strControlId optional ControlId to use
  394. * @return QCheckBox
  395. */
  396. public function chkShowCreator_Create($strControlId = null) {
  397. $this->chkShowCreator = new QCheckBox($this->objParentObject, $strControlId);
  398. $this->chkShowCreator->Name = QApplication::Translate('Show Creator');
  399. $this->chkShowCreator->Checked = $this->objContentItem->ShowCreator;
  400. return $this->chkShowCreator;
  401. }
  402. /**
  403. * Create and setup QLabel lblShowCreator
  404. * @param string $strControlId optional ControlId to use
  405. * @return QLabel
  406. */
  407. public function lblShowCreator_Create($strControlId = null) {
  408. $this->lblShowCreator = new QLabel($this->objParentObject, $strControlId);
  409. $this->lblShowCreator->Name = QApplication::Translate('Show Creator');
  410. $this->lblShowCreator->Text = ($this->objContentItem->ShowCreator) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  411. return $this->lblShowCreator;
  412. }
  413. /**
  414. * Create and setup QCheckBox chkShowCreationDate
  415. * @param string $strControlId optional ControlId to use
  416. * @return QCheckBox
  417. */
  418. public function chkShowCreationDate_Create($strControlId = null) {
  419. $this->chkShowCreationDate = new QCheckBox($this->objParentObject, $strControlId);
  420. $this->chkShowCreationDate->Name = QApplication::Translate('Show Creation Date');
  421. $this->chkShowCreationDate->Checked = $this->objContentItem->ShowCreationDate;
  422. return $this->chkShowCreationDate;
  423. }
  424. /**
  425. * Create and setup QLabel lblShowCreationDate
  426. * @param string $strControlId optional ControlId to use
  427. * @return QLabel
  428. */
  429. public function lblShowCreationDate_Create($strControlId = null) {
  430. $this->lblShowCreationDate = new QLabel($this->objParentObject, $strControlId);
  431. $this->lblShowCreationDate->Name = QApplication::Translate('Show Creation Date');
  432. $this->lblShowCreationDate->Text = ($this->objContentItem->ShowCreationDate) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  433. return $this->lblShowCreationDate;
  434. }
  435. /**
  436. * Create and setup QCheckBox chkShowLastModification
  437. * @param string $strControlId optional ControlId to use
  438. * @return QCheckBox
  439. */
  440. public function chkShowLastModification_Create($strControlId = null) {
  441. $this->chkShowLastModification = new QCheckBox($this->objParentObject, $strControlId);
  442. $this->chkShowLastModification->Name = QApplication::Translate('Show Last Modification');
  443. $this->chkShowLastModification->Checked = $this->objContentItem->ShowLastModification;
  444. return $this->chkShowLastModification;
  445. }
  446. /**
  447. * Create and setup QLabel lblShowLastModification
  448. * @param string $strControlId optional ControlId to use
  449. * @return QLabel
  450. */
  451. public function lblShowLastModification_Create($strControlId = null) {
  452. $this->lblShowLastModification = new QLabel($this->objParentObject, $strControlId);
  453. $this->lblShowLastModification->Name = QApplication::Translate('Show Last Modification');
  454. $this->lblShowLastModification->Text = ($this->objContentItem->ShowLastModification) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  455. return $this->lblShowLastModification;
  456. }
  457. /**
  458. * Create and setup QListBox lstCreator
  459. * @param string $strControlId optional ControlId to use
  460. * @return QListBox
  461. */
  462. public function lstCreator_Create($strControlId = null) {
  463. $this->lstCreator = new QListBox($this->objParentObject, $strControlId);
  464. $this->lstCreator->Name = QApplication::Translate('Creator');
  465. $this->lstCreator->AddItem(QApplication::Translate('- Select One -'), null);
  466. $objCreatorArray = Person::LoadAll();
  467. if ($objCreatorArray) foreach ($objCreatorArray as $objCreator) {
  468. $objListItem = new QListItem($objCreator->__toString(), $objCreator->Id);
  469. if (($this->objContentItem->Creator) && ($this->objContentItem->Creator->Id == $objCreator->Id))
  470. $objListItem->Selected = true;
  471. $this->lstCreator->AddItem($objListItem);
  472. }
  473. return $this->lstCreator;
  474. }
  475. /**
  476. * Create and setup QLabel lblCreatorId
  477. * @param string $strControlId optional ControlId to use
  478. * @return QLabel
  479. */
  480. public function lblCreatorId_Create($strControlId = null) {
  481. $this->lblCreatorId = new QLabel($this->objParentObject, $strControlId);
  482. $this->lblCreatorId->Name = QApplication::Translate('Creator');
  483. $this->lblCreatorId->Text = ($this->objContentItem->Creator) ? $this->objContentItem->Creator->__toString() : null;
  484. return $this->lblCreatorId;
  485. }
  486. /**
  487. * Create and setup QTextBox txtCopyrightNotice
  488. * @param string $strControlId optional ControlId to use
  489. * @return QTextBox
  490. */
  491. public function txtCopyrightNotice_Create($strControlId = null) {
  492. $this->txtCopyrightNotice = new QTextBox($this->objParentObject, $strControlId);
  493. $this->txtCopyrightNotice->Name = QApplication::Translate('Copyright Notice');
  494. $this->txtCopyrightNotice->Text = $this->objContentItem->CopyrightNotice;
  495. $this->txtCopyrightNotice->MaxLength = ContentItem::CopyrightNoticeMaxLength;
  496. return $this->txtCopyrightNotice;
  497. }
  498. /**
  499. * Create and setup QLabel lblCopyrightNotice
  500. * @param string $strControlId optional ControlId to use
  501. * @return QLabel
  502. */
  503. public function lblCopyrightNotice_Create($strControlId = null) {
  504. $this->lblCopyrightNotice = new QLabel($this->objParentObject, $strControlId);
  505. $this->lblCopyrightNotice->Name = QApplication::Translate('Copyright Notice');
  506. $this->lblCopyrightNotice->Text = $this->objContentItem->CopyrightNotice;
  507. return $this->lblCopyrightNotice;
  508. }
  509. /**
  510. * Create and setup QLabel lblCreationDate
  511. * @param string $strControlId optional ControlId to use
  512. * @return QLabel
  513. */
  514. public function lblCreationDate_Create($strControlId = null) {
  515. $this->lblCreationDate = new QLabel($this->objParentObject, $strControlId);
  516. $this->lblCreationDate->Name = QApplication::Translate('Creation Date');
  517. if ($this->blnEditMode)
  518. $this->lblCreationDate->Text = $this->objContentItem->CreationDate;
  519. else
  520. $this->lblCreationDate->Text = 'N/A';
  521. return $this->lblCreationDate;
  522. }
  523. /**
  524. * Create and setup QLabel lblLastModification
  525. * @param string $strControlId optional ControlId to use
  526. * @return QLabel
  527. */
  528. public function lblLastModification_Create($strControlId = null) {
  529. $this->lblLastModification = new QLabel($this->objParentObject, $strControlId);
  530. $this->lblLastModification->Name = QApplication::Translate('Last Modification');
  531. if ($this->blnEditMode)
  532. $this->lblLastModification->Text = $this->objContentItem->LastModification;
  533. else
  534. $this->lblLastModification->Text = 'N/A';
  535. return $this->lblLastModification;
  536. }
  537. /**
  538. * Create and setup QListBox lstType
  539. * @param string $strControlId optional ControlId to use
  540. * @return QListBox
  541. */
  542. public function lstType_Create($strControlId = null) {
  543. $this->lstType = new QListBox($this->objParentObject, $strControlId);
  544. $this->lstType->Name = QApplication::Translate('Type');
  545. $this->lstType->Required = true;
  546. foreach (ContentType::$NameArray as $intId => $strValue)
  547. $this->lstType->AddItem(new QListItem($strValue, $intId, $this->objContentItem->TypeId == $intId));
  548. return $this->lstType;
  549. }
  550. /**
  551. * Create and setup QLabel lblTypeId
  552. * @param string $strControlId optional ControlId to use
  553. * @return QLabel
  554. */
  555. public function lblTypeId_Create($strControlId = null) {
  556. $this->lblTypeId = new QLabel($this->objParentObject, $strControlId);
  557. $this->lblTypeId->Name = QApplication::Translate('Type');
  558. $this->lblTypeId->Text = ($this->objContentItem->TypeId) ? ContentType::$NameArray[$this->objContentItem->TypeId] : null;
  559. $this->lblTypeId->Required = true;
  560. return $this->lblTypeId;
  561. }
  562. /**
  563. * Create and setup QListBox lstStatus
  564. * @param string $strControlId optional ControlId to use
  565. * @return QListBox
  566. */
  567. public function lstStatus_Create($strControlId = null) {
  568. $this->lstStatus = new QListBox($this->objParentObject, $strControlId);
  569. $this->lstStatus->Name = QApplication::Translate('Status');
  570. $this->lstStatus->Required = true;
  571. foreach (ContentStatusType::$NameArray as $intId => $strValue)
  572. $this->lstStatus->AddItem(new QListItem($strValue, $intId, $this->objContentItem->StatusId == $intId));
  573. return $this->lstStatus;
  574. }
  575. /**
  576. * Create and setup QLabel lblStatusId
  577. * @param string $strControlId optional ControlId to use
  578. * @return QLabel
  579. */
  580. public function lblStatusId_Create($strControlId = null) {
  581. $this->lblStatusId = new QLabel($this->objParentObject, $strControlId);
  582. $this->lblStatusId->Name = QApplication::Translate('Status');
  583. $this->lblStatusId->Text = ($this->objContentItem->StatusId) ? ContentStatusType::$NameArray[$this->objContentItem->StatusId] : null;
  584. $this->lblStatusId->Required = true;
  585. return $this->lblStatusId;
  586. }
  587. /**
  588. * Create and setup QListBox lstContentBlocks
  589. * @param string $strControlId optional ControlId to use
  590. * @return QListBox
  591. */
  592. public function lstContentBlocks_Create($strControlId = null) {
  593. $this->lstContentBlocks = new QListBox($this->objParentObject, $strControlId);
  594. $this->lstContentBlocks->Name = QApplication::Translate('Content Blocks');
  595. $this->lstContentBlocks->SelectionMode = QSelectionMode::Multiple;
  596. $objAssociatedArray = $this->objContentItem->GetContentBlockArray();
  597. $objContentBlockArray = ContentBlock::LoadAll();
  598. if ($objContentBlockArray) foreach ($objContentBlockArray as $objContentBlock) {
  599. $objListItem = new QListItem($objContentBlock->__toString(), $objContentBlock->Id);
  600. foreach ($objAssociatedArray as $objAssociated) {
  601. if ($objAssociated->Id == $objContentBlock->Id)
  602. $objListItem->Selected = true;
  603. }
  604. $this->lstContentBlocks->AddItem($objListItem);
  605. }
  606. return $this->lstContentBlocks;
  607. }
  608. /**
  609. * Create and setup QLabel lblContentBlocks
  610. * @param string $strControlId optional ControlId to use
  611. * @param string $strGlue glue to display in between each associated object
  612. * @return QLabel
  613. */
  614. public function lblContentBlocks_Create($strControlId = null, $strGlue = ', ') {
  615. $this->lblContentBlocks = new QLabel($this->objParentObject, $strControlId);
  616. $this->lblContentBlocks->Name = QApplication::Translate('Content Blocks');
  617. $objAssociatedArray = $this->objContentItem->GetContentBlockArray();
  618. $strItems = array();
  619. foreach ($objAssociatedArray as $objAssociated)
  620. $strItems[] = $objAssociated->__toString();
  621. $this->lblContentBlocks->Text = implode($strGlue, $strItems);
  622. return $this->lblContentBlocks;
  623. }
  624. /**
  625. * Create and setup QListBox lstContentCategories
  626. * @param string $strControlId optional ControlId to use
  627. * @return QListBox
  628. */
  629. public function lstContentCategories_Create($strControlId = null) {
  630. $this->lstContentCategories = new QListBox($this->objParentObject, $strControlId);
  631. $this->lstContentCategories->Name = QApplication::Translate('Content Categories');
  632. $this->lstContentCategories->SelectionMode = QSelectionMode::Multiple;
  633. $objAssociatedArray = $this->objContentItem->GetContentCategoryArray();
  634. $objContentCategoryArray = ContentCategory::LoadAll();
  635. if ($objContentCategoryArray) foreach ($objContentCategoryArray as $objContentCategory) {
  636. $objListItem = new QListItem($objContentCategory->__toString(), $objContentCategory->Id);
  637. foreach ($objAssociatedArray as $objAssociated) {
  638. if ($objAssociated->Id == $objContentCategory->Id)
  639. $objListItem->Selected = true;
  640. }
  641. $this->lstContentCategories->AddItem($objListItem);
  642. }
  643. return $this->lstContentCategories;
  644. }
  645. /**
  646. * Create and setup QLabel lblContentCategories
  647. * @param string $strControlId optional ControlId to use
  648. * @param string $strGlue glue to display in between each associated object
  649. * @return QLabel
  650. */
  651. public function lblContentCategories_Create($strControlId = null, $strGlue = ', ') {
  652. $this->lblContentCategories = new QLabel($this->objParentObject, $strControlId);
  653. $this->lblContentCategories->Name = QApplication::Translate('Content Categories');
  654. $objAssociatedArray = $this->objContentItem->GetContentCategoryArray();
  655. $strItems = array();
  656. foreach ($objAssociatedArray as $objAssociated)
  657. $strItems[] = $objAssociated->__toString();
  658. $this->lblContentCategories->Text = implode($strGlue, $strItems);
  659. return $this->lblContentCategories;
  660. }
  661. /**
  662. * Create and setup QListBox lstUsergroups
  663. * @param string $strControlId optional ControlId to use
  664. * @return QListBox
  665. */
  666. public function lstUsergroups_Create($strControlId = null) {
  667. $this->lstUsergroups = new QListBox($this->objParentObject, $strControlId);
  668. $this->lstUsergroups->Name = QApplication::Translate('Usergroups');
  669. $this->lstUsergroups->SelectionMode = QSelectionMode::Multiple;
  670. $objAssociatedArray = $this->objContentItem->GetUsergroupArray();
  671. $objUsergroupArray = Usergroup::LoadAll();
  672. if ($objUsergroupArray) foreach ($objUsergroupArray as $objUsergroup) {
  673. $objListItem = new QListItem($objUsergroup->__toString(), $objUsergroup->Id);
  674. foreach ($objAssociatedArray as $objAssociated) {
  675. if ($objAssociated->Id == $objUsergroup->Id)
  676. $objListItem->Selected = true;
  677. }
  678. $this->lstUsergroups->AddItem($objListItem);
  679. }
  680. return $this->lstUsergroups;
  681. }
  682. /**
  683. * Create and setup QLabel lblUsergroups
  684. * @param string $strControlId optional ControlId to use
  685. * @param string $strGlue glue to display in between each associated object
  686. * @return QLabel
  687. */
  688. public function lblUsergroups_Create($strControlId = null, $strGlue = ', ') {
  689. $this->lblUsergroups = new QLabel($this->objParentObject, $strControlId);
  690. $this->lblUsergroups->Name = QApplication::Translate('Usergroups');
  691. $objAssociatedArray = $this->objContentItem->GetUsergroupArray();
  692. $strItems = array();
  693. foreach ($objAssociatedArray as $objAssociated)
  694. $strItems[] = $objAssociated->__toString();
  695. $this->lblUsergroups->Text = implode($strGlue, $strItems);
  696. return $this->lblUsergroups;
  697. }
  698. /**
  699. * Refresh this MetaControl with Data from the local ContentItem object.
  700. * @param boolean $blnReload reload ContentItem from the database
  701. * @return void
  702. */
  703. public function Refresh($blnReload = false) {
  704. if ($blnReload)
  705. $this->objContentItem->Reload();
  706. if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objContentItem->Id;
  707. if ($this->txtName) $this->txtName->Text = $this->objContentItem->Name;
  708. if ($this->lblName) $this->lblName->Text = $this->objContentItem->Name;
  709. if ($this->txtCssclass) $this->txtCssclass->Text = $this->objContentItem->Cssclass;
  710. if ($this->lblCssclass) $this->lblCssclass->Text = $this->objContentItem->Cssclass;
  711. if ($this->txtTitle) $this->txtTitle->Text = $this->objContentItem->Title;
  712. if ($this->lblTitle) $this->lblTitle->Text = $this->objContentItem->Title;
  713. if ($this->txtDescription) $this->txtDescription->Text = $this->objContentItem->Description;
  714. if ($this->lblDescription) $this->lblDescription->Text = $this->objContentItem->Description;
  715. if ($this->txtText) $this->txtText->Text = $this->objContentItem->Text;
  716. if ($this->lblText) $this->lblText->Text = $this->objContentItem->Text;
  717. if ($this->txtSortOrder) $this->txtSortOrder->Text = $this->objContentItem->SortOrder;
  718. if ($this->lblSortOrder) $this->lblSortOrder->Text = $this->objContentItem->SortOrder;
  719. if ($this->chkShowTitle) $this->chkShowTitle->Checked = $this->objContentItem->ShowTitle;
  720. if ($this->lblShowTitle) $this->lblShowTitle->Text = ($this->objContentItem->ShowTitle) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  721. if ($this->chkShowDescription) $this->chkShowDescription->Checked = $this->objContentItem->ShowDescription;
  722. if ($this->lblShowDescription) $this->lblShowDescription->Text = ($this->objContentItem->ShowDescription) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  723. if ($this->chkShowCreator) $this->chkShowCreator->Checked = $this->objContentItem->ShowCreator;
  724. if ($this->lblShowCreator) $this->lblShowCreator->Text = ($this->objContentItem->ShowCreator) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  725. if ($this->chkShowCreationDate) $this->chkShowCreationDate->Checked = $this->objContentItem->ShowCreationDate;
  726. if ($this->lblShowCreationDate) $this->lblShowCreationDate->Text = ($this->objContentItem->ShowCreationDate) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  727. if ($this->chkShowLastModification) $this->chkShowLastModification->Checked = $this->objContentItem->ShowLastModification;
  728. if ($this->lblShowLastModification) $this->lblShowLastModification->Text = ($this->objContentItem->ShowLastModification) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  729. if ($this->lstCreator) {
  730. $this->lstCreator->RemoveAllItems();
  731. $this->lstCreator->AddItem(QApplication::Translate('- Select One -'), null);
  732. $objCreatorArray = Person::LoadAll();
  733. if ($objCreatorArray) foreach ($objCreatorArray as $objCreator) {
  734. $objListItem = new QListItem($objCreator->__toString(), $objCreator->Id);
  735. if (($this->objContentItem->Creator) && ($this->objContentItem->Creator->Id == $objCreator->Id))
  736. $objListItem->Selected = true;
  737. $this->lstCreator->AddItem($objListItem);
  738. }
  739. }
  740. if ($this->lblCreatorId) $this->lblCreatorId->Text = ($this->objContentItem->Creator) ? $this->objContentItem->Creator->__toString() : null;
  741. if ($this->txtCopyrightNotice) $this->txtCopyrightNotice->Text = $this->objContentItem->CopyrightNotice;
  742. if ($this->lblCopyrightNotice) $this->lblCopyrightNotice->Text = $this->objContentItem->CopyrightNotice;
  743. if ($this->lblCreationDate) if ($this->blnEditMode) $this->lblCreationDate->Text = $this->objContentItem->CreationDate;
  744. if ($this->lblLastModification) if ($this->blnEditMode) $this->lblLastModification->Text = $this->objContentItem->LastModification;
  745. if ($this->lstType) $this->lstType->SelectedValue = $this->objContentItem->TypeId;
  746. if ($this->lblTypeId) $this->lblTypeId->Text = ($this->objContentItem->TypeId) ? ContentType::$NameArray[$this->objContentItem->TypeId] : null;
  747. if ($this->lstStatus) $this->lstStatus->SelectedValue = $this->objContentItem->StatusId;
  748. if ($this->lblStatusId) $this->lblStatusId->Text = ($this->objContentItem->StatusId) ? ContentStatusType::$NameArray[$this->objContentItem->StatusId] : null;
  749. if ($this->lstContentBlocks) {
  750. $this->lstContentBlocks->RemoveAllItems();
  751. $objAssociatedArray = $this->objContentItem->GetContentBlockArray();
  752. $objContentBlockArray = ContentBlock::LoadAll();
  753. if ($objContentBlockArray) foreach ($objContentBlockArray as $objContentBlock) {
  754. $objListItem = new QListItem($objContentBlock->__toString(), $objContentBlock->Id);
  755. foreach ($objAssociatedArray as $objAssociated) {
  756. if ($objAssociated->Id == $objContentBlock->Id)
  757. $objListItem->Selected = true;
  758. }
  759. $this->lstContentBlocks->AddItem($objListItem);
  760. }
  761. }
  762. if ($this->lblContentBlocks) {
  763. $objAssociatedArray = $this->objContentItem->GetContentBlockArray();
  764. $strItems = array();
  765. foreach ($objAssociatedArray as $objAssociated)
  766. $strItems[] = $objAssociated->__toString();
  767. $this->lblContentBlocks->Text = implode($strGlue, $strItems);
  768. }
  769. if ($this->lstContentCategories) {
  770. $this->lstContentCategories->RemoveAllItems();
  771. $objAssociatedArray = $this->objContentItem->GetContentCategoryArray();
  772. $objContentCategoryArray = ContentCategory::LoadAll();
  773. if ($objContentCategoryArray) foreach ($objContentCategoryArray as $objContentCategory) {
  774. $objListItem = new QListItem($objContentCategory->__toString(), $objContentCategory->Id);
  775. foreach ($objAssociatedArray as $objAssociated) {
  776. if ($objAssociated->Id == $objContentCategory->Id)
  777. $objListItem->Selected = true;
  778. }
  779. $this->lstContentCategories->AddItem($objListItem);
  780. }
  781. }
  782. if ($this->lblContentCategories) {
  783. $objAssociatedArray = $this->objContentItem->GetContentCategoryArray();
  784. $strItems = array();
  785. foreach ($objAssociatedArray as $objAssociated)
  786. $strItems[] = $objAssociated->__toString();
  787. $this->lblContentCategories->Text = implode($strGlue, $strItems);
  788. }
  789. if ($this->lstUsergroups) {
  790. $this->lstUsergroups->RemoveAllItems();
  791. $objAssociatedArray = $this->objContentItem->GetUsergroupArray();
  792. $objUsergroupArray = Usergroup::LoadAll();
  793. if ($objUsergroupArray) foreach ($objUsergroupArray as $objUsergroup) {
  794. $objListItem = new QListItem($objUsergroup->__toString(), $objUsergroup->Id);
  795. foreach ($objAssociatedArray as $objAssociated) {
  796. if ($objAssociated->Id == $objUsergroup->Id)
  797. $objListItem->Selected = true;
  798. }
  799. $this->lstUsergroups->AddItem($objListItem);
  800. }
  801. }
  802. if ($this->lblUsergroups) {
  803. $objAssociatedArray = $this->objContentItem->GetUsergroupArray();
  804. $strItems = array();
  805. foreach ($objAssociatedArray as $objAssociated)
  806. $strItems[] = $objAssociated->__toString();
  807. $this->lblUsergroups->Text = implode($strGlue, $strItems);
  808. }
  809. }
  810. ///////////////////////////////////////////////
  811. // PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
  812. ///////////////////////////////////////////////
  813. protected function lstContentBlocks_Update() {
  814. if ($this->lstContentBlocks) {
  815. $this->objContentItem->UnassociateAllContentBlocks();
  816. $objSelectedListItems = $this->lstContentBlocks->SelectedItems;
  817. if ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {
  818. $this->objContentItem->AssociateContentBlock(ContentBlock::Load($objListItem->Value));
  819. }
  820. }
  821. }
  822. protected function lstContentCategories_Update() {
  823. if ($this->lstContentCategories) {
  824. $this->objContentItem->UnassociateAllContentCategories();
  825. $objSelectedListItems = $this->lstContentCategories->SelectedItems;
  826. if ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {
  827. $this->objContentItem->AssociateContentCategory(ContentCategory::Load($objListItem->Value));
  828. }
  829. }
  830. }
  831. protected function lstUsergroups_Update() {
  832. if ($this->lstUsergroups) {
  833. $this->objContentItem->UnassociateAllUsergroups();
  834. $objSelectedListItems = $this->lstUsergroups->SelectedItems;
  835. if ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {
  836. $this->objContentItem->AssociateUsergroup(Usergroup::Load($objListItem->Value));
  837. }
  838. }
  839. }
  840. ///////////////////////////////////////////////
  841. // PUBLIC CONTENTITEM OBJECT MANIPULATORS
  842. ///////////////////////////////////////////////
  843. /**
  844. * This will save this object's ContentItem instance,
  845. * updating only the fields which have had a control created for it.
  846. */
  847. public function SaveContentItem() {
  848. try {
  849. // Update any fields for controls that have been created
  850. if ($this->txtName) $this->objContentItem->Name = $this->txtName->Text;
  851. if ($this->txtCssclass) $this->objContentItem->Cssclass = $this->txtCssclass->Text;
  852. if ($this->txtTitle) $this->objContentItem->Title = $this->txtTitle->Text;
  853. if ($this->txtDescription) $this->objContentItem->Description = $this->txtDescription->Text;
  854. if ($this->txtText) $this->objContentItem->Text = $this->txtText->Text;
  855. if ($this->txtSortOrder) $this->objContentItem->SortOrder = $this->txtSortOrder->Text;
  856. if ($this->chkShowTitle) $this->objContentItem->ShowTitle = $this->chkShowTitle->Checked;
  857. if ($this->chkShowDescription) $this->objContentItem->ShowDescription = $this->chkShowDescription->Checked;
  858. if ($this->chkShowCreator) $this->objContentItem->ShowCreator = $this->chkShowCreator->Checked;
  859. if ($this->chkShowCreationDate) $this->objContentItem->ShowCreationDate = $this->chkShowCreationDate->Checked;
  860. if ($this->chkShowLastModification) $this->objContentItem->ShowLastModification = $this->chkShowLastModification->Checked;
  861. if ($this->lstCreator) $this->objContentItem->CreatorId = $this->lstCreator->SelectedValue;
  862. if ($this->txtCopyrightNotice) $this->objContentItem->CopyrightNotice = $this->txtCopyrightNotice->Text;
  863. if ($this->lstType) $this->objContentItem->TypeId = $this->lstType->SelectedValue;
  864. if ($this->lstStatus) $this->objContentItem->StatusId = $this->lstStatus->SelectedValue;
  865. // Update any UniqueReverseReferences (if any) for controls that have been created for it
  866. // Save the ContentItem object
  867. $this->objContentItem->Save();
  868. // Finally, update any ManyToManyReferences (if any)
  869. $this->lstContentBlocks_Update();
  870. $this->lstContentCategories_Update();
  871. $this->lstUsergroups_Update();
  872. } catch (QCallerException $objExc) {
  873. $objExc->IncrementOffset();
  874. throw $objExc;
  875. }
  876. }
  877. /**
  878. * This will DELETE this object's ContentItem instance from the database.
  879. * It will also unassociate itself from any ManyToManyReferences.
  880. */
  881. public function DeleteContentItem() {
  882. $this->objContentItem->UnassociateAllContentBlocks();
  883. $this->objContentItem->UnassociateAllContentCategories();
  884. $this->objContentItem->UnassociateAllUsergroups();
  885. $this->objContentItem->Delete();
  886. }
  887. ///////////////////////////////////////////////
  888. // PUBLIC GETTERS and SETTERS
  889. ///////////////////////////////////////////////
  890. /**
  891. * Override method to perform a property "Get"
  892. * This will get the value of $strName
  893. *
  894. * @param string $strName Name of the property to get
  895. * @return mixed
  896. */
  897. public function __get($strName) {
  898. switch ($strName) {
  899. // General MetaControlVariables
  900. case 'ContentItem': return $this->objContentItem;
  901. case 'TitleVerb': return $this->strTitleVerb;
  902. case 'EditMode': return $this->blnEditMode;
  903. // Controls that point to ContentItem fields -- will be created dynamically if not yet created
  904. case 'IdControl':
  905. if (!$this->lblId) return $this->lblId_Create();
  906. return $this->lblId;
  907. case 'IdLabel':
  908. if (!$this->lblId) return $this->lblId_Create();
  909. return $this->lblId;
  910. case 'NameControl':
  911. if (!$this->txtName) return $this->txtName_Create();
  912. return $this->txtName;
  913. case 'NameLabel':
  914. if (!$this->lblName) return $this->lblName_Create();
  915. return $this->lblName;
  916. case 'CssclassControl':
  917. if (!$this->txtCssclass) return $this->txtCssclass_Create();
  918. return $this->txtCssclass;
  919. case 'CssclassLabel':
  920. if (!$this->lblCssclass) return $this->lblCssclass_Create();
  921. return $this->lblCssclass;
  922. case 'TitleControl':
  923. if (!$this->txtTitle) return $this->txtTitle_Create();
  924. return $this->txtTitle;
  925. case 'TitleLabel':
  926. if (!$this->lblTitle) return $this->lblTitle_Create();
  927. return $this->lblTitle;
  928. case 'DescriptionControl':
  929. if (!$this->txtDescription) return $this->txtDescription_Create();
  930. return $this->txtDescription;
  931. case 'DescriptionLabel':
  932. if (!$this->lblDescription) return $this->lblDescription_Create();
  933. return $this->lblDescription;
  934. case 'TextControl':
  935. if (!$this->txtText) return $this->txtText_Create();
  936. return $this->txtText;
  937. case 'TextLabel':
  938. if (!$this->lblText) return $this->lblText_Create();
  939. return $this->lblText;
  940. case 'SortOrderControl':
  941. if (!$this->txtSortOrder) return $this->txtSortOrder_Create();
  942. return $this->txtSortOrder;
  943. case 'SortOrderLabel':
  944. if (!$this->lblSortOrder) return $this->lblSortOrder_Create();
  945. return $this->lblSortOrder;
  946. case 'ShowTitleControl':
  947. if (!$this->chkShowTitle) return $this->chkShowTitle_Create();
  948. return $this->chkShowTitle;
  949. case 'ShowTitleLabel':
  950. if (!$this->lblShowTitle) return $this->lblShowTitle_Create();
  951. return $this->lblShowTitle;
  952. case 'ShowDescriptionControl':
  953. if (!$this->chkShowDescription) return $this->chkShowDescription_Create();
  954. return $this->chkShowDescription;
  955. case 'ShowDescriptionLabel':
  956. if (!$this->lblShowDescription) return $this->lblShowDescription_Create();
  957. return $this->lblShowDescription;
  958. case 'ShowCreatorControl':
  959. if (!$this->chkShowCreator) return $this->chkShowCreator_Create();
  960. return $this->chkShowCreator;
  961. case 'ShowCreatorLabel':
  962. if (!$this->lblShowCreator) return $this->lblShowCreator_Create();
  963. return $this->lblShowCreator;
  964. case 'ShowCreationDateControl':
  965. if (!$this->chkShowCreationDate) return $this->chkShowCreationDate_Create();
  966. return $this->chkShowCreationDate;
  967. case 'ShowCreationDateLabel':
  968. if (!$this->lblShowCreationDate) return $this->lblShowCreationDate_Create();
  969. return $this->lblShowCreationDate;
  970. case 'ShowLastModificationControl':
  971. if (!$this->chkShowLastModification) return $this->chkShowLastModification_Create();
  972. return $this->chkShowLastModification;
  973. case 'ShowLastModificationLabel':
  974. if (!$this->lblShowLastModification) return $this->lblShowLastModification_Create();
  975. return $this->lblShowLastModification;
  976. case 'CreatorIdControl':
  977. if (!$this->lstCreator) return $this->lstCreator_Create();
  978. return $this->lstCreator;
  979. case 'CreatorIdLabel':
  980. if (!$this->lblCreatorId) return $this->lblCreatorId_Create();
  981. return $this->lblCreatorId;
  982. case 'CopyrightNoticeControl':
  983. if (!$this->txtCopyrightNotice) return $this->txtCopyrightNotice_Create();
  984. return $this->txtCopyrightNotice;
  985. case 'CopyrightNoticeLabel':
  986. if (!$this->lblCopyrightNotice) return $this->lblCopyrightNotice_Create();
  987. return $this->lblCopyrightNotice;
  988. case 'CreationDateControl':
  989. if (!$this->lblCreationDate) return $this->lblCreationDate_Create();
  990. return $this->lblCreationDate;
  991. case 'CreationDateLabel':
  992. if (!$this->lblCreationDate) return $this->lblCreationDate_Create();
  993. return $this->lblCreationDate;
  994. case 'LastModificationControl':
  995. if (!$this->lblLastModification) return $this->lblLastModification_Create();
  996. return $this->lblLastModification;
  997. case 'LastModificationLabel':
  998. if (!$this->lblLastModification) return $this->lblLastModification_Create();
  999. return $this->lblLastModification;
  1000. case 'TypeIdControl':
  1001. if (!$this->lstType) return $this->lstType_Create();
  1002. return $this->lstType;
  1003. case 'TypeIdLabel':
  1004. if (!$this->lblTypeId) return $this->lblTypeId_Create();
  1005. return $this->lblTypeId;
  1006. case 'StatusIdControl':
  1007. if (!$this->lstStatus) return $this->lstStatus_Create();
  1008. return $this->lstStatus;
  1009. case 'StatusIdLabel':
  1010. if (!$this->lblStatusId) return $this->lblStatusId_Create();
  1011. return $this->lblStatusId;
  1012. case 'ContentBlockControl':
  1013. if (!$this->lstContentBlocks) return $this->lstContentBlocks_Create();
  1014. return $this->lstContentBlocks;
  1015. case 'ContentBlockLabel':
  1016. if (!$this->lblContentBlocks) return $this->lblContentBlocks_Create();
  1017. return $this->lblContentBlocks;
  1018. case 'ContentCategoryControl':
  1019. if (!$this->lstContentCategories) return $this->lstContentCategories_Create();
  1020. return $this->lstContentCategories;
  1021. case 'ContentCategoryLabel':
  1022. if (!$this->lblContentCategories) return $this->lblContentCategories_Create();
  1023. return $this->lblContentCategories;
  1024. case 'UsergroupControl':
  1025. if (!$this->lstUsergroups) return $this->lstUsergroups_Create();
  1026. return $this->lstUsergroups;
  1027. case 'UsergroupLabel':
  1028. if (!$this->lblUsergroups) return $this->lblUsergroups_Create();
  1029. return $this->lblUsergroups;
  1030. default:
  1031. try {
  1032. return parent::__get($strName);
  1033. } catch (QCallerException $objExc) {
  1034. $objExc->IncrementOffset();
  1035. throw $objExc;
  1036. }
  1037. }
  1038. }
  1039. /**
  1040. * Override method to perform a property "Set"
  1041. * This will set the property $strName to be $mixValue
  1042. *
  1043. * @param string $strName Name of the property to set
  1044. * @param string $mixValue New value of the property
  1045. * @return mixed
  1046. */
  1047. public function __set($strName, $mixValue) {
  1048. try {
  1049. switch ($strName) {
  1050. // Controls that point to ContentItem fields
  1051. case 'IdControl':
  1052. return ($this->lblId = QType::Cast($mixValue, 'QControl'));
  1053. case 'NameControl':
  1054. return ($this->txtName = QType::Cast($mixValue, 'QControl'));
  1055. case 'CssclassControl':
  1056. return ($this->txtCssclass = QType::Cast($mixValue, 'QControl'));
  1057. case 'TitleControl':
  1058. return ($this->txtTitle = QType::Cast($mixValue, 'QControl'));
  1059. case 'DescriptionControl':
  1060. return ($this->txtDescription = QType::Cast($mixValue, 'QControl'));
  1061. case 'TextControl':
  1062. return ($this->txtText = QType::Cast($mixValue, 'QControl'));
  1063. case 'SortOrderControl':
  1064. return ($this->txtSortOrder = QType::Cast($mixValue, 'QControl'));
  1065. case 'ShowTitleControl':
  1066. return ($this->chkShowTitle = QType::Cast($mixValue, 'QControl'));
  1067. case 'ShowDescriptionControl':
  1068. return ($this->chkShowDescription = QType::Cast($mixValue, 'QControl'));
  1069. case 'ShowCreatorControl':
  1070. return ($this->chkShowCreator = QType::Cast($mixValue, 'QControl'));
  1071. case 'ShowCreationDateControl':
  1072. return ($this->chkShowCreationDate = QType::Cast($mixValue, 'QControl'));
  1073. case 'ShowLastModificationControl':
  1074. return ($this->chkShowLastModification = QType::Cast($mixValue, 'QControl'));
  1075. case 'CreatorIdControl':
  1076. return ($this->lstCreator = QType::Cast($mixValue, 'QControl'));
  1077. case 'CopyrightNoticeControl':
  1078. return ($this->txtCopyrightNotice = QType::Cast($mixValue, 'QControl'));
  1079. case 'CreationDateControl':
  1080. return ($this->lblCreationDate = QType::Cast($mixValue, 'QControl'));
  1081. case 'LastModificationControl':
  1082. return ($this->lblLastModification = QType::Cast($mixValue, 'QControl'));
  1083. case 'TypeIdControl':
  1084. return ($this->lstType = QType::Cast($mixValue, 'QControl'));
  1085. case 'StatusIdControl':
  1086. return ($this->lstStatus = QType::Cast($mixValue, 'QControl'));
  1087. case 'ContentBlockControl':
  1088. return ($this->lstContentBlocks = QType::Cast($mixValue, 'QControl'));
  1089. case 'ContentCategoryControl':
  1090. return ($this->lstContentCategories = QType::Cast($mixValue, 'QControl'));
  1091. case 'UsergroupControl':
  1092. return ($this->lstUsergroups = QType::Cast($mixValue, 'QControl'));
  1093. default:
  1094. return parent::__set($strName, $mixValue);
  1095. }
  1096. } catch (QCallerException $objExc) {
  1097. $objExc->IncrementOffset();
  1098. throw $objExc;
  1099. }
  1100. }
  1101. }
  1102. ?>