public function __construct($options = null) { // Construct the select menu data $rulers = new Rulers(); $ruler_options = $rulers->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $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('romancoin'); $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', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $denomination_options))->setRegisterInArrayValidator(false)->addValidator()->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('Int')->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $ruler_options))->setRegisterInArrayValidator(false)->setDecorators($decorators); $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'))->addValidators(array('NotEmpty', 'Integer'))->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: ')->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose denomination' => $mint_options))->setRegisterInArrayValidator(false)->setDecorators($decorators); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->setValue(1)->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'))->addValidators(array('NotEmpty', 'Integer'))->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)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Integer'))->addMultiOptions(array(NULL => NULL, 'Choose coin status' => $wear_options))->setDecorators($decorators); $obverse_inscription = new Zend_Form_Element_Text('obverse_inscription'); $obverse_inscription->setLabel('Obverse inscription: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->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: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'expanding'); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->addFilters(array('StripTags', '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'))->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(NULL => NULL, 'Choose die axis' => $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'))->addValidators(array('NotEmpty', 'Int'))->setOptions(array('separator' => ''))->addDecorator('HtmlTag', array('placement' => 'prepend', 'tag' => 'div', 'id' => 'radios'))->setDecorators($decorators); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $this->addElements(array($ruler, $denomination, $mint_ID, $status, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', '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'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $rulers = new Rulers(); $ruler_options = $rulers->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $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('romancoin'); $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(null => 'Choose denomination', 'Available options' => $denomination_options))->addValidator('InArray', false, array(array_keys($denomination_options)))->setAttribs(array('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'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setOptions(array('separator' => '')); $ruler = new Zend_Form_Element_Select('ruler_id'); $ruler->setLabel('Ruler: ')->addValidators(array('NotEmpty', 'Int'))->addMultiOptions(array(null => 'Choose ruler', 'Available options' => $ruler_options))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $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'))->addValidators(array('NotEmpty', 'Int')); $mint_ID = new Zend_Form_Element_Select('mint_id'); $mint_ID->setLabel('Issuing mint: ')->addValidators(array('NotEmpty', 'Int'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose mint', 'Available options' => $mint_options))->addValidator('InArray', false, array(array_keys($mint_options))); $mint_qualifier = new Zend_Form_Element_Radio('mint_qualifier'); $mint_qualifier->setLabel('Mint qualifier: ')->addMultiOptions(array('1' => 'Certain', '2' => 'Probably', '3' => 'Possibly'))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int')); $status = new Zend_Form_Element_Select('status'); $status->setLabel('Status: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->setValue(1)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose a status', 'Available status options' => $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'))->addValidators(array('NotEmpty', 'Int')); $degree_of_wear = new Zend_Form_Element_Select('degree_of_wear'); $degree_of_wear->setLabel('Degree of wear: ')->addValidator('InArray', false, array(array_keys($wear_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Int'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose degree of wear', 'Available options' => $wear_options)); $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: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'span6'); $obverse_description = new Zend_Form_Element_Textarea('obverse_description'); $obverse_description->setLabel('Obverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->setAttrib('class', 'span6')->addFilters(array('StripTags', 'StringTrim')); $reverse_description = new Zend_Form_Element_Textarea('reverse_description'); $reverse_description->setLabel('Reverse description: ')->addValidators(array('NotEmpty'))->setAttrib('rows', 8)->setAttrib('cols', 80)->setAttrib('class', 'span6')->addFilters(array('StripTags', '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'))->addValidators(array('NotEmpty', 'Int'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->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'))->addValidators(array('NotEmpty', 'Int'))->setOptions(array('separator' => '')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($ruler, $denomination, $mint_ID, $status, $degree_of_wear, $obverse_description, $obverse_inscription, $reverse_description, $reverse_inscription, $die_axis_measurement, $die_axis_certainty, $mint_qualifier, $ruler_qualifier, $denomination_qualifier, $status_qualifier, $submit)); $this->addDisplayGroup(array('denomination', 'denomination_qualifier', 'ruler_id', 'ruler_qualifier', 'mint_id', 'mint_qualifier', 'status', 'status_qualifier', 'degree_of_wear', 'obverse_description', 'obverse_inscription', 'reverse_description', 'reverse_inscription', 'die_axis_measurement', 'die_axis_certainty'), 'details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $institutions = new Institutions(); $inst_options = $institutions->getInsts(); $rulers = new Rulers(); $ruler_options = $rulers->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $periods = new Periods(); $periodword_options = $periods->getPeriodsHoards(); parent::__construct($options); $this->setName('coinsummary-search'); $broadperiod = new Zend_Form_Element_Select('broadperiod'); $broadperiod->setLabel('Broad period: ')->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $periodword_options))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setOrder(1); ### ##Numismatic data ### //Denomination $denomination = new Zend_Form_Element_Select('denominationID'); $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options))->setOrder(2); //Primary ruler $ruler = new Zend_Form_Element_Select('rulerID'); $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options))->setOrder(3); //Mint $mint = new Zend_Form_Element_Select('mintID'); $mint->setLabel('Issuing mint: ')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination type', 'Available mints' => $mint_options))->setOrder(4); $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->setRequired(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Choose institution' => $inst_options))->setOrder(5); $quantity = new ZendX_JQuery_Form_Element_Spinner('quantity'); $quantity->setLabel('Quantity in hoard')->setJQueryParams(array('defaultValue' => 1, 'min' => 1, 'max' => 50000))->setAttribs(array('class' => 'input-large'))->addValidators(array('Int'))->setOrder(6); $fromDate = new Zend_Form_Element_Text('fromDate'); $fromDate->setLabel('Date from: ')->setValidators(array('Int'))->setAttribs(array('placeholder' => 'YYYY', 'class' => 'input-small'))->setOrder(7); $toDate = new Zend_Form_Element_Text('toDate'); $toDate->setLabel('Date to: ')->setValidators(array('Int'))->setAttribs(array('placeholder' => 'YYYY', 'class' => 'input-small'))->setOrder(8); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Search summaries'); $this->addElements(array($broadperiod, $denomination, $mint, $institution, $ruler, $quantity, $fromDate, $toDate, $submit)); $this->addDisplayGroup(array('broadperiod', 'denominationID', 'rulerID', 'mintID', 'fromDate', 'toDate', 'quantity', 'institution'), 'numismatics'); $this->numismatics->setLegend('Summary details'); $this->addDisplayGroup(array('submit'), 'buttons'); ZendX_JQuery::enableForm($this); parent::init(); }
public function __construct($options = null) { $institutions = new Institutions(); $inst_options = $institutions->getInsts(); //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(); $rulers = new Rulers(); $ruler_options = $rulers->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $reece = new Reeces(); $reece_options = $reece->getReeces(); $regions = new Regions(); $region_options = $regions->getRegionName(); parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->clearDecorators(); $decorator = array('SimpleInput'); $decoratorButton = array('NormalDecButton'); $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('byzantine-search'); $old_findID = new Zend_Form_Element_Text('old_findID'); $old_findID->setLabel('Find number: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('Please enter a valid number!')->setDecorators($decorators)->setDisableTranslator(true); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Object description contains: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->addErrorMessage('Please enter a valid term')->setDecorators($decorators)->setDisableTranslator(true); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose Worklow stage' => array('1' => 'Quarantine', '2' => 'On review', '3' => 'Awaiting validation', '4' => 'Published')))->setDecorators($decorators)->setDisableTranslator(true); //Rally details $rally = new Zend_Form_Element_Checkbox('rally'); $rally->setLabel('Rally find: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->setUncheckedValue(NULL)->setDecorators($decorators)->setDisableTranslator(true); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addMultiOptions(array(NULL => NULL, 'Choose rally name' => $rally_options))->setDecorators($decorators)->setDisableTranslator(true); $hoard = new Zend_Form_Element_Checkbox('hoard'); $hoard->setLabel('Hoard find: ')->setRequired(false)->addFilter('StripTags')->addFilter('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: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $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)->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)->addFilters(array('StripTags', 'StringTrim'))->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'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setDecorators($decorators); ### ##Numismatic data ### //Denomination $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $denomination_options))->setDecorators($decorators); //Primary ruler $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose primary ruler' => $ruler_options))->setDecorators($decorators); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose denomination type' => $mint_options))->setDecorators($decorators); //Obverse inscription $obverseinsc = new Zend_Form_Element_Text('obverseLegend'); $obverseinsc->setLabel('Obverse inscription contains: ')->setAttrib('size', 60)->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: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //reverse inscription $reverseinsc = new Zend_Form_Element_Text('reverseLegend'); $reverseinsc->setLabel('Reverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //reverse description $reversedesc = new Zend_Form_Element_Text('reverseDescription'); $reversedesc->setLabel('Reverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term')->setDecorators($decorators); //Die axis $axis = new Zend_Form_Element_Select('axis'); $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose measurement' => $axis_options))->setDecorators($decorators); $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); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('coin'); $objecttype->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('label'); $broadperiod = new Zend_Form_Element_Hidden('broadperiod'); $broadperiod->setValue('Byzantine')->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('label'); // Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large'); $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, $objecttype, $broadperiod, $institution, $submit)); $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics'); $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details'); $this->addDisplayGroup(array('county', 'regionID', 'district', 'parish', 'gridref', 'fourFigure', 'institution'), 'spatial'); $this->numismatics->setLegend('Numismatic details'); $this->numismatics->removeDecorator('DtDdWrapper'); $this->numismatics->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->setLegend('Artefact details'); $this->details->removeDecorator('DtDdWrapper'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->spatial->setLegend('Spatial details'); $this->spatial->removeDecorator('DtDdWrapper'); $this->spatial->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->addDisplayGroup(array('submit'), 'submit'); $this->addDecorator('FormElements')->addDecorator('Form')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div')); $this->removeDecorator('DtDdWrapper'); }
/** 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->getRulersByzantine(); $denominations = new Denominations(); $denomination_options = $denominations->getDenomsByzantine(); $mints = new Mints(); $mint_options = $mints->getMintsByzantine(); $axis = new Dieaxes(); $axis_options = $axis->getAxes(); $regions = new OsRegions(); $region_options = $regions->getRegionsID(); parent::__construct($options); $this->setName('byzantine-search'); $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!')->setDisableTranslator(true); $description = new Zend_Form_Element_Text('description'); $description->setLabel('Object description contains: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid term')->setDisableTranslator(true); $workflow = new Zend_Form_Element_Select('workflow'); $workflow->setLabel('Workflow stage: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge 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: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setUncheckedValue(null); $rallyID = new Zend_Form_Element_Select('rallyID'); $rallyID->setLabel('Found at this rally: ')->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose rally name', 'Available rallies' => $rally_options)); $county = new Zend_Form_Element_Select('countyID'); $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->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'))->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->disabled = true; $parish = new Zend_Form_Element_Select('parishID'); $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose parish after county'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->disabled = true; $regionID = new Zend_Form_Element_Select('regionID'); $regionID->setLabel('European region: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a region for a wide result', 'Choose region' => $region_options))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow')); $gridref = new Zend_Form_Element_Text('gridref'); $gridref->setLabel('Grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef')); $fourFigure = new Zend_Form_Element_Text('fourFigure'); $fourFigure->setLabel('Four figure grid reference: ')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef')); ### ##Numismatic data ### //Denomination $denomination = new Zend_Form_Element_Select('denomination'); $denomination->setLabel('Denomination: ')->setRegisterInArrayValidator(false)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose denomination type', 'Available denominations' => $denomination_options)); //Primary ruler $ruler = new Zend_Form_Element_Select('ruler'); $ruler->setLabel('Ruler / issuer: ')->setRegisterInArrayValidator(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose primary ruler', 'Available rulers' => $ruler_options)); //Mint $mint = new Zend_Form_Element_Select('mint'); $mint->setLabel('Issuing mint: ')->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose denomination type', 'Available mints' => $mint_options)); //Obverse inscription $obverseinsc = new Zend_Form_Element_Text('obverseLegend'); $obverseinsc->setLabel('Obverse inscription contains: ')->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid term'); //Obverse description $obversedesc = new Zend_Form_Element_Text('obverseDescription'); $obversedesc->setLabel('Obverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term'); //reverse inscription $reverseinsc = new Zend_Form_Element_Text('reverseLegend'); $reverseinsc->setLabel('Reverse inscription contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term'); //reverse description $reversedesc = new Zend_Form_Element_Text('reverseDescription'); $reversedesc->setLabel('Reverse description contains: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid term'); //Die axis $axis = new Zend_Form_Element_Select('axis'); $axis->setLabel('Die axis measurement: ')->setRegisterInArrayValidator(false)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addMultiOptions(array(null => 'Choose measurement', 'Available axes' => $axis_options)); $institution = new Zend_Form_Element_Select('institution'); $institution->setLabel('Recording institution: ')->setRequired(false)->setAttribs(array('class' => 'input-xlarge selectpicker show-menu-arrow'))->addFilters(array('StringTrim', 'StripTags'))->addMultiOptions(array(null => 'Choose institution', 'Choose institution' => $inst_options)); $objecttype = new Zend_Form_Element_Hidden('objecttype'); $objecttype->setValue('coin'); $objecttype->addFilters(array('StripTags', 'StringTrim')); $broadperiod = new Zend_Form_Element_Hidden('broadperiod'); $broadperiod->setValue('Byzantine')->addFilters(array('StripTags', 'StringTrim', 'StringToUpper')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($old_findID, $description, $workflow, $rally, $rallyID, $county, $regionID, $district, $parish, $fourFigure, $gridref, $denomination, $ruler, $mint, $axis, $obverseinsc, $obversedesc, $reverseinsc, $reversedesc, $objecttype, $broadperiod, $institution, $submit)); $this->addDisplayGroup(array('denomination', 'ruler', 'mint', 'moneyer', 'axis', 'obverseLegend', 'obverseDescription', 'reverseLegend', 'reverseDescription'), 'numismatics'); $this->addDisplayGroup(array('old_findID', 'description', 'rally', 'rallyID', 'hoard', 'hID', 'workflow'), 'details'); $this->addDisplayGroup(array('countyID', 'regionID', 'districtID', 'parishID', 'gridref', 'fourFigure', 'institution'), 'spatial'); $this->numismatics->setLegend('Numismatic details'); $this->details->setLegend('Artefact details'); $this->spatial->setLegend('Spatial details'); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }