コード例 #1
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsEarlyMedieval();
     $statuses = new Statuses();
     $status_options = $statuses->getCoinStatus();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new WearTypes();
     $wear_options = $wears->getWears();
     $rulers = new Rulers();
     $ro = $rulers->getEarlyMedRulers();
     $mints = new Mints();
     $mo = $mints->getEarlyMedievalMints();
     parent::__construct($options);
     $this->setName('earlymedievalcoin');
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(null => 'Choose denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int');
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Category of coin: ')->addValidators(array('NotEmpty'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose category', 'Available categories' => $cat_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $ruler_id = new Zend_Form_Element_Select('ruler_id');
     $ruler_id->setLabel('Ruler: ')->addValidator('InArray', false, array(array_keys($ro)))->addMultiOptions(array(null => 'Choose a ruler', 'Available rulers' => $ro))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     $mint_id = new Zend_Form_Element_Select('mint_id');
     $mint_id->setLabel('Issuing mint: ')->addValidator('InArray', false, array(array_keys($mo)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose a mint', 'Available mints' => $mo));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->setValue(1)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose coin status', 'Available status' => $status_options));
     $status_qualifier = new Zend_Form_Element_Radio('status_qualifier');
     $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''));
     $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
     $degree_of_wear->setLabel('Degree of wear: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a degree of wear', 'Available options' => $wear_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->addFilters(array('StripTags', 'StringTrim'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'));
     $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark');
     $rev_mm->setLabel('Reverse mint mark: ')->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'));
     $initial = new Zend_Form_Element_Textarea('initial_mark');
     $initial->setLabel('Initial mark: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'));
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose die axis', 'Available options' => $die_options));
     $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty');
     $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int');
     $typeID = new Zend_Form_Element_Select('typeID');
     $typeID->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $typeID, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $submit, $rev_mm, $initial));
     $this->addDisplayGroup(array('categoryID', 'ruler_id', 'typeID', 'ruler_qualifier', 'denomination', 'denomination_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'initial_mark', 'die_axis_measurement', 'die_axis_certainty'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
コード例 #2
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $rulers = new Rulers();
     $ruler_options = $rulers->getEarlyMedRulers();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsEarlyMedieval();
     $mints = new Mints();
     $mint_options = $mints->getEarlyMedievalMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $types = new MedievalTypes();
     $type_options = $types->getMedievalTypesForm(47);
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $regions = new OsRegions();
     $region_options = $regions->getRegionsID();
     parent::__construct($options);
     $this->setName('earlymedsearch');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!');
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term');
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addValidator('Int');
     if (in_array($this->_role, $this->_higherlevel)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published')));
     }
     if (in_array($this->_role, $this->_restricted)) {
         $workflow->addMultiOptions(array(null => 'Available Workflow stages', 'Choose Worklow stage' => array('4' => 'Awaiting validation', '3' => 'Published')));
     }
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addValidator('Int')->addFilters(array('StringTrim', 'StripTags'))->setUncheckedValue(null);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose a rally', 'Available rallies' => $rally_options));
     $county = new Zend_Form_Element_Select('countyID');
     $county->setLabel('County: ')->addValidators(array('NotEmpty'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options));
     $district = new Zend_Form_Element_Select('districtID');
     $district->setLabel('District: ')->addMultiOptions(array(null => 'Choose district after county'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addFilters(array('StringTrim', 'StripTags'))->setDisableTranslator(true);
     $parish = new Zend_Form_Element_Select('parishID');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose parish after county'))->setDisableTranslator(true);
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->addFilters(array('StringTrim', 'StripTags'));
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty'))->addFilters(array('StringTrim', 'StripTags'));
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options));
     $cat = new Zend_Form_Element_Select('category');
     $cat->setLabel('Category: ')->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose an Early Medieval category', 'Available categories' => $cat_options));
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Coin type: ')->setRequired(false)->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose type after choosing ruler', 'Available types' => $type_options))->addValidator('InArray', false, array(array_keys($type_options)));
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose primary ruler', 'Available options' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)));
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose issuing mint', 'Available mints' => $mint_options));
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term');
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term');
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term');
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term');
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose a die axis measurement', 'Available options' => $axis_options));
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin')->addFilter('StringToUpper');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Early Medieval')->addFilter('StringToUpper');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Alpha', true)->addMultiOptions(array(null => 'Choose an institution', 'Available institutions' => $inst_options));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($old_findID, $type, $description, $workflow, $rally, $rallyID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $cat, $submit, $institution, $hash));
     $this->addDisplayGroup(array('category', 'ruler', 'type', 'denomination', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'workflow'), 'details');
     $this->details->setLegend('Object details: ');
     $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'gridref', 'fourFigure', 'institution'), 'spatial');
     $this->spatial->setLegend('Spatial details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
コード例 #3
0
 public function __construct($options = null)
 {
     // Construct the select menu data
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsEarlyMedieval();
     $statuses = new Statuses();
     $status_options = $statuses->getCoinStatus();
     $dies = new Dieaxes();
     $die_options = $dies->getAxes();
     $wears = new Weartypes();
     $wear_options = $wears->getWears();
     $rulers = new Rulers();
     $ro = $rulers->getEarlyMedRulers();
     $mints = new Mints();
     $mo = $mints->getEarlyMedievalMints();
     parent::__construct($options);
     $this->setName('earlymedievalcoin');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->setDecorators($decorators);
     $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier');
     $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators)->addValidator('Int');
     $categoryID = new Zend_Form_Element_Select('categoryID');
     $categoryID->setLabel('Category of coin: ')->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose category' => $cat_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $ruler_id = new Zend_Form_Element_Select('ruler');
     $ruler_id->setLabel('Ruler: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Please choose a ruler' => $ro))->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'));
     $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier');
     $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $mint_id = new Zend_Form_Element_Select('mint_id');
     $mint_id->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(NULL => NULL, 'Please choose a mint' => $mo));
     $status = new Zend_Form_Element_Select('status');
     $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_options))->setDecorators($decorators);
     $status_qualifier = new Zend_Form_Element_Radio('status_qualifier');
     $status_qualifier->setLabel('Status qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear');
     $degree_of_wear->setLabel('Degree of wear: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription');
     $obverse_inscription->setLabel('Obverse inscription: ')->setDecorators($decorators)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'));
     $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription');
     $reverse_inscription->setLabel('Reverse inscription: ')->setDecorators($decorators)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'));
     $obverse_description = new Zend_Form_Element_Textarea('obverse_description');
     $obverse_description->setLabel('Obverse description: ')->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding')->addFilters(array('StripTags', 'StringTrim'));
     $reverse_description = new Zend_Form_Element_Textarea('reverse_description');
     $reverse_description->setLabel('Reverse description: ')->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding');
     $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark');
     $rev_mm->setLabel('Reverse mintmark: ')->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding');
     $initial = new Zend_Form_Element_Textarea('initial_mark');
     $initial->setLabel('Initial mark: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'EmptyParagraph', 'StringTrim'))->setAttrib('class', 'expanding');
     $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement');
     $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $die_options))->setDecorators($decorators);
     $die_axis_certainty = new Zend_Form_Element_Radio('die_axis_certainty');
     $die_axis_certainty->setLabel('Die axis certainty: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->addValidator('Int')->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators);
     $typeID = new Zend_Form_Element_Select('typeID');
     $typeID->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->setRequired(false)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $typeID, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $submit, $rev_mm, $initial));
     $this->addDisplayGroup(array('categoryID', 'ruler', 'typeID', 'ruler_qualifier', 'denomination', 'denomination_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'reverse_mintmark', 'initial_mark', 'die_axis_measurement', 'die_axis_certainty'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit');
     $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
     if ($action == 'editcoin') {
         $rulers = new Rulers();
         $ruler_options = $rulers->getEarlyMedRulers();
         $ruler_id->addMultiOptions(array(NULL => NULL, 'Choose ruler' => $ruler_options));
         $mints = new Mints();
         $mint_options = $mints->getEarlyMedievalMints();
         $mint_id->addMultiOptions(array(NULL => NULL, 'Choose Medieval mint' => $mint_options));
     }
 }
コード例 #4
0
 public function __construct($options = null)
 {
     $primaries = new Materials();
     $primary_options = $primaries->getPrimaries();
     $institutions = new Institutions();
     $inst_options = $institutions->getInsts();
     $rallies = new Rallies();
     $rally_options = $rallies->getRallies();
     $hoards = new Hoards();
     $hoard_options = $hoards->getHoards();
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $rulers = new Rulers();
     $ruler_options = $rulers->getEarlyMedRulers();
     $denominations = new Denominations();
     $denomination_options = $denominations->getOptionsEarlyMedieval();
     $mints = new Mints();
     $mint_options = $mints->getEarlyMedievalMints();
     $axis = new Dieaxes();
     $axis_options = $axis->getAxes();
     $reece = new Reeces();
     $reece_options = $reece->getReeces();
     $cats = new CategoriesCoins();
     $cat_options = $cats->getPeriodEarlyMed();
     $regions = new Regions();
     $region_options = $regions->getRegionName();
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('earlymedsearch');
     $old_findID = new Zend_Form_Element_Text('old_findID');
     $old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('Please enter a valid number!')->setDecorators($decorators);
     $description = new Zend_Form_Element_Text('description');
     $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     $workflow = new Zend_Form_Element_Select('workflow');
     $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators);
     //Rally details
     $rally = new Zend_Form_Element_Checkbox('rally');
     $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $rallyID = new Zend_Form_Element_Select('rallyID');
     $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->setDecorators($decorators);
     $hoard = new Zend_Form_Element_Checkbox('hoard');
     $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators);
     $hoardID = new Zend_Form_Element_Select('hID');
     $hoardID->setLabel('Part of this hoard: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $hoard_options))->setDecorators($decorators);
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->addFilters(array('StripTags', 'StringTrim'))->setRegisterInArrayValidator(false)->setDecorators($decorators)->disabled = true;
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators)->disabled = true;
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Choose region' => $region_options))->setDecorators($decorators);
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->setDecorators($decorators);
     $fourFigure = new Zend_Form_Element_Text('fourFigure');
     $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->setDecorators($decorators);
     $denomination = new Zend_Form_Element_Select('denomination');
     $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose denomination type', 'Available denominations' => $denomination_options))->setDecorators($decorators);
     $cat = new Zend_Form_Element_Select('category');
     $cat->setLabel('Category: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose an Early Medieval category', 'Available categories' => $cat_options))->setDecorators($decorators);
     $type = new Zend_Form_Element_Select('typeID');
     $type->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     //Primary ruler
     $ruler = new Zend_Form_Element_Select('ruler');
     $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose primary ruler', 'Available options' => $ruler_options))->setDecorators($decorators);
     //Mint
     $mint = new Zend_Form_Element_Select('mint');
     $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->setDecorators($decorators);
     //Obverse inscription
     $obverseinsc = new Zend_Form_Element_Text('obverseLegend');
     $obverseinsc->setLabel('Obverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Obverse description
     $obversedesc = new Zend_Form_Element_Text('obverseDescription');
     $obversedesc->setLabel('Obverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse inscription
     $reverseinsc = new Zend_Form_Element_Text('reverseLegend');
     $reverseinsc->setLabel('Reverse inscription contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //reverse description
     $reversedesc = new Zend_Form_Element_Text('reverseDescription');
     $reversedesc->setLabel('Reverse description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term')->setDecorators($decorators);
     //Die axis
     $axis = new Zend_Form_Element_Select('axis');
     $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a die axis measurement', 'Available options' => $axis_options))->setDecorators($decorators);
     $objecttype = new Zend_Form_Element_Hidden('objecttype');
     $objecttype->setValue('coin')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $broadperiod = new Zend_Form_Element_Hidden('broadperiod');
     $broadperiod->setValue('Early Medieval')->setAttrib('class', 'none')->removeDecorator('label')->addFilter('StringToUpper')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Submit');
     $institution = new Zend_Form_Element_Select('institution');
     $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose an institution', 'Available institutions' => $inst_options))->setDecorators($decorators);
     $this->addElements(array($old_findID, $type, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $cat, $submit, $institution));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addDisplayGroup(array('category', 'ruler', 'typeID', 'denomination', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics')->removeDecorator('HtmlTag');
     $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->numismatics->removeDecorator('DtDdWrapper');
     $this->numismatics->setLegend('Numismatic details: ');
     $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Object details: ');
     $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial')->removeDecorator('HtmlTag');
     $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->spatial->removeDecorator('DtDdWrapper');
     $this->spatial->setLegend('Spatial details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->addDecorator('FormElements')->addDecorator('Form')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'));
 }