/** the constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $periods = new Periods(); $period_options = $periods->getCoinsPeriod(); parent::__construct($options); $this->setName('moneyers'); $name = new Zend_Form_Element_Text('name'); $name->setLabel('Moneyer\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter a moneyer\'s name'); $period = new Zend_Form_Element_Select('period'); $period->setLabel('Broad period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available Options' => $period_options)); $date_1 = new Zend_Form_Element_Text('date_1'); $date_1->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the start of moneyer period'); $date_2 = new Zend_Form_Element_Text('date_2'); $date_2->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the end of moneyer period'); $appear = new Zend_Form_Element_Text('appear'); $appear->setLabel('Appearance on coins: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim')); $RRC = new Zend_Form_Element_Text('RRC'); $RRC->setLabel('RRC ID number: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim')); $bio = new Pas_Form_Element_CKEditor('bio'); $bio->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography'); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->setLabel('Is this term valid?: '); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($period, $name, $date_1, $date_2, $bio, $appear, $RRC, $valid, $submit)); $this->addDisplayGroup(array('name', 'period', 'date_1', 'date_2', 'appear', 'RRC', 'bio', 'valid', 'submit'), 'details'); parent::init(); }
public function __construct($options = null) { $periods = new Periods(); $period_options = $periods->getCoinsPeriod(); parent::__construct($options); $this->setName('ruler'); $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'))); $issuer = new Zend_Form_Element_Text('issuer'); $issuer->setLabel('Ruler or issuer name: ')->setRequired(true)->addErrorMessage('Please enter a name for this issuer or ruler.')->setDecorators($decorators)->setAttrib('size', 70)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim')); $date1 = new Zend_Form_Element_Text('date1'); $date1->setLabel('Date issued from: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a date for the start of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $date2 = new Zend_Form_Element_Text('date2'); $date2->setLabel('Date issued to: ')->setRequired(true)->setDecorators($decorators)->addErrorMessage('You must enter a date for the end of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->SetLabel('Is this ruler or issuer currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators); $period = new Zend_Form_Element_Select('period'); $period->setLabel('Broad period attributed to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose reason' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->setDecorators($decorators)->addErrorMessage('You must enter a period for this ruler/issuer'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $this->addElements(array($issuer, $date1, $date2, $period, $valid, $submit, $hash)); $this->addDisplayGroup(array('issuer', 'date1', 'date2', 'period', 'valid', 'submit'), 'details'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->setLegend('Issuer or ruler details: '); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $periods = new Periods(); $period_options = $periods->getCoinsPeriod(); parent::__construct($options); $this->setName('ruler'); $issuer = new Zend_Form_Element_Text('issuer'); $issuer->setLabel('Ruler or issuer name: ')->setRequired(true)->addErrorMessage('Please enter a name for this issuer or ruler.')->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim', 'Purifier')); $date1 = new Zend_Form_Element_Text('date1'); $date1->setLabel('Date issued from: ')->setRequired(true)->addErrorMessage('You must enter a date for the start of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $date2 = new Zend_Form_Element_Text('date2'); $date2->setLabel('Date issued to: ')->setRequired(true)->addErrorMessage('You must enter a date for the end of their issue.')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->SetLabel('Is this ruler or issuer currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int'); $period = new Zend_Form_Element_Select('period'); $period->setLabel('Broad period attributed to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a period', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addErrorMessage('You must enter a period for this ruler/issuer'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_salt)->setTimeout(4800); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($issuer, $date1, $date2, $period, $valid, $submit, $hash)); $this->addDisplayGroup(array('issuer', 'date1', 'date2', 'period', 'valid', 'submit'), 'details'); $this->details->setLegend('Issuer or ruler details: '); parent::init(); }
public function __construct($options = null) { $periods = new Periods(); $period_actives = $periods->getCoinsPeriod(); 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('coinsclass'); $referenceName = new Zend_Form_Element_Text('referenceName'); $referenceName->setLabel('Reference volume title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 60); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->SetLabel('Is this volume currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators); $period = new Zend_Form_Element_Select('period'); $period->setLabel('Period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('inArray', false, array(array_keys($period_actives)))->addMultiOptions(array(NULL => NULL, 'Choose period:' => $period_actives))->addErrorMessage('You must enter a period for this mint')->setDecorators($decorators); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag'); $hash = new Zend_Form_Element_Hash('csrf'); $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60); $this->addElement($hash); $this->addElements(array($referenceName, $valid, $period, $submit)); $this->addDisplayGroup(array('referenceName', 'period', 'valid'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->setLegend('Mint details: '); $this->details->removeDecorator('DtDdWrapper'); $this->addDisplayGroup(array('submit'), 'submit'); }
/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $periods = new Periods(); $period_actives = $periods->getCoinsPeriod(); parent::__construct($options); $this->setName('coinsclass'); $referenceName = new Zend_Form_Element_Text('referenceName'); $referenceName->setLabel('Reference volume title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60); $valid = new Zend_Form_Element_Checkbox('valid'); $valid->SetLabel('Is this volume currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim')); $period = new Zend_Form_Element_Select('period'); $period->setLabel('Period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('inArray', false, array(array_keys($period_actives)))->addMultiOptions(array(null => 'Choose a period', 'Available periods:' => $period_actives))->addErrorMessage('You must enter a period for this mint'); //Submit button $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($referenceName, $valid, $period, $submit)); $this->addDisplayGroup(array('referenceName', 'period', 'valid'), 'details'); $this->details->setLegend('Mint details: '); $this->addDisplayGroup(array('submit'), 'buttons'); parent::init(); }