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.

34 lines
1.8 KiB

  1. /**
  2. * Create and setup QTextBox <%= $strControlId %>
  3. * @param string $strControlId optional ControlId to use
  4. * @return QTextBox
  5. */
  6. public function <%= $strControlId %>_Create($strControlId = null) {
  7. $this-><%= $strControlId %> = new QTextBox($this->objParentObject, $strControlId);
  8. $this-><%= $strControlId %>->Name = QApplication::Translate('<%= QConvertNotation::WordsFromCamelCase($objColumn->PropertyName) %>');
  9. $this-><%= $strControlId %>->Text = $this-><%= $strObjectName %>-><%= $objColumn->PropertyName %>;
  10. <% if ($objColumn->NotNull) { %>
  11. $this-><%=$strControlId %>->Required = true;
  12. <% } %>
  13. <% if ($objColumn->DbType == QDatabaseFieldType::Blob) { %>
  14. $this-><%=$strControlId %>->TextMode = QTextMode::MultiLine;
  15. <% } %>
  16. <% if (($objColumn->VariableType == QType::String) && (is_numeric($objColumn->Length))) { %>
  17. $this-><%=$strControlId %>->MaxLength = <%= $strClassName %>::<%= $objColumn->PropertyName %>MaxLength;
  18. <% } %>
  19. return $this-><%= $strControlId %>;
  20. }
  21. /**
  22. * Create and setup QLabel <%= $strLabelId %>
  23. * @param string $strControlId optional ControlId to use
  24. * @return QLabel
  25. */
  26. public function <%= $strLabelId %>_Create($strControlId = null) {
  27. $this-><%= $strLabelId %> = new QLabel($this->objParentObject, $strControlId);
  28. $this-><%= $strLabelId %>->Name = QApplication::Translate('<%= QConvertNotation::WordsFromCamelCase($objColumn->PropertyName) %>');
  29. $this-><%= $strLabelId %>->Text = $this-><%= $strObjectName %>-><%= $objColumn->PropertyName %>;
  30. <% if ($objColumn->NotNull) { %>
  31. $this-><%=$strLabelId %>->Required = true;
  32. <% } %>
  33. return $this-><%= $strLabelId %>;
  34. }