コード例 #1
0
 public function init()
 {
     parent::init();
     $options = array('Name' => 'Name', 'Number' => 'Number', 'NameNumber' => 'Name,Number', 'NumberName' => 'Number,Name');
     foreach ($options as $label => $value) {
         $this->addMultiOption($value, $label);
     }
 }
コード例 #2
0
 public function init()
 {
     parent::init();
     $identifier = new Opus_Identifier();
     $types = $identifier->getField('Type')->getDefault();
     foreach ($types as $type) {
         $this->addMultiOption($type, 'Opus_Identifier_Type_Value_' . ucfirst($type));
     }
 }
コード例 #3
0
 public function getValue()
 {
     $value = parent::getValue();
     if ($value == 'Null') {
         return null;
     } else {
         return $value;
     }
 }
コード例 #4
0
 /**
  * Initialisiert Formularelement.
  */
 public function init()
 {
     parent::init();
     $this->setRequired(true);
     $options = $this->getSelectOptions();
     foreach ($options as $option) {
         $this->addMultiOption($option, 'Opus_Person_Role_Value_' . ucfirst($option));
     }
 }
コード例 #5
0
ファイル: Language.php プロジェクト: belapp/opus4-application
 public function init()
 {
     parent::init();
     $this->setLabel($this->getView()->translate($this->getName()));
     $this->setDisableTranslator(true);
     // languages are already translated
     foreach ($this->getLanguageList() as $index => $language) {
         $this->addMultiOption($index, $language);
     }
 }
コード例 #6
0
ファイル: Position.php プロジェクト: belapp/opus4-application
 public function init()
 {
     parent::init();
     $allCollectionRoles = Opus_CollectionRole::fetchAll();
     $translator = Zend_Registry::get('Zend_Translate');
     foreach ($allCollectionRoles as $collectionRole) {
         $position = $collectionRole->getPosition();
         $this->addMultiOption($position, $position . ' - ' . $translator->translate('default_collection_role_' . $collectionRole->getDisplayName()));
     }
     $this->addMultiOption(count($allCollectionRoles) + 1, 'admin_collectionroles_last_position');
 }
コード例 #7
0
 public function init()
 {
     parent::init();
     $this->setLabel($this->getView()->translate($this->getName()));
     $this->setRequired(true);
     $docTypeHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('DocumentTypes');
     $options = $docTypeHelper->getDocumentTypes();
     foreach ($options as $index => $type) {
         $this->addMultiOption($index, $index);
     }
     $this->setDisableTranslator(true);
     // document types already translated after addMultiOption
 }
コード例 #8
0
 public function init()
 {
     parent::init();
     $this->setRequired(true);
     $this->setDisableTranslator(true);
     // publishing institutions are not translated
     $validator = new Zend_Validate_Int();
     $validator->setMessage('validation_error_int');
     $this->addValidator($validator);
     $options = Opus_DnbInstitute::getPublishers();
     foreach ($options as $option) {
         $this->addMultiOption($option->getId(), $option->getDisplayName());
     }
 }
コード例 #9
0
ファイル: Series.php プロジェクト: belapp/opus4-application
 public function init()
 {
     parent::init();
     $this->setRequired(true);
     $this->setDisableTranslator(true);
     // Schriftenreihen werden nicht übersetzt
     $validator = new Zend_Validate_Int();
     $validator->setMessage('validation_error_int');
     $this->addValidator($validator);
     $options = Opus_Series::getAll();
     foreach ($options as $option) {
         $this->addMultiOption($option->getId(), $option->getTitle());
     }
 }
コード例 #10
0
 public function init()
 {
     parent::init();
     $this->setLabel('advanced_search_form_hits_per_page');
     $options = array('10', '20', '50', '100');
     $defaultRows = Opus_Search_Query::getDefaultRows();
     if (!in_array($defaultRows, $options)) {
         $options[] = $defaultRows;
         sort($options);
     }
     foreach ($options as $option) {
         $this->addMultiOption($option, $option);
     }
     $this->setValue($defaultRows);
     $this->setDecorators(array('ViewHelper', 'Errors', 'Description', 'Label'));
 }
コード例 #11
0
 public function init()
 {
     parent::init();
     $options = Opus_EnrichmentKey::getAll();
     $values = array();
     $translator = $this->getTranslator();
     $this->setDisableTranslator(true);
     // keys are translated below if possible
     foreach ($options as $index => $option) {
         $keyName = $option->getName();
         $values[] = $keyName;
         $translationKey = 'Enrichment' . $keyName;
         if (!is_null($translator) && $translator->isTranslated($translationKey)) {
             $this->addMultiOption($keyName, $translator->translate($translationKey));
         } else {
             $this->addMultiOption($keyName, $keyName);
         }
     }
     $validator = new Zend_Validate_InArray($values);
     $validator->setMessage('validation_error_unknown_enrichmentkey');
     $this->addValidator($validator);
 }
コード例 #12
0
 public function init()
 {
     parent::init();
     $options = array(Application_Util_QueryBuilder::SEARCH_MODIFIER_CONTAINS_ALL => 'advanced_search_form_modifier_all', Application_Util_QueryBuilder::SEARCH_MODIFIER_CONTAINS_ANY => 'advanced_search_form_modifier_one', Application_Util_QueryBuilder::SEARCH_MODIFIER_CONTAINS_NONE => 'advanced_search_form_modifier_none');
     $this->addMultiOptions($options);
 }