Example #1
0
 /**
  * Add custom fields to menu item form for render a simple contact layout menu item
  */
 private function simpleContactLayout()
 {
     # dropdown for contacts
     $txtContact = $this->createElement("select", "contact")->setOrder($this->order++)->setLabel("CONTACT_SELECT")->setRequired(true);
     $mdlContact = new Contact_Model_Contact();
     $contactList = $mdlContact->getPublishedList();
     foreach ($contactList as $contact) {
         $title = $contact->first_name . ' ' . $contact->last_name;
         $title .= strlen($contact->con_position) > 0 ? ' [' . $contact->con_position . ']' : '';
         $txtContact->addMultiOption($contact->id, $title);
     }
     $this->addElement($txtContact);
     # we can add more conditions like set require for some fields or even show them
 }