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.

19 lines
1.8 KiB

  1. if ($this-><%= $strControlId %>) {
  2. $this-><%= $strControlId %>->RemoveAllItems();
  3. $objAssociatedArray = $this-><%= $strObjectName %>->Get<%= $objManyToManyReference->ObjectDescription; %>Array();
  4. $<%= $objManyToManyReference->VariableName %>Array = <%= $objManyToManyReference->VariableType %>::LoadAll();
  5. if ($<%= $objManyToManyReference->VariableName %>Array) foreach ($<%= $objManyToManyReference->VariableName %>Array as $<%= $objManyToManyReference->VariableName %>) {
  6. $objListItem = new QListItem($<%= $objManyToManyReference->VariableName %>->__toString(), $<%= $objManyToManyReference->VariableName %>-><%= $objCodeGen->GetTable($objManyToManyReference->AssociatedTable)->PrimaryKeyColumnArray[0]->PropertyName %>);
  7. foreach ($objAssociatedArray as $objAssociated) {
  8. if ($objAssociated-><%= $objCodeGen->GetTable($objManyToManyReference->AssociatedTable)->PrimaryKeyColumnArray[0]->PropertyName %> == $<%= $objManyToManyReference->VariableName %>-><%= $objCodeGen->GetTable($objManyToManyReference->AssociatedTable)->PrimaryKeyColumnArray[0]->PropertyName %>)
  9. $objListItem->Selected = true;
  10. }
  11. $this-><%=$strControlId %>->AddItem($objListItem);
  12. }
  13. }
  14. if ($this-><%= $strLabelId %>) {
  15. $objAssociatedArray = $this-><%= $strObjectName %>->Get<%= $objManyToManyReference->ObjectDescription; %>Array();
  16. $strItems = array();
  17. foreach ($objAssociatedArray as $objAssociated)
  18. $strItems[] = $objAssociated->__toString();
  19. $this-><%= $strLabelId %>->Text = implode($strGlue, $strItems);
  20. }