/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { // Construct the select menu data $cats = new CategoriesCoins(); $cat_options = $cats->getPeriodMed(); $denominations = new Denominations(); $denomination_options = $denominations->getOptionsMedieval(); $rulers = new Rulers(); $ro = $rulers->getMedievalRulers(); $mints = new Mints(); $mo = $mints->getMedievalMints(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new WearTypes(); $wear_options = $wears->getWears(); parent::__construct($options); $this->setName('earlymedievalcoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addValidator('Digits')->addFilters(array('StripTags', 'StringTrim')); $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' => '')); $categoryID = new Zend_Form_Element_Select('categoryID'); $categoryID->setLabel('Category of coin: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options))); $ruler = new Zend_Form_Element_Select('ruler_id'); $ruler->setLabel('Ruler: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a ruler', 'Available rulers' => $ro))->addValidator('InArray', false, array(array_keys($ro))); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setOptions(array('separator' => ''))->addFilters(array('StripTags', 'StringTrim')); $mint_id = new Zend_Form_Element_Select('mint_id'); $mint_id->setLabel('Issuing mint: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a mint', 'Available mints' => $mo))->addValidator('InArray', false, array(array_keys($mo))); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(true)->setValue(1)->addMultiOptions(array(null => 'Choose coin status', 'Available statuses' => $status_options))->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($status_options)))->addValidator('Digits'); $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'))->setOptions(array('separator' => '')); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose degree of wear', 'Available options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options)))->addValidator('Digits'); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark'); $rev_mm->setLabel('Reverse mint mark: ')->addValidators(array('NotEmpty'))->setAttribs(array('rows' => 5, 'cols' => 40, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $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', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addMultiOptions(array(null => 'Choose die axis', 'Available options' => $die_options))->addValidator('InArray', false, array(array_keys($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' => '')); $type = new Zend_Form_Element_Select('typeID'); $type->setLabel('Coin type: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($ruler, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $type, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $rev_mm, $submit, $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(); }
public function __construct($options = null) { // Construct the select menu data $cats = new CategoriesCoins(); $cat_options = $cats->getPeriodMed(); $denominations = new Denominations(); $denomination_options = $denominations->getOptionsMedieval(); $rulers = new Rulers(); $ro = $rulers->getMedievalRulers(); $mints = new Mints(); $mo = $mints->getMedievalMints(); $statuses = new Statuses(); $status_options = $statuses->getCoinStatus(); $dies = new Dieaxes(); $die_options = $dies->getAxes(); $wears = new Weartypes(); $wear_options = $wears->getWears(); 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: ')->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addValidator('Digits')->addFilters(array('StripTags', 'StringTrim'))->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); $categoryID = new Zend_Form_Element_Select('categoryID'); $categoryID->setLabel('Category of coin: ')->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose category' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->setDecorators($decorators); $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler: ')->setDecorators($decorators)->addValidators(array('NotEmpty', 'Digits'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose a ruler' => $ro))->addValidator('InArray', false, array(array_keys($ro))); $ruler_qualifier = new Zend_Form_Element_Radio('ruler_qualifier'); $ruler_qualifier->setLabel('Issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setOptions(array('separator' => ''))->addFilters(array('StripTags', 'StringTrim'))->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(true)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose a mint' => $mo))->addValidator('InArray', false, array(array_keys($mo))); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setRegisterInArrayValidator(true)->setValue(1)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_options))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($status_options)))->addValidator('Digits'); $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'))->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(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($wear_options)))->addValidator('Digits'); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setDecorators($decorators)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->setDecorators($decorators)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph'))->setAttrib('rows', 3)->setAttrib('cols', 80)->setAttrib('class', 'expanding'); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph'))->setAttrib('class', 'expanding'); $rev_mm = new Zend_Form_Element_Textarea('reverse_mintmark'); $rev_mm->setLabel('Reverse mintmark: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 3)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph'))->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', 'StringTrim', 'BasicHtml', 'WordChars', 'EmptyParagraph'))->setAttrib('class', 'expanding'); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $die_options))->addValidator('InArray', false, array(array_keys($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' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $type = new Zend_Form_Element_Select('typeID'); $type->setLabel('Coin type: ')->setRegisterInArrayValidator(false)->setRequired(false)->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'); $this->addElements(array($ruler, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $type, $status, $categoryID, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $rev_mm, $submit, $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'); }
public function __construct($options = null) { $primaries = new Materials(); $primary_options = $primaries->getPrimaries(); //Get data to form select menu for periods //Get Rally data $rallies = new Rallies(); $rally_options = $rallies->getRallies(); //Get Hoard data $hoards = new Hoards(); $hoard_options = $hoards->getHoards(); $counties = new Counties(); $county_options = $counties->getCountyName2(); $rulers = new Rulers(); $ruler_options = $rulers->getMedievalRulers(); $denominations = new Denominations(); $denomination_options = $denominations->getOptionsMedieval(); $mints = new Mints(); $mint_options = $mints->getMedievalMints(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $cats = new CategoriesCoins(); $cat_options = $cats->getPeriodMed(); $regions = new Regions(); $region_options = $regions->getRegionName(); $institutions = new Institutions(); $inst_options = $institutions->getInsts(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); 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('medNumismaticsSearch'); $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!')->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))->addValidator('InArray', false, array(array_keys($rally_options)))->setDecorators($decorators); $hoard = new Zend_Form_Element_Checkbox('hoard'); $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->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))->addValidator('InArray', false, array(array_keys($hoard_options)))->setDecorators($decorators); $county = new Zend_Form_Element_Select('county'); $county->setLabel('County: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators); $district = new Zend_Form_Element_Select('district'); $district->setLabel('District: ')->addMultiOptions(array(NULL => 'Choose district after county'))->setRegisterInArrayValidator(false)->setDecorators($decorators); $parish = new Zend_Form_Element_Select('parish'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addMultiOptions(array(NULL => 'Choose parish after county'))->setDecorators($decorators); $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: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators); ### ##Numismatic data ### // Denomination $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setDecorators($decorators); $cat = new Zend_Form_Element_Select('category'); $cat->setLabel('Category: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->setDecorators($decorators); $type = new Zend_Form_Element_Select('typeID'); $type->setLabel('Coin type: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators); //Primary ruler $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a ruler', 'Available issuers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->setDecorators($decorators); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => 'Choose a mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options)))->setDecorators($decorators); //Obverse inscription $obverseinsc = new Zend_Form_Element_Text('obinsc'); $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('obdesc'); $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('revinsc'); $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('revdesc'); $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: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose an axis', 'Available measurements' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options)))->setDecorators($decorators); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('COIN')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addValidator('Alpha'); $broadperiod = new Zend_Form_Element_Hidden('broadperiod'); $broadperiod->setValue('MEDIEVAL')->setAttrib('class', 'none')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha'); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setLabel('Submit')->setAttrib('class', 'large'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $this->addElement($hash); $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, $hash, $institution)); $this->addDisplayGroup(array('category', 'ruler', 'typeID', 'denomination', 'mint', 'moneyer', 'axis', 'obinsc', 'obdesc', 'revinsc', 'revdesc'), '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->setLegend('Object details:'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $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->setLegend('Perform an advanced search on our database: '); $this->addDisplayGroup(array('submit'), 'submit'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $rallies = new Rallies(); $rally_options = $rallies->getRallies(); $counties = new OsCounties(); $county_options = $counties->getCountiesID(); $rulers = new Rulers(); $ruler_options = $rulers->getMedievalRulers(); $denominations = new Denominations(); $denomination_options = $denominations->getOptionsMedieval(); $mints = new Mints(); $mint_options = $mints->getMedievalMints(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $cats = new CategoriesCoins(); $cat_options = $cats->getPeriodMed(); $types = new MedievalTypes(); $type_options = $types->getMedievalTypesForm(29); $regions = new OsRegions(); $region_options = $regions->getRegionsID(); $institutions = new Institutions(); $inst_options = $institutions->getInsts(); parent::__construct($options); $this->setName('medNumismaticsSearch'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid number!')->setAttrib('class', 'span6'); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Object description contains: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term'); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow'); 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: ')->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(null); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options))->addValidator('InArray', false, array(array_keys($rally_options))); $county = new Zend_Form_Element_Select('countyID'); $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->addValidator('InArray', false, array(array_keys($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); $parish = new Zend_Form_Element_Select('parishID'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose parish after county')); $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->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')); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addValidators(array('NotEmpty', 'ValidGridRef')); ### ##Numismatic data ### // Denomination $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a denomination', 'Available denominations' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options))); $cat = new Zend_Form_Element_Select('category'); $cat->setLabel('Category: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options))); $type = new Zend_Form_Element_Select('type'); $type->setLabel('Coin type: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addValidator('Int')->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: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a ruler', 'Available issuers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options))); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(null => 'Choose a mint', 'Available mints' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options))); //Obverse inscription $obverseinsc = new Zend_Form_Element_Text('obverseLegend'); $obverseinsc->setLabel('Obverse inscription contains: ')->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: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term'); //reverse description $reversedesc = new Zend_Form_Element_Text('reverseDescription'); $reversedesc->setLabel('Reverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term'); //Die axis $axis = new Zend_Form_Element_Select('axis'); $axis->setLabel('Die axis measurement: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose an axis', 'Available measurements' => $axis_options))->addValidator('InArray', false, array(array_keys($axis_options))); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('COIN')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'none')->addValidator('Alpha'); $broadperiod = new Zend_Form_Element_Hidden('broadperiod'); $broadperiod->setValue('MEDIEVAL')->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha'); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Submit'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose an institution', 'Available institutions' => $inst_options)); $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, $hash, $institution)); $this->addDisplayGroup(array('category', 'ruler', 'type', 'denomination', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics')->removeDecorator('HtmlTag'); $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->setLegend('Perform an advanced search on our database: '); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }