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.
 
 
 

39 lines
2.8 KiB

/**
* Create and setup QListBox <%= $strControlId %>
* @param string $strControlId optional ControlId to use
* @return QListBox
*/
public function <%= $strControlId %>_Create($strControlId = null) {
$this-><%= $strControlId %> = new QListBox($this->objParentObject, $strControlId);
$this-><%= $strControlId %>->Name = QApplication::Translate('<%= QConvertNotation::WordsFromCamelCase($objColumn->Reference->PropertyName) %>');
<% if ($objColumn->NotNull) { %>
$this-><%=$strControlId %>->Required = true;
if (!$this->blnEditMode)
$this-><%=$strControlId %>->AddItem(QApplication::Translate('- Select One -'), null);
<% } %><% if (!$objColumn->NotNull) { %>
$this-><%=$strControlId %>->AddItem(QApplication::Translate('- Select One -'), null);
<% } %>
$<%= $objColumn->Reference->VariableName %>Array = <%= $objColumn->Reference->VariableType %>::LoadAll();
if ($<%= $objColumn->Reference->VariableName %>Array) foreach ($<%= $objColumn->Reference->VariableName %>Array as $<%= $objColumn->Reference->VariableName %>) {
$objListItem = new QListItem($<%= $objColumn->Reference->VariableName %>->__toString(), $<%= $objColumn->Reference->VariableName %>-><%= $objCodeGen->GetTable($objColumn->Reference->Table)->PrimaryKeyColumnArray[0]->PropertyName %>);
if (($this-><%= $strObjectName %>-><%= $objColumn->Reference->PropertyName %>) && ($this-><%= $strObjectName %>-><%= $objColumn->Reference->PropertyName %>-><%= $objCodeGen->GetTable($objColumn->Reference->Table)->PrimaryKeyColumnArray[0]->PropertyName %> == $<%= $objColumn->Reference->VariableName %>-><%= $objCodeGen->GetTable($objColumn->Reference->Table)->PrimaryKeyColumnArray[0]->PropertyName %>))
$objListItem->Selected = true;
$this-><%=$strControlId %>->AddItem($objListItem);
}
return $this-><%= $strControlId %>;
}
/**
* Create and setup QLabel <%= $strLabelId %>
* @param string $strControlId optional ControlId to use
* @return QLabel
*/
public function <%= $strLabelId %>_Create($strControlId = null) {
$this-><%= $strLabelId %> = new QLabel($this->objParentObject, $strControlId);
$this-><%= $strLabelId %>->Name = QApplication::Translate('<%= QConvertNotation::WordsFromCamelCase($objColumn->Reference->PropertyName) %>');
$this-><%= $strLabelId %>->Text = ($this-><%= $strObjectName %>-><%= $objColumn->Reference->PropertyName %>) ? $this-><%= $strObjectName %>-><%= $objColumn->Reference->PropertyName %>->__toString() : null;
<% if ($objColumn->NotNull) { %>
$this-><%=$strLabelId %>->Required = true;
<% } %>
return $this-><%= $strLabelId %>;
}