A Qcodo based CMS/ecommerce framework
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.

168 lines
6.7 KiB

12 years ago
  1. <?php
  2. require(__DATAGEN_META_CONTROLS__ . '/ContentItemMetaControlGen.class.php');
  3. /**
  4. * This is a MetaControl customizable subclass, providing a QForm or QPanel access to event handlers
  5. * and QControls to perform the Create, Edit, and Delete functionality of the
  6. * ContentItem class. This code-generated class extends from
  7. * the generated MetaControl class, which contains all the basic elements to help a QPanel or QForm
  8. * display an HTML form that can manipulate a single ContentItem object.
  9. *
  10. * To take advantage of some (or all) of these control objects, you
  11. * must create a new QForm or QPanel which instantiates a ContentItemMetaControl
  12. * class.
  13. *
  14. * This file is intended to be modified. Subsequent code regenerations will NOT modify
  15. * or overwrite this file.
  16. *
  17. * @package Quasi
  18. * @subpackage MetaControls
  19. */
  20. class ContentItemMetaControl extends ContentItemMetaControlGen
  21. {
  22. // Controls that allow the viewing of ContentItem's individual data fields as QPanels
  23. protected $pnlName;
  24. protected $pnlClass;
  25. protected $pnlTitle;
  26. protected $pnlDescription;
  27. protected $pnlText;
  28. protected $pnlCreatorId;
  29. protected $pnlCreationDate;
  30. protected $pnlLastModification;
  31. protected $pnlPublicPermissionsId;
  32. protected $pnlUserPermissionsId;
  33. protected $pnlGroupPermissionsId;
  34. protected $pnlTypeId;
  35. protected $pnlStatusId;
  36. /**
  37. * Create and setup QPanel pnlTitle
  38. * @param string $strControlId optional ControlId to use
  39. * @return QPanel
  40. */
  41. public function pnlTitle_Create($strControlId = null)
  42. {
  43. if($strControlId)
  44. $this->pnlTitle = new QPanel($this->objParentObject, $strControlId . 'Title');
  45. else
  46. $this->pnlTitle = new QPanel($this->objParentObject);
  47. $this->pnlTitle->Name = QApplication::Translate('Title');
  48. $this->pnlTitle->Text = $this->objContentItem->Title;
  49. return $this->pnlTitle;
  50. }
  51. /**
  52. * Create and setup QPanel pnlDescription
  53. * @param string $strControlId optional ControlId to use
  54. * @return QPanel
  55. */
  56. public function pnlDescription_Create($strControlId = null)
  57. {
  58. if($strControlId)
  59. $this->pnlDescription = new QPanel($this->objParentObject, $strControlId . 'Description');
  60. else
  61. $this->pnlDescription = new QPanel($this->objParentObject);
  62. $this->pnlDescription->Name = QApplication::Translate('Description');
  63. $this->pnlDescription->Text = $this->objContentItem->Description;
  64. return $this->pnlDescription;
  65. }
  66. /**
  67. * Create and setup QPanel pnlText
  68. * @param string $strControlId optional ControlId to use
  69. * @return QPanel
  70. */
  71. public function pnlText_Create($strControlId = null)
  72. {
  73. if($strControlId)
  74. $this->pnlText = new QPanel($this->objParentObject, $strControlId . 'Text');
  75. else
  76. $this->pnlText = new QPanel($this->objParentObject );
  77. $this->pnlText->Name = QApplication::Translate('Text');
  78. $this->pnlText->Text = $this->objContentItem->Text;
  79. return $this->pnlText;
  80. }
  81. /**
  82. * Create and setup QPanel pnlCreatorId
  83. * @param string $strControlId optional ControlId to use
  84. * @return QPanel
  85. */
  86. public function pnlCreatorId_Create($strControlId = null)
  87. {
  88. if($strControlId)
  89. $this->pnlCreatorId = new QPanel($this->objParentObject, $strControlId . 'Creator');
  90. else
  91. $this->pnlCreatorId = new QPanel($this->objParentObject);
  92. $this->pnlCreatorId->Name = QApplication::Translate('Creator');
  93. $this->pnlCreatorId->Text = ($this->objContentItem->Creator) ? $this->objContentItem->Creator->__toString() : null;
  94. $this->pnlCreatorId->Required = true;
  95. return $this->pnlCreatorId;
  96. }
  97. /**
  98. * Create and setup QPanel pnlCreationDate
  99. * @param string $strControlId optional ControlId to use
  100. * @return QPanel
  101. */
  102. public function pnlCreationDate_Create($strControlId = null, $blnShowHour = false, $blnShowMinutes = false, $blnShowSeconds = false)
  103. {
  104. if($strControlId)
  105. $this->pnlCreationDate = new QPanel($this->objParentObject, $strControlId . 'CreationDate');
  106. else
  107. $this->pnlCreationDate = new QPanel($this->objParentObject);
  108. $this->pnlCreationDate->Name = QApplication::Translate('Creation Date');
  109. if ($this->blnEditMode)
  110. {
  111. $dttCreationDate = new DateTime($this->objContentItem->CreationDate);
  112. $strFormat = 'M j, Y';
  113. if($blnShowHour)
  114. $strFormat .= ' H';
  115. if($blnShowMinutes)
  116. $strFormat .= ' i';
  117. if($blnShowSeconds)
  118. $strFormat .= ' s';
  119. $this->pnlCreationDate->Text = $dttCreationDate->format($strFormat);
  120. }
  121. else
  122. $this->pnlCreationDate->Text = 'N/A';
  123. return $this->pnlCreationDate;
  124. }
  125. /**
  126. * Create and setup QPanel pnlLastModification
  127. * @param string $strControlId optional ControlId to use
  128. * @return QPanel
  129. */
  130. public function pnlLastModification_Create($strControlId = null, $blnShowHour = false, $blnShowMinutes = false, $blnShowSeconds = false)
  131. {
  132. if($strControlId)
  133. $this->pnlLastModification = new QPanel($this->objParentObject, $strControlId . 'LastModification');
  134. else
  135. $this->pnlLastModification = new QPanel($this->objParentObject);
  136. $this->pnlLastModification->Name = QApplication::Translate('Last Modification');
  137. if ($this->blnEditMode)
  138. {
  139. $dttCreationDate = new DateTime($this->objContentItem->LastModification);
  140. $strFormat = 'M j, Y';
  141. if($blnShowHour)
  142. $strFormat .= ' H';
  143. if($blnShowMinutes)
  144. $strFormat .= ' i';
  145. if($blnShowSeconds)
  146. $strFormat .= ' s';
  147. $this->pnlLastModification->Text = $dttCreationDate->format($strFormat);
  148. }
  149. else
  150. $this->pnlLastModification->Text = 'N/A';
  151. return $this->pnlLastModification;
  152. }
  153. }
  154. ?>