Пример #1
0
 /**
  * Initialisiert Elemente für gesamtes Collections Formular.
  */
 public function init()
 {
     parent::init();
     $this->addElement('submit', self::ELEMENT_ADD, array('order' => 1000, 'label' => 'admin_button_add', 'decorators' => array(), 'disableLoadDefaultDecorators' => true));
     $this->setLegend('admin_document_section_collection');
     $this->getDecorator('FieldsetWithButtons')->setLegendButtons(self::ELEMENT_ADD);
 }
Пример #2
0
 /**
  * Erzeugt die Formularelemente.
  */
 public function init()
 {
     parent::init();
     $this->addElement('hidden', Admin_Form_Person::ELEMENT_PERSON_ID, array('required' => true, 'validators' => array('Int')));
     $this->addElement('PersonRole', self::ELEMENT_ROLE, array('label' => 'Role'));
     $this->addElement('checkbox', self::ELEMENT_ALLOW_CONTACT, array('label' => 'AllowEmailContact'));
     $this->addElement('SortOrder', self::ELEMENT_SORT_ORDER, array('label' => 'SortOrder'));
 }
Пример #3
0
 /**
  * Erzeugt die Formularelemente.
  * 
  * TODO disable translation für EDIT Element
  */
 public function init()
 {
     parent::init();
     $this->addElement('hidden', self::ELEMENT_ID);
     $this->addElement('submit', self::ELEMENT_EDIT);
     $this->getElement(self::ELEMENT_EDIT)->setDisableTranslator(true);
     // Collections are translated manually
     $this->addElement('submit', self::ELEMENT_REMOVE, array('label' => 'admin_button_remove'));
 }
Пример #4
0
 /**
  * Erzeugt Buttons für sämtliche Rollen und kümmert sich um Dekoratoren.
  */
 public function init()
 {
     parent::init();
     $roles = $this->_personRoles;
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul', 'class' => 'links'))));
     foreach ($roles as $role) {
         $this->addElement('submit', $this->getRoleElementName($role), array('decorators' => array('ViewHelper', array('HtmlTag', array('tag' => 'li'))), 'label' => 'Opus_Person_Role_Value_' . ucfirst($role)));
     }
 }
Пример #5
0
 public function init()
 {
     parent::init();
     $this->setLegend('admin_document_section_files');
     $this->setDisableTranslator(true);
     // so legend won't be translated twice
     $header = new Application_Form_TableHeader($this->header);
     $this->addSubForm($header, 'Header');
     $this->setDecorators(array('FormElements', array(array('table' => 'HtmlTag'), array('tag' => 'table')), array(array('fieldsWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'fields-wrapper')), 'Fieldset', array(array('divWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'subform'))));
 }
Пример #6
0
 /**
  * Erzeugt Unterformular für Personen.
  * 
  * Für jede mögliche Rolle wird ein Unterformular angelegt.
  */
 public function init()
 {
     parent::init();
     $this->setLegend('admin_document_section_persons');
     $this->addElement('submit', 'Sort', array('label' => 'admin_button_sort', 'decorators' => array(), 'disableLoadDefaultDecorators' => true));
     $this->getDecorator('FieldsetWithButtons')->setLegendButtons(array('Sort'));
     foreach (self::$_personRoles as $roleName) {
         $subform = new Admin_Form_Document_PersonRole($roleName);
         $this->addSubForm($subform, $roleName);
     }
 }
Пример #7
0
 public function init()
 {
     parent::init();
     $this->addElement('hidden', self::ELEMENT_ID);
     $this->addElement('hash', self::ELEMENT_HASH, array('salt' => 'unique'));
     // TODO salt?
     $this->addElement('submit', self::ELEMENT_SAVE, array('decorators' => array('ViewHelper')));
     $this->addElement('submit', self::ELEMENT_SAVE_AND_CONTINUE, array('decorators' => array('ViewHelper')));
     $this->addElement('submit', self::ELEMENT_CANCEL, array('decorators' => array('ViewHelper')));
     $this->setDecorators(array('PrepareElements', array('ViewScript', array('viewScript' => 'form/documentActions.phtml')), array(array('fieldsWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'fields-wrapper')), array(array('divWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'subform', 'id' => 'subform-Actions'))));
 }
Пример #8
0
 public function init()
 {
     parent::init();
     $element = new Zend_Form_Element_Submit(self::ELEMENT_SAVE);
     $element->setValue('save');
     $element->removeDecorator('DtDdWrapper');
     $this->addElement($element);
     $element = new Zend_Form_Element_Submit(self::ELEMENT_CANCEL);
     $element->setValue('cancel');
     $element->removeDecorator('DtDdWrapper');
     $this->addElement($element);
 }
Пример #9
0
 /**
  * Erzeugt die Formularelemente.
  */
 public function init()
 {
     parent::init();
     $this->setLegend('admin_document_section_general');
     $this->addElement('Language', self::ELEMENT_LANGUAGE, array('label' => 'Language', 'required' => true));
     $this->addElement('DocumentType', self::ELEMENT_TYPE, array('required' => 'true'));
     $this->addElement('Date', self::ELEMENT_PUBLISHED_DATE);
     $this->addElement('Year', self::ELEMENT_PUBLISHED_YEAR);
     $this->addElement('Date', self::ELEMENT_COMPLETED_DATE);
     $this->addElement('Year', self::ELEMENT_COMPLETED_YEAR);
     $this->addElement('Date', self::ELEMENT_EMBARGO_DATE);
 }
Пример #10
0
 /**
  * Erzeugt Checkbox Formularelemente für alle Lizenzen.
  */
 public function init()
 {
     parent::init();
     $licences = Opus_Licence::getAll();
     foreach ($licences as $licence) {
         $element = new Form_Element_Checkbox(self::ELEMENT_NAME_PREFIX . $licence->getId());
         $element->setDisableTranslator(true);
         // Lizenzen werden nicht übersetzt
         $element->setLabel($licence->getNameLong());
         $cssClass = $licence->getActive() ? self::ACTIVE_CSS_CLASS : self::INACTIVE_CSS_CLASS;
         $labelDecorator = $element->getDecorator('Label');
         $labelDecorator->setOption('class', $cssClass);
         $element->setCheckedValue($licence->getId());
         $this->addElement($element);
     }
     $this->setLegend('admin_document_section_licences');
 }
Пример #11
0
 /**
  * Erzeugt die Formularelemente.
  */
 public function init()
 {
     parent::init();
     $this->setDecorators(array('FormElements', 'Fieldset', array(array('divWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'subform')), 'Form'));
     $this->addElement('hidden', self::ELEMENT_PERSON_ID, array('size' => '40'));
     $this->addElement('text', self::ELEMENT_ACADEMIC_TITLE, array('label' => 'AcademicTitle'));
     $this->addElement('text', self::ELEMENT_LAST_NAME, array('label' => 'LastName', 'required' => true, 'size' => 50));
     $this->addElement('text', self::ELEMENT_FIRST_NAME, array('label' => 'FirstName', 'size' => 50));
     $this->addElement('Email', self::ELEMENT_EMAIL, array('label' => 'Email'));
     $this->addElement('text', self::ELEMENT_PLACE_OF_BIRTH, array('label' => 'PlaceOfBirth', 'size' => 40));
     $this->addElement('date', self::ELEMENT_DATE_OF_BIRTH, array('label' => 'DateOfBirth'));
     $this->addElement('text', self::ELEMENT_IDENTIFIER_GND, array('label' => 'IdentifierGnd', 'size' => 40));
     $this->addElement('text', self::ELEMENT_IDENTIFIER_ORCID, array('label' => 'IdentifierOrcid', 'size' => 40));
     $this->addElement('text', self::ELEMENT_IDENTIFIER_MISC, array('label' => 'IdentifierMisc', 'size' => 40));
     $this->getElement(self::ELEMENT_IDENTIFIER_GND)->addValidator(new Application_Form_Validate_Gnd());
     $this->getElement(self::ELEMENT_IDENTIFIER_ORCID)->addValidator(new Application_Form_Validate_Orcid());
     $this->addDisplayGroup($this->getElements(), 'fields', array('decorators' => array('FormElements', array(array('fieldsWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'fields-wrapper')))));
     $this->addElement('submit', self::ELEMENT_SAVE, array('decorators' => array('ViewHelper', array(array('liWrapper' => 'HtmlTag'), array('tag' => 'li', 'class' => 'save-element')))));
     $this->addElement('submit', self::ELEMENT_CANCEL, array('decorators' => array('ViewHelper', array(array('liWrapper' => 'HtmlTag'), array('tag' => 'li', 'class' => 'cancel-element')))));
     $this->addDisplayGroup(array(self::ELEMENT_SAVE, self::ELEMENT_CANCEL), 'actions', array('order' => 100, 'decorators' => array('FormElements', array(array('ulWrapper' => 'HtmlTag'), array('tag' => 'ul', 'class' => 'form-action')), array(array('divWrapper' => 'HtmlTag'), array('id' => 'form-action')))));
 }
Пример #12
0
 /**
  * Initialisiert das Formular.
  * 
  * Setzt den ViewScript Dekorator für die Ausgabe der Dokumentinformationen.
  */
 public function init()
 {
     $this->setDisableLoadDefaultDecorators(true);
     parent::init();
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'infobox.phtml'))));
 }
Пример #13
0
 /**
  * Konstruiert das Metadaten-Formular aus verschiedenen Unterformularen und den Aktion Buttons.
  */
 public function init()
 {
     parent::init();
     $this->setDecorators(array('FormElements', array(array('wrapperDivClose' => 'HtmlTag'), array('tag' => 'div', 'closeOnly' => 'true', 'placement' => 'append'))));
     $this->addSubForm(new Admin_Form_ActionBox($this), 'ActionBox');
     $subform = new Admin_Form_InfoBox();
     $subform->addDecorator(array('wrapperDivOpen' => 'HtmlTag'), array('tag' => 'div', 'placement' => 'prepend', 'class' => 'wrapper', 'openOnly' => 'true'));
     $this->addSubForm($subform, 'InfoBox');
     $this->addSubForm(new Admin_Form_Document_General(), 'General');
     $this->addSubForm(new Admin_Form_Document_Persons(), 'Persons');
     // Bibliographische Beschreibung
     $this->addSubForm(new Admin_Form_Document_Titles(), 'Titles');
     $this->addSubForm(new Admin_Form_Document_Bibliographic(), 'Bibliographic');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Series', 'Series', new Form_Validate_MultiSubForm_RepeatedValues('SeriesId', 'admin_document_error_repeated_series'), array('columns' => array(array(), array('label' => 'Opus_Model_Dependent_Link_DocumentSeries_Number'), array('label' => 'Opus_Model_Dependent_Link_DocumentSeries_SortOrder')))), 'Series');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Enrichment', 'Enrichment', null, array('columns' => array(array('label' => 'KeyName'), array('label' => 'Value')))), 'Enrichments');
     $this->addSubForm(new Admin_Form_Document_Collections(), 'Collections');
     // Inhaltliche Erschließung
     $subform = new Admin_Form_Document_Section();
     $subform->setLegend('admin_document_section_content');
     $subform->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Abstract', 'TitleAbstract', new Form_Validate_MultiSubForm_RepeatedValues('Language', 'admin_document_error_MoreThanOneTitleInLanguage')), 'Abstracts');
     $subform->addSubForm(new Admin_Form_Document_Subjects(), 'Subjects');
     $this->addSubForm($subform, 'Content');
     // Weiteres Allgemeines
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Identifier', 'Identifier', new Form_Validate_MultiSubForm_RepeatedValues('Value', 'admin_document_error_repeated_identifier', 'Type'), array('columns' => array(array('label' => 'Opus_Identifier_Type'), array('label' => 'Text')))), 'Identifiers');
     $this->addSubForm(new Admin_Form_Document_Licences(), 'Licences');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Patent', 'Patent'), 'Patents');
     $this->addSubForm(new Admin_Form_Document_MultiSubForm('Admin_Form_Document_Note', 'Note'), 'Notes');
     $this->addSubForm(new Admin_Form_Document_Actions(), 'Actions');
 }
Пример #14
0
 public function init()
 {
     parent::init();
     $this->setDecorators(array('FormElements'));
 }
Пример #15
0
 /**
  * Erzeugt Buttons für sämtliche Rollen und kümmert sich um Dekoratoren.
  */
 public function init()
 {
     parent::init();
     $this->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul', 'class' => 'links'))));
     $this->createButtons();
 }
Пример #16
0
 /**
  * Initialisiert Formular und setzt Dekoratoren.
  */
 public function init()
 {
     parent::init();
     $this->setDecorators(array(array('ViewScript', array('viewScript' => 'filerow.phtml'))));
 }
Пример #17
0
 /**
  * Erzeugt die Formularelemente.
  */
 public function init()
 {
     parent::init();
     $this->initButton();
     $this->setLegend('admin_document_section_' . strtolower($this->_fieldName));
     $this->getElement(self::ELEMENT_ADD)->setDecorators(array())->setDisableLoadDefaultDecorators(true);
     if (!is_null($this->getColumns())) {
         $this->_renderAsTableEnabled = true;
         $this->setDecorators(array('FormElements', 'TableHeader', 'TableWrapper', array(array('fieldsWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'fields-wrapper')), array('FieldsetWithButtons', array('legendButtons' => self::ELEMENT_ADD)), array(array('divWrapper' => 'HtmlTag'), array('tag' => 'div', 'class' => 'subform'))));
     } else {
         $this->getDecorator('FieldsetWithButtons')->setLegendButtons(self::ELEMENT_ADD);
     }
 }