public function __construct($options = null) { // Construct the select menu data $denominations = new Denominations(); $denomination_options = $denominations->getOptionsIronAge(); $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->getIronAgeRulers(); $mints = new Mints(); $mint_options = $mints->getIronAgeMints(); $tribes = new Tribes(); $to = $tribes->getTribes(); $atypes = new AllenTypes(); $atypelist = $atypes->getATypes(); $vatypes = new VanArsdellTypes(); $vatypelist = $vatypes->getVATypesDD(); $macktypes = new MackTypes(); $macktypelist = $macktypes->getMackTypesDD(); parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator'); $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element'); $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'))); $this->setName('ironagecoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addValidator('Int')->setDecorators($decorators); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $geographyID = new Zend_Form_Element_Select('geographyID'); $geographyID->setLabel('Geographic area: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $geography_qualifier = new Zend_Form_Element_Radio('geography_qualifier'); $geography_qualifier->setLabel('Geographic qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $ruler_id = new Zend_Form_Element_Select('ruler'); $ruler_id->setLabel('Ruler: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => 'Choose primary 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'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $ruler2_id = new Zend_Form_Element_Select('ruler2_id'); $ruler2_id->setLabel('Secondary ruler: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose issuing secondary ruler' => $ro))->addValidator('InArray', false, array(array_keys($denomination_options))); $ruler2_qualifier = new Zend_Form_Element_Radio('ruler2_qualifier'); $ruler2_qualifier->setLabel('Secondary issuer qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->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)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => NULL, 'Choose issuing mint' => $mint_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($mint_options))); $tribe = new Zend_Form_Element_Select('tribe'); $tribe->setLabel('Tribe: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose tribe' => $to))->addValidator('InArray', false, array(array_keys($to))); $tribe_qualifier = new Zend_Form_Element_Radio('tribe_qualifier'); $tribe_qualifier->setLabel('Tribe qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setValue(1)->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $status_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($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('Digits')->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: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($wear_options))); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->setDecorators($decorators); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'))->setAttrib('class', 'expanding'); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'))->setAttrib('class', 'expanding'); $die_axis_measurement = new Zend_Form_Element_Select('die_axis_measurement'); $die_axis_measurement->setLabel('Die axis measurement: ')->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $die_options))->setDecorators($decorators)->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'))->addValidator('Digits')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $mack_type = new Zend_Form_Element_Select('mack_type'); $mack_type->setLabel('Mack Type: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addMultiOptions(array(NULL => 'Choose a Mack type', 'Valid types' => $macktypelist))->setDecorators($decorators)->setDecorators($decorators)->addValidator('InArray', false, array(array_keys($macktypelist))); $bmc_type = new Zend_Form_Element_Text('bmc_type'); $bmc_type->setLabel('British Museum catalogue number: ')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $allen_type = new Zend_Form_Element_Select('allen_type'); $allen_type->setLabel('Allen Type: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addMultiOptions(array(NULL => 'Choose an Allen type', 'Valid types' => $atypelist))->setDecorators($decorators); $va_type = new Zend_Form_Element_Select('va_type'); $va_type->setLabel('Van Arsdell Number: ')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addMultiOptions(array(NULL => 'Choose Van Arsdell type', 'Valid types' => $vatypelist))->setDecorators($decorators); $cciNumber = new Zend_Form_Element_Text('cciNumber'); $cciNumber->setLabel('Celtic Coin Index Number: ')->setAttrib('size', 12)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDescription('This is the coin\'s unique CCI number, not a comparison field!')->setDecorators($decorators); $rudd_type = new Zend_Form_Element_Text('rudd_type'); $rudd_type->setLabel('Ancient British Coinage number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $phase_date_1 = new Zend_Form_Element_Text('phase_date_1'); $phase_date_1->setLabel('Phase date 1: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $phase_date_2 = new Zend_Form_Element_Text('phase_date_2'); $phase_date_2->setLabel('Phase date 2: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $context = new Zend_Form_Element_Text('context'); $context->setLabel('Context of coins: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $depositionDate = new Zend_Form_Element_Text('depositionDate'); $depositionDate->setLabel('Date of deposition: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date'); $numChiab = new Zend_Form_Element_Text('numChiab'); $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $ruler2_id, $ruler2_qualifier, $geographyID, $geography_qualifier, $status, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $tribe, $tribe_qualifier, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $cciNumber, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'geographyID', 'geography_qualifier', 'tribe', 'tribe_qualifier', 'ruler', 'ruler_qualifier', 'ruler2_id', 'ruler2_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty', 'bmc_type', 'va_type', 'allen_type', 'rudd_type', 'mack_type', 'cciNumber', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), '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) { //Get data to form select menu for primary and secondary material $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(); $denominations = new Denominations(); $denom_options = $denominations->getOptionsIronAge(); $rulers = new Rulers(); $ruler_options = $rulers->getIronAgeRulers(); $mints = new Mints(); $mint_options = $mints->getIronAgeMints(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $geog = new Geography(); $geog_options = $geog->getIronAgeGeographyDD(); $regions = new Regions(); $region_options = $regions->getRegionName(); $tribes = new Tribes(); $tribe_options = $tribes->getTribes(); $institutions = new Institutions(); $inst_options = $institutions->getInsts(); parent::__construct($options); $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'))); $this->setName('Advanced'); $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'))->setDecorators($decorators); if (in_array($this->getRole(), $this->_higherlevel)) { $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('1' => 'Quarantine', '2' => 'On review', '4' => 'Awaiting validation', '3' => 'Published'))); } if (in_array($this->getRole(), $this->_restricted)) { $workflow->addMultiOptions(array(NULL => 'Choose a workflow stage', 'Available workflow stages' => array('4' => 'Awaiting validation', '3' => 'Published'))); } //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(NULL)->setDecorators($decorators); $geographyID = new Zend_Form_Element_Select('geographyID'); $geographyID->setLabel('Geographic area: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a geography', 'Available geographies' => $geog_options))->addValidator('inArray', false, array(array_keys($geog_options)))->addValidator('Int'); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a rally', 'Available rallies' => $rally_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($rally_options)))->addValidator('Int'); $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 => 'Choose a hoard', 'Available hoards' => $hoard_options))->setDecorators($decorators)->addValidator('inArray', false, array(array_keys($hoard_options)))->addValidator('Int'); $county = new Zend_Form_Element_Select('county'); $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Available counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators); $district = new Zend_Form_Element_Select('district'); $district->setLabel('District: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->setDecorators($decorators)->disabled = true; $parish = new Zend_Form_Element_Select('parish'); $parish->setLabel('Parish: ')->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: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose a region for a wide result', 'Available regions' => $region_options))->addValidator('Int'); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Grid reference: ')->setDecorators($decorators)->addValidator('ValidGridRef')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum'); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('ValidGridRef')->addValidator('Alnum'); ### ##Numismatic data ### // Denomination $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' => $denom_options))->addValidator('inArray', false, array(array_keys($denom_options)))->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 primary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($denom_options)))->setDecorators($decorators); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose issuing mint', 'Available mints' => $mint_options))->addValidator('inArray', false, array(array_keys($mint_options)))->setDecorators($decorators); //Secondary ruler $ruler2 = new Zend_Form_Element_Select('ruler2'); $ruler2->setLabel('Secondary ruler / issuer: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose secondary ruler', 'Available rulers' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_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: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose measurement', 'Available die axes' => $axis_options))->addValidator('inArray', false, array(array_keys($axis_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators); //Tribe $tribe = new Zend_Form_Element_Select('tribe'); $tribe->setLabel('Iron Age tribe: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a tribe', 'Available tribes' => $tribe_options))->addValidator('inArray', false, array(array_keys($tribe_options)))->addErrorMessage('That option is not a valid choice')->addValidator('Int')->setDecorators($decorators); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('COIN')->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $broadperiod = new Zend_Form_Element_Hidden('broadperiod'); $broadperiod->setValue('IRON AGE')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('class', 'none')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label'); $mack_type = new Zend_Form_Element_Text('mackType'); $mack_type->setLabel('Mack Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $bmc_type = new Zend_Form_Element_Text('bmc'); $bmc_type->setLabel('British Museum catalogue number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $allen_type = new Zend_Form_Element_Text('allenType'); $allen_type->setLabel('Allen Type: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $va_type = new Zend_Form_Element_Text('vaType'); $va_type->setLabel('Van Arsdell Number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $rudd_type = new Zend_Form_Element_Text('ruddType'); $rudd_type->setLabel('Ancient British Coinage number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $phase_date_1 = new Zend_Form_Element_Text('phase_date_1'); $phase_date_1->setLabel('Phase date 1: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $phase_date_2 = new Zend_Form_Element_Text('phase_date_2'); $phase_date_2->setLabel('Phase date 2: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $context = new Zend_Form_Element_Text('context'); $context->setLabel('Context of coins: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $depositionDate = new Zend_Form_Element_Text('depositionDate'); $depositionDate->setLabel('Date of deposition: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); $numChiab = new Zend_Form_Element_Text('numChiab'); $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true)); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->setLabel('Submit your search...'); $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->setRequired(false)->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options))->setDecorators($decorators); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); $this->addElement($hash); $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $hoard, $hoardID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $ruler2, $tribe, $objecttype, $broadperiod, $geographyID, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit, $institution)); $this->addDisplayGroup(array('denomination', 'geographyID', 'ruler', 'ruler2', 'tribe', 'mint', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription', 'bmc', 'vaType', 'allenType', 'ruddType', 'mackType', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), '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->submit->removeDecorator('DtDdWrapper'); $this->submit->removeDecorator('HtmlTag'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { // Construct the select menu data $denominations = new Denominations(); $denomination_options = $denominations->getOptionsIronAge(); $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->getIronAgeRulers(); $mints = new Mints(); $mint_options = $mints->getIronAgeMints(); $tribes = new Tribes(); $to = $tribes->getTribes(); $atypes = new AllenTypes(); $atypelist = $atypes->getATypes(); $vatypes = new VanArsdellTypes(); $vatypelist = $vatypes->getVATypesDD(); $macktypes = new MackTypes(); $macktypelist = $macktypes->getMackTypesDD(); $abc = new AbcNumbers(); $abclist = $abc->getTerms(); $regions = new Geography(); $ia_geog = $regions->getIronAgeGeographyDD(); parent::__construct($options); $this->setName('ironagecoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination', 'Available options' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->addValidator('Int'); $denomination_qualifier = new Zend_Form_Element_Radio('denomination_qualifier'); $denomination_qualifier->setLabel('Denomination qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => '')); $geographyID = new Zend_Form_Element_Select('geographyID'); $geographyID->setLabel('Geographic area: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose geography', 'Available options' => $ia_geog))->addValidator('InArray', false, array(array_keys($ia_geog)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $geography_qualifier = new Zend_Form_Element_Radio('geography_qualifier'); $geography_qualifier->setLabel('Geographic qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => '')); $ruler_id = new Zend_Form_Element_Select('ruler_id'); $ruler_id->setLabel('Ruler: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ro)); $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' => '')); $ruler2_id = new Zend_Form_Element_Select('ruler2_id'); $ruler2_id->setLabel('Secondary ruler: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose issuing secondary ruler', 'Available rulers' => $ro))->addValidator('InArray', false, array(array_keys($ro))); $ruler2_qualifier = new Zend_Form_Element_Radio('ruler2_qualifier'); $ruler2_qualifier->setLabel('Secondary 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: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addMultiOptions(array(null => 'Choose issuing mint', 'Available options' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options))); $tribe = new Zend_Form_Element_Select('tribe'); $tribe->setLabel('Tribe: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setRegisterInArrayValidator(false)->addMultiOptions(array(null => 'Choose tribe', 'Available options' => $to))->addValidator('InArray', false, array(array_keys($to))); $tribe_qualifier = new Zend_Form_Element_Radio('tribe_qualifier'); $tribe_qualifier->setLabel('Tribe qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => '')); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->setValue(1)->addMultiOptions(array(null => 'Choose coin status', 'Available options' => $status_options))->addValidator('InArray', false, array(array_keys($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('Digits')->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')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(null => 'Choose wear status', 'Available options' => $wear_options))->addValidator('InArray', false, array(array_keys($wear_options))); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6')); $reverse_inscription = new Zend_Form_Element_Text('reverse_inscription'); $reverse_inscription->setLabel('Reverse inscription: ')->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6')); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->setAttribs(array('rows' => 8, 'cols' => 80, 'class' => 'span6'))->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', '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')->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'))->addValidator('Int')->setOptions(array('separator' => '')); $mack_type = new Zend_Form_Element_Select('mack_type'); $mack_type->setLabel('Mack Type: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a Mack type', 'Valid types' => $macktypelist))->addValidator('InArray', false, array(array_keys($macktypelist))); $bmc_type = new Zend_Form_Element_Text('bmc_type'); $bmc_type->setLabel('British Museum catalogue number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $allen_type = new Zend_Form_Element_Select('allen_type'); $allen_type->setLabel('Allen Type: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose an Allen type', 'Valid types' => $atypelist))->addValidator('InArray', false, array(array_keys($atypelist))); $va_type = new Zend_Form_Element_Select('va_type'); $va_type->setLabel('Van Arsdell Number: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose Van Arsdell type', 'Valid types' => $vatypelist))->addValidator('InArray', false, array(array_keys($vatypelist))); $cciNumber = new Zend_Form_Element_Text('cciNumber'); $cciNumber->setLabel('Celtic Coin Index Number: ')->setAttrib('size', 12)->addFilters(array('StripTags', 'StringTrim'))->setDescription('This is the coin\'s unique CCI number, not a ' . 'comparison field. Numbers are issued by the CCI.'); $rudd_type = new Zend_Form_Element_Select('rudd_type'); $rudd_type->setLabel('Ancient British Coinage number: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addMultiOptions(array(null => 'Choose ABC number', 'Valid types' => $abclist))->addValidator('InArray', false, array(array_keys($abclist))); $phase_date_1 = new Zend_Form_Element_Text('phase_date_1'); $phase_date_1->setLabel('Phase date 1: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $phase_date_2 = new Zend_Form_Element_Text('phase_date_2'); $phase_date_2->setLabel('Phase date 2: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $context = new Zend_Form_Element_Text('context'); $context->setLabel('Context of coins: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $depositionDate = new Zend_Form_Element_Text('depositionDate'); $depositionDate->setLabel('Date of deposition: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $numChiab = new Zend_Form_Element_Text('numChiab'); $numChiab->setLabel('Coin hoards of Iron Age Britain number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($ruler_id, $ruler_qualifier, $denomination, $denomination_qualifier, $mint_id, $ruler2_id, $ruler2_qualifier, $geographyID, $geography_qualifier, $status, $status_qualifier, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $tribe, $tribe_qualifier, $bmc_type, $mack_type, $allen_type, $va_type, $rudd_type, $cciNumber, $numChiab, $context, $depositionDate, $phase_date_1, $phase_date_2, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'geographyID', 'geography_qualifier', 'tribe', 'tribe_qualifier', 'ruler_id', 'ruler_qualifier', 'ruler2_id', 'ruler2_qualifier', 'mint_id', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty', 'bmc_type', 'va_type', 'allen_type', 'rudd_type', 'mack_type', 'cciNumber', 'numChiab', 'context', 'phase_date_1', 'phase_date_2', 'depositionDate'), 'details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }