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.

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