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.

666 lines
31 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 Module 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 Module 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 ModuleMetaControl
  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 Module $Module the actual Module 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 $ClassNameControl
  30. * property-read QLabel $ClassNameLabel
  31. * property QCheckBox $ShowTitleControl
  32. * property-read QLabel $ShowTitleLabel
  33. * property QCheckBox $ShowDescriptionControl
  34. * property-read QLabel $ShowDescriptionLabel
  35. * property QListBox $ContentBlockIdControl
  36. * property-read QLabel $ContentBlockIdLabel
  37. * property QListBox $ParentModuleIdControl
  38. * property-read QLabel $ParentModuleIdLabel
  39. * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
  40. * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
  41. */
  42. class ModuleMetaControlGen extends QBaseClass {
  43. // General Variables
  44. protected $objModule;
  45. protected $objParentObject;
  46. protected $strTitleVerb;
  47. protected $blnEditMode;
  48. // Controls that allow the editing of Module's individual data fields
  49. protected $lblId;
  50. protected $txtName;
  51. protected $txtCssclass;
  52. protected $txtTitle;
  53. protected $txtDescription;
  54. protected $txtClassName;
  55. protected $chkShowTitle;
  56. protected $chkShowDescription;
  57. protected $lstContentBlock;
  58. protected $lstParentModule;
  59. // Controls that allow the viewing of Module's individual data fields
  60. protected $lblName;
  61. protected $lblCssclass;
  62. protected $lblTitle;
  63. protected $lblDescription;
  64. protected $lblClassName;
  65. protected $lblShowTitle;
  66. protected $lblShowDescription;
  67. protected $lblContentBlockId;
  68. protected $lblParentModuleId;
  69. // QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References
  70. // QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References
  71. /**
  72. * Main constructor. Constructor OR static create methods are designed to be called in either
  73. * a parent QPanel or the main QForm when wanting to create a
  74. * ModuleMetaControl to edit a single Module object within the
  75. * QPanel or QForm.
  76. *
  77. * This constructor takes in a single Module object, while any of the static
  78. * create methods below can be used to construct based off of individual PK ID(s).
  79. *
  80. * @param mixed $objParentObject QForm or QPanel which will be using this ModuleMetaControl
  81. * @param Module $objModule new or existing Module object
  82. */
  83. public function __construct($objParentObject, Module $objModule) {
  84. // Setup Parent Object (e.g. QForm or QPanel which will be using this ModuleMetaControl)
  85. $this->objParentObject = $objParentObject;
  86. // Setup linked Module object
  87. $this->objModule = $objModule;
  88. // Figure out if we're Editing or Creating New
  89. if ($this->objModule->__Restored) {
  90. $this->strTitleVerb = QApplication::Translate('Edit');
  91. $this->blnEditMode = true;
  92. } else {
  93. $this->strTitleVerb = QApplication::Translate('Create');
  94. $this->blnEditMode = false;
  95. }
  96. }
  97. /**
  98. * Static Helper Method to Create using PK arguments
  99. * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
  100. * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
  101. * static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
  102. * edit, or if we are also allowed to create a new one, etc.
  103. *
  104. * @param mixed $objParentObject QForm or QPanel which will be using this ModuleMetaControl
  105. * @param integer $intId primary key value
  106. * @param QMetaControlCreateType $intCreateType rules governing Module object creation - defaults to CreateOrEdit
  107. * @return ModuleMetaControl
  108. */
  109. public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  110. // Attempt to Load from PK Arguments
  111. if (strlen($intId)) {
  112. $objModule = Module::Load($intId);
  113. // Module was found -- return it!
  114. if ($objModule)
  115. return new ModuleMetaControl($objParentObject, $objModule);
  116. // If CreateOnRecordNotFound not specified, throw an exception
  117. else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
  118. throw new QCallerException('Could not find a Module object with PK arguments: ' . $intId);
  119. // If EditOnly is specified, throw an exception
  120. } else if ($intCreateType == QMetaControlCreateType::EditOnly)
  121. throw new QCallerException('No PK arguments specified');
  122. // If we are here, then we need to create a new record
  123. return new ModuleMetaControl($objParentObject, new Module());
  124. }
  125. /**
  126. * Static Helper Method to Create using PathInfo arguments
  127. *
  128. * @param mixed $objParentObject QForm or QPanel which will be using this ModuleMetaControl
  129. * @param QMetaControlCreateType $intCreateType rules governing Module object creation - defaults to CreateOrEdit
  130. * @return ModuleMetaControl
  131. */
  132. public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  133. $intId = QApplication::PathInfo(0);
  134. return ModuleMetaControl::Create($objParentObject, $intId, $intCreateType);
  135. }
  136. /**
  137. * Static Helper Method to Create using QueryString arguments
  138. *
  139. * @param mixed $objParentObject QForm or QPanel which will be using this ModuleMetaControl
  140. * @param QMetaControlCreateType $intCreateType rules governing Module object creation - defaults to CreateOrEdit
  141. * @return ModuleMetaControl
  142. */
  143. public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
  144. $intId = QApplication::QueryString('intId');
  145. return ModuleMetaControl::Create($objParentObject, $intId, $intCreateType);
  146. }
  147. ///////////////////////////////////////////////
  148. // PUBLIC CREATE and REFRESH METHODS
  149. ///////////////////////////////////////////////
  150. /**
  151. * Create and setup QLabel lblId
  152. * @param string $strControlId optional ControlId to use
  153. * @return QLabel
  154. */
  155. public function lblId_Create($strControlId = null) {
  156. $this->lblId = new QLabel($this->objParentObject, $strControlId);
  157. $this->lblId->Name = QApplication::Translate('Id');
  158. if ($this->blnEditMode)
  159. $this->lblId->Text = $this->objModule->Id;
  160. else
  161. $this->lblId->Text = 'N/A';
  162. return $this->lblId;
  163. }
  164. /**
  165. * Create and setup QTextBox txtName
  166. * @param string $strControlId optional ControlId to use
  167. * @return QTextBox
  168. */
  169. public function txtName_Create($strControlId = null) {
  170. $this->txtName = new QTextBox($this->objParentObject, $strControlId);
  171. $this->txtName->Name = QApplication::Translate('Name');
  172. $this->txtName->Text = $this->objModule->Name;
  173. $this->txtName->Required = true;
  174. $this->txtName->MaxLength = Module::NameMaxLength;
  175. return $this->txtName;
  176. }
  177. /**
  178. * Create and setup QLabel lblName
  179. * @param string $strControlId optional ControlId to use
  180. * @return QLabel
  181. */
  182. public function lblName_Create($strControlId = null) {
  183. $this->lblName = new QLabel($this->objParentObject, $strControlId);
  184. $this->lblName->Name = QApplication::Translate('Name');
  185. $this->lblName->Text = $this->objModule->Name;
  186. $this->lblName->Required = true;
  187. return $this->lblName;
  188. }
  189. /**
  190. * Create and setup QTextBox txtCssclass
  191. * @param string $strControlId optional ControlId to use
  192. * @return QTextBox
  193. */
  194. public function txtCssclass_Create($strControlId = null) {
  195. $this->txtCssclass = new QTextBox($this->objParentObject, $strControlId);
  196. $this->txtCssclass->Name = QApplication::Translate('Cssclass');
  197. $this->txtCssclass->Text = $this->objModule->Cssclass;
  198. $this->txtCssclass->MaxLength = Module::CssclassMaxLength;
  199. return $this->txtCssclass;
  200. }
  201. /**
  202. * Create and setup QLabel lblCssclass
  203. * @param string $strControlId optional ControlId to use
  204. * @return QLabel
  205. */
  206. public function lblCssclass_Create($strControlId = null) {
  207. $this->lblCssclass = new QLabel($this->objParentObject, $strControlId);
  208. $this->lblCssclass->Name = QApplication::Translate('Cssclass');
  209. $this->lblCssclass->Text = $this->objModule->Cssclass;
  210. return $this->lblCssclass;
  211. }
  212. /**
  213. * Create and setup QTextBox txtTitle
  214. * @param string $strControlId optional ControlId to use
  215. * @return QTextBox
  216. */
  217. public function txtTitle_Create($strControlId = null) {
  218. $this->txtTitle = new QTextBox($this->objParentObject, $strControlId);
  219. $this->txtTitle->Name = QApplication::Translate('Title');
  220. $this->txtTitle->Text = $this->objModule->Title;
  221. $this->txtTitle->MaxLength = Module::TitleMaxLength;
  222. return $this->txtTitle;
  223. }
  224. /**
  225. * Create and setup QLabel lblTitle
  226. * @param string $strControlId optional ControlId to use
  227. * @return QLabel
  228. */
  229. public function lblTitle_Create($strControlId = null) {
  230. $this->lblTitle = new QLabel($this->objParentObject, $strControlId);
  231. $this->lblTitle->Name = QApplication::Translate('Title');
  232. $this->lblTitle->Text = $this->objModule->Title;
  233. return $this->lblTitle;
  234. }
  235. /**
  236. * Create and setup QTextBox txtDescription
  237. * @param string $strControlId optional ControlId to use
  238. * @return QTextBox
  239. */
  240. public function txtDescription_Create($strControlId = null) {
  241. $this->txtDescription = new QTextBox($this->objParentObject, $strControlId);
  242. $this->txtDescription->Name = QApplication::Translate('Description');
  243. $this->txtDescription->Text = $this->objModule->Description;
  244. $this->txtDescription->MaxLength = Module::DescriptionMaxLength;
  245. return $this->txtDescription;
  246. }
  247. /**
  248. * Create and setup QLabel lblDescription
  249. * @param string $strControlId optional ControlId to use
  250. * @return QLabel
  251. */
  252. public function lblDescription_Create($strControlId = null) {
  253. $this->lblDescription = new QLabel($this->objParentObject, $strControlId);
  254. $this->lblDescription->Name = QApplication::Translate('Description');
  255. $this->lblDescription->Text = $this->objModule->Description;
  256. return $this->lblDescription;
  257. }
  258. /**
  259. * Create and setup QTextBox txtClassName
  260. * @param string $strControlId optional ControlId to use
  261. * @return QTextBox
  262. */
  263. public function txtClassName_Create($strControlId = null) {
  264. $this->txtClassName = new QTextBox($this->objParentObject, $strControlId);
  265. $this->txtClassName->Name = QApplication::Translate('Class Name');
  266. $this->txtClassName->Text = $this->objModule->ClassName;
  267. $this->txtClassName->MaxLength = Module::ClassNameMaxLength;
  268. return $this->txtClassName;
  269. }
  270. /**
  271. * Create and setup QLabel lblClassName
  272. * @param string $strControlId optional ControlId to use
  273. * @return QLabel
  274. */
  275. public function lblClassName_Create($strControlId = null) {
  276. $this->lblClassName = new QLabel($this->objParentObject, $strControlId);
  277. $this->lblClassName->Name = QApplication::Translate('Class Name');
  278. $this->lblClassName->Text = $this->objModule->ClassName;
  279. return $this->lblClassName;
  280. }
  281. /**
  282. * Create and setup QCheckBox chkShowTitle
  283. * @param string $strControlId optional ControlId to use
  284. * @return QCheckBox
  285. */
  286. public function chkShowTitle_Create($strControlId = null) {
  287. $this->chkShowTitle = new QCheckBox($this->objParentObject, $strControlId);
  288. $this->chkShowTitle->Name = QApplication::Translate('Show Title');
  289. $this->chkShowTitle->Checked = $this->objModule->ShowTitle;
  290. return $this->chkShowTitle;
  291. }
  292. /**
  293. * Create and setup QLabel lblShowTitle
  294. * @param string $strControlId optional ControlId to use
  295. * @return QLabel
  296. */
  297. public function lblShowTitle_Create($strControlId = null) {
  298. $this->lblShowTitle = new QLabel($this->objParentObject, $strControlId);
  299. $this->lblShowTitle->Name = QApplication::Translate('Show Title');
  300. $this->lblShowTitle->Text = ($this->objModule->ShowTitle) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  301. return $this->lblShowTitle;
  302. }
  303. /**
  304. * Create and setup QCheckBox chkShowDescription
  305. * @param string $strControlId optional ControlId to use
  306. * @return QCheckBox
  307. */
  308. public function chkShowDescription_Create($strControlId = null) {
  309. $this->chkShowDescription = new QCheckBox($this->objParentObject, $strControlId);
  310. $this->chkShowDescription->Name = QApplication::Translate('Show Description');
  311. $this->chkShowDescription->Checked = $this->objModule->ShowDescription;
  312. return $this->chkShowDescription;
  313. }
  314. /**
  315. * Create and setup QLabel lblShowDescription
  316. * @param string $strControlId optional ControlId to use
  317. * @return QLabel
  318. */
  319. public function lblShowDescription_Create($strControlId = null) {
  320. $this->lblShowDescription = new QLabel($this->objParentObject, $strControlId);
  321. $this->lblShowDescription->Name = QApplication::Translate('Show Description');
  322. $this->lblShowDescription->Text = ($this->objModule->ShowDescription) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  323. return $this->lblShowDescription;
  324. }
  325. /**
  326. * Create and setup QListBox lstContentBlock
  327. * @param string $strControlId optional ControlId to use
  328. * @return QListBox
  329. */
  330. public function lstContentBlock_Create($strControlId = null) {
  331. $this->lstContentBlock = new QListBox($this->objParentObject, $strControlId);
  332. $this->lstContentBlock->Name = QApplication::Translate('Content Block');
  333. $this->lstContentBlock->AddItem(QApplication::Translate('- Select One -'), null);
  334. $objContentBlockArray = ContentBlock::LoadAll();
  335. if ($objContentBlockArray) foreach ($objContentBlockArray as $objContentBlock) {
  336. $objListItem = new QListItem($objContentBlock->__toString(), $objContentBlock->Id);
  337. if (($this->objModule->ContentBlock) && ($this->objModule->ContentBlock->Id == $objContentBlock->Id))
  338. $objListItem->Selected = true;
  339. $this->lstContentBlock->AddItem($objListItem);
  340. }
  341. return $this->lstContentBlock;
  342. }
  343. /**
  344. * Create and setup QLabel lblContentBlockId
  345. * @param string $strControlId optional ControlId to use
  346. * @return QLabel
  347. */
  348. public function lblContentBlockId_Create($strControlId = null) {
  349. $this->lblContentBlockId = new QLabel($this->objParentObject, $strControlId);
  350. $this->lblContentBlockId->Name = QApplication::Translate('Content Block');
  351. $this->lblContentBlockId->Text = ($this->objModule->ContentBlock) ? $this->objModule->ContentBlock->__toString() : null;
  352. return $this->lblContentBlockId;
  353. }
  354. /**
  355. * Create and setup QListBox lstParentModule
  356. * @param string $strControlId optional ControlId to use
  357. * @return QListBox
  358. */
  359. public function lstParentModule_Create($strControlId = null) {
  360. $this->lstParentModule = new QListBox($this->objParentObject, $strControlId);
  361. $this->lstParentModule->Name = QApplication::Translate('Parent Module');
  362. $this->lstParentModule->AddItem(QApplication::Translate('- Select One -'), null);
  363. $objParentModuleArray = Module::LoadAll();
  364. if ($objParentModuleArray) foreach ($objParentModuleArray as $objParentModule) {
  365. $objListItem = new QListItem($objParentModule->__toString(), $objParentModule->Id);
  366. if (($this->objModule->ParentModule) && ($this->objModule->ParentModule->Id == $objParentModule->Id))
  367. $objListItem->Selected = true;
  368. $this->lstParentModule->AddItem($objListItem);
  369. }
  370. return $this->lstParentModule;
  371. }
  372. /**
  373. * Create and setup QLabel lblParentModuleId
  374. * @param string $strControlId optional ControlId to use
  375. * @return QLabel
  376. */
  377. public function lblParentModuleId_Create($strControlId = null) {
  378. $this->lblParentModuleId = new QLabel($this->objParentObject, $strControlId);
  379. $this->lblParentModuleId->Name = QApplication::Translate('Parent Module');
  380. $this->lblParentModuleId->Text = ($this->objModule->ParentModule) ? $this->objModule->ParentModule->__toString() : null;
  381. return $this->lblParentModuleId;
  382. }
  383. /**
  384. * Refresh this MetaControl with Data from the local Module object.
  385. * @param boolean $blnReload reload Module from the database
  386. * @return void
  387. */
  388. public function Refresh($blnReload = false) {
  389. if ($blnReload)
  390. $this->objModule->Reload();
  391. if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objModule->Id;
  392. if ($this->txtName) $this->txtName->Text = $this->objModule->Name;
  393. if ($this->lblName) $this->lblName->Text = $this->objModule->Name;
  394. if ($this->txtCssclass) $this->txtCssclass->Text = $this->objModule->Cssclass;
  395. if ($this->lblCssclass) $this->lblCssclass->Text = $this->objModule->Cssclass;
  396. if ($this->txtTitle) $this->txtTitle->Text = $this->objModule->Title;
  397. if ($this->lblTitle) $this->lblTitle->Text = $this->objModule->Title;
  398. if ($this->txtDescription) $this->txtDescription->Text = $this->objModule->Description;
  399. if ($this->lblDescription) $this->lblDescription->Text = $this->objModule->Description;
  400. if ($this->txtClassName) $this->txtClassName->Text = $this->objModule->ClassName;
  401. if ($this->lblClassName) $this->lblClassName->Text = $this->objModule->ClassName;
  402. if ($this->chkShowTitle) $this->chkShowTitle->Checked = $this->objModule->ShowTitle;
  403. if ($this->lblShowTitle) $this->lblShowTitle->Text = ($this->objModule->ShowTitle) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  404. if ($this->chkShowDescription) $this->chkShowDescription->Checked = $this->objModule->ShowDescription;
  405. if ($this->lblShowDescription) $this->lblShowDescription->Text = ($this->objModule->ShowDescription) ? QApplication::Translate('Yes') : QApplication::Translate('No');
  406. if ($this->lstContentBlock) {
  407. $this->lstContentBlock->RemoveAllItems();
  408. $this->lstContentBlock->AddItem(QApplication::Translate('- Select One -'), null);
  409. $objContentBlockArray = ContentBlock::LoadAll();
  410. if ($objContentBlockArray) foreach ($objContentBlockArray as $objContentBlock) {
  411. $objListItem = new QListItem($objContentBlock->__toString(), $objContentBlock->Id);
  412. if (($this->objModule->ContentBlock) && ($this->objModule->ContentBlock->Id == $objContentBlock->Id))
  413. $objListItem->Selected = true;
  414. $this->lstContentBlock->AddItem($objListItem);
  415. }
  416. }
  417. if ($this->lblContentBlockId) $this->lblContentBlockId->Text = ($this->objModule->ContentBlock) ? $this->objModule->ContentBlock->__toString() : null;
  418. if ($this->lstParentModule) {
  419. $this->lstParentModule->RemoveAllItems();
  420. $this->lstParentModule->AddItem(QApplication::Translate('- Select One -'), null);
  421. $objParentModuleArray = Module::LoadAll();
  422. if ($objParentModuleArray) foreach ($objParentModuleArray as $objParentModule) {
  423. $objListItem = new QListItem($objParentModule->__toString(), $objParentModule->Id);
  424. if (($this->objModule->ParentModule) && ($this->objModule->ParentModule->Id == $objParentModule->Id))
  425. $objListItem->Selected = true;
  426. $this->lstParentModule->AddItem($objListItem);
  427. }
  428. }
  429. if ($this->lblParentModuleId) $this->lblParentModuleId->Text = ($this->objModule->ParentModule) ? $this->objModule->ParentModule->__toString() : null;
  430. }
  431. ///////////////////////////////////////////////
  432. // PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
  433. ///////////////////////////////////////////////
  434. ///////////////////////////////////////////////
  435. // PUBLIC MODULE OBJECT MANIPULATORS
  436. ///////////////////////////////////////////////
  437. /**
  438. * This will save this object's Module instance,
  439. * updating only the fields which have had a control created for it.
  440. */
  441. public function SaveModule() {
  442. try {
  443. // Update any fields for controls that have been created
  444. if ($this->txtName) $this->objModule->Name = $this->txtName->Text;
  445. if ($this->txtCssclass) $this->objModule->Cssclass = $this->txtCssclass->Text;
  446. if ($this->txtTitle) $this->objModule->Title = $this->txtTitle->Text;
  447. if ($this->txtDescription) $this->objModule->Description = $this->txtDescription->Text;
  448. if ($this->txtClassName) $this->objModule->ClassName = $this->txtClassName->Text;
  449. if ($this->chkShowTitle) $this->objModule->ShowTitle = $this->chkShowTitle->Checked;
  450. if ($this->chkShowDescription) $this->objModule->ShowDescription = $this->chkShowDescription->Checked;
  451. if ($this->lstContentBlock) $this->objModule->ContentBlockId = $this->lstContentBlock->SelectedValue;
  452. if ($this->lstParentModule) $this->objModule->ParentModuleId = $this->lstParentModule->SelectedValue;
  453. // Update any UniqueReverseReferences (if any) for controls that have been created for it
  454. // Save the Module object
  455. $this->objModule->Save();
  456. // Finally, update any ManyToManyReferences (if any)
  457. } catch (QCallerException $objExc) {
  458. $objExc->IncrementOffset();
  459. throw $objExc;
  460. }
  461. }
  462. /**
  463. * This will DELETE this object's Module instance from the database.
  464. * It will also unassociate itself from any ManyToManyReferences.
  465. */
  466. public function DeleteModule() {
  467. $this->objModule->Delete();
  468. }
  469. ///////////////////////////////////////////////
  470. // PUBLIC GETTERS and SETTERS
  471. ///////////////////////////////////////////////
  472. /**
  473. * Override method to perform a property "Get"
  474. * This will get the value of $strName
  475. *
  476. * @param string $strName Name of the property to get
  477. * @return mixed
  478. */
  479. public function __get($strName) {
  480. switch ($strName) {
  481. // General MetaControlVariables
  482. case 'Module': return $this->objModule;
  483. case 'TitleVerb': return $this->strTitleVerb;
  484. case 'EditMode': return $this->blnEditMode;
  485. // Controls that point to Module fields -- will be created dynamically if not yet created
  486. case 'IdControl':
  487. if (!$this->lblId) return $this->lblId_Create();
  488. return $this->lblId;
  489. case 'IdLabel':
  490. if (!$this->lblId) return $this->lblId_Create();
  491. return $this->lblId;
  492. case 'NameControl':
  493. if (!$this->txtName) return $this->txtName_Create();
  494. return $this->txtName;
  495. case 'NameLabel':
  496. if (!$this->lblName) return $this->lblName_Create();
  497. return $this->lblName;
  498. case 'CssclassControl':
  499. if (!$this->txtCssclass) return $this->txtCssclass_Create();
  500. return $this->txtCssclass;
  501. case 'CssclassLabel':
  502. if (!$this->lblCssclass) return $this->lblCssclass_Create();
  503. return $this->lblCssclass;
  504. case 'TitleControl':
  505. if (!$this->txtTitle) return $this->txtTitle_Create();
  506. return $this->txtTitle;
  507. case 'TitleLabel':
  508. if (!$this->lblTitle) return $this->lblTitle_Create();
  509. return $this->lblTitle;
  510. case 'DescriptionControl':
  511. if (!$this->txtDescription) return $this->txtDescription_Create();
  512. return $this->txtDescription;
  513. case 'DescriptionLabel':
  514. if (!$this->lblDescription) return $this->lblDescription_Create();
  515. return $this->lblDescription;
  516. case 'ClassNameControl':
  517. if (!$this->txtClassName) return $this->txtClassName_Create();
  518. return $this->txtClassName;
  519. case 'ClassNameLabel':
  520. if (!$this->lblClassName) return $this->lblClassName_Create();
  521. return $this->lblClassName;
  522. case 'ShowTitleControl':
  523. if (!$this->chkShowTitle) return $this->chkShowTitle_Create();
  524. return $this->chkShowTitle;
  525. case 'ShowTitleLabel':
  526. if (!$this->lblShowTitle) return $this->lblShowTitle_Create();
  527. return $this->lblShowTitle;
  528. case 'ShowDescriptionControl':
  529. if (!$this->chkShowDescription) return $this->chkShowDescription_Create();
  530. return $this->chkShowDescription;
  531. case 'ShowDescriptionLabel':
  532. if (!$this->lblShowDescription) return $this->lblShowDescription_Create();
  533. return $this->lblShowDescription;
  534. case 'ContentBlockIdControl':
  535. if (!$this->lstContentBlock) return $this->lstContentBlock_Create();
  536. return $this->lstContentBlock;
  537. case 'ContentBlockIdLabel':
  538. if (!$this->lblContentBlockId) return $this->lblContentBlockId_Create();
  539. return $this->lblContentBlockId;
  540. case 'ParentModuleIdControl':
  541. if (!$this->lstParentModule) return $this->lstParentModule_Create();
  542. return $this->lstParentModule;
  543. case 'ParentModuleIdLabel':
  544. if (!$this->lblParentModuleId) return $this->lblParentModuleId_Create();
  545. return $this->lblParentModuleId;
  546. default:
  547. try {
  548. return parent::__get($strName);
  549. } catch (QCallerException $objExc) {
  550. $objExc->IncrementOffset();
  551. throw $objExc;
  552. }
  553. }
  554. }
  555. /**
  556. * Override method to perform a property "Set"
  557. * This will set the property $strName to be $mixValue
  558. *
  559. * @param string $strName Name of the property to set
  560. * @param string $mixValue New value of the property
  561. * @return mixed
  562. */
  563. public function __set($strName, $mixValue) {
  564. try {
  565. switch ($strName) {
  566. // Controls that point to Module fields
  567. case 'IdControl':
  568. return ($this->lblId = QType::Cast($mixValue, 'QControl'));
  569. case 'NameControl':
  570. return ($this->txtName = QType::Cast($mixValue, 'QControl'));
  571. case 'CssclassControl':
  572. return ($this->txtCssclass = QType::Cast($mixValue, 'QControl'));
  573. case 'TitleControl':
  574. return ($this->txtTitle = QType::Cast($mixValue, 'QControl'));
  575. case 'DescriptionControl':
  576. return ($this->txtDescription = QType::Cast($mixValue, 'QControl'));
  577. case 'ClassNameControl':
  578. return ($this->txtClassName = QType::Cast($mixValue, 'QControl'));
  579. case 'ShowTitleControl':
  580. return ($this->chkShowTitle = QType::Cast($mixValue, 'QControl'));
  581. case 'ShowDescriptionControl':
  582. return ($this->chkShowDescription = QType::Cast($mixValue, 'QControl'));
  583. case 'ContentBlockIdControl':
  584. return ($this->lstContentBlock = QType::Cast($mixValue, 'QControl'));
  585. case 'ParentModuleIdControl':
  586. return ($this->lstParentModule = QType::Cast($mixValue, 'QControl'));
  587. default:
  588. return parent::__set($strName, $mixValue);
  589. }
  590. } catch (QCallerException $objExc) {
  591. $objExc->IncrementOffset();
  592. throw $objExc;
  593. }
  594. }
  595. }
  596. ?>