public function init() { $options = new Filmetadata(); foreach ($options->fetchAlltoFlatArray() as $k => $v) { if (isset($v['mlabel'])) { $this->addMultiOption($k, $v['mlabel']); } } }
public function __construct($options = null) { parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->setName('filmetadata'); $id = new Zend_Form_Element_Hidden('id'); $hash = new Zend_Form_Element_Hash('no_csrf_foo', array('salt' => '4s564evzaSD64sf')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton'); $label = new Zend_Form_Element_Textarea('label'); $label->setLabel('label'); $desc = new Zend_Form_Element_Textarea('desc'); $desc->setLabel('desc'); $safinstancesId = new Zend_Form_Element_Select('safinstances_id'); $options = new Safinstances(); $safinstancesId->addMultiOption('', '----------'); foreach ($options->fetchAlltoFlatArray() as $k => $v) { $safinstancesId->addMultiOption($k, $v['mlabel']); } $safinstancesId->setLabel('safinstances_id'); $parentId = new Zend_Form_Element_Select('parent_id'); $options = new Filmetadata(); $parentId->addMultiOption('', '----------'); foreach ($options->fetchAlltoFlatArray() as $k => $v) { $parentId->addMultiOption($k, $v['mlabel']); } $parentId->setLabel('parent_id'); $isNode = new Zend_Form_Element_Text('isnode'); $isNode->setLabel('isnode'); $editable = new Zend_Form_Element_Text('editable'); $editable->setLabel('editable'); $fileFilesFileMetaData = new FilfileslistForm('FilfilesFilmetadata'); $fileFilesFileMetaData->setLabel('FilfilesFilmetadata'); $fileMetaDataFileType = new FiltypelistForm('FilmetadataFiltype'); $fileMetaDataFileType->setLabel('FilmetadataFiltype'); $this->addElements(array($id, $hash, $label, $desc, $safinstancesId, $parentId, $isNode, $editable, $fileFilesFileMetaData, $fileMetaDataFileType)); $this->addElements(array($submit)); }