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.

31 lines
1.9 KiB

  1. /**
  2. * Create and setup QListBox <%= $strControlId %>
  3. * @param string $strControlId optional ControlId to use
  4. * @return QListBox
  5. */
  6. public function <%= $strControlId %>_Create($strControlId = null) {
  7. $this-><%= $strControlId %> = new QListBox($this->objParentObject, $strControlId);
  8. $this-><%= $strControlId %>->Name = QApplication::Translate('<%= QConvertNotation::WordsFromCamelCase($objColumn->Reference->PropertyName) %>');
  9. <% if ($objColumn->NotNull) { %>
  10. $this-><%=$strControlId %>->Required = true;
  11. <% } %><% if (!$objColumn->NotNull) { %>
  12. $this-><%=$strControlId %>->AddItem(QApplication::Translate('- Select One -'), null);
  13. <% } %>
  14. foreach (<%= $objColumn->Reference->VariableType %>::$NameArray as $intId => $strValue)
  15. $this-><%= $strControlId %>->AddItem(new QListItem($strValue, $intId, $this-><%= $strObjectName %>-><%= $objColumn->PropertyName %> == $intId));
  16. return $this-><%= $strControlId %>;
  17. }
  18. /**
  19. * Create and setup QLabel <%= $strLabelId %>
  20. * @param string $strControlId optional ControlId to use
  21. * @return QLabel
  22. */
  23. public function <%= $strLabelId %>_Create($strControlId = null) {
  24. $this-><%= $strLabelId %> = new QLabel($this->objParentObject, $strControlId);
  25. $this-><%= $strLabelId %>->Name = QApplication::Translate('<%= QConvertNotation::WordsFromCamelCase($objColumn->Reference->PropertyName) %>');
  26. $this-><%= $strLabelId %>->Text = ($this-><%= $strObjectName %>-><%= $objColumn->PropertyName %>) ? <%= $objColumn->Reference->VariableType %>::$NameArray[$this-><%= $strObjectName %>-><%= $objColumn->PropertyName %>] : null;
  27. <% if ($objColumn->NotNull) { %>
  28. $this-><%=$strLabelId %>->Required = true;
  29. <% } %>
  30. return $this-><%= $strLabelId %>;
  31. }