/** The constructor * @access public * @param array $options * @return void */ public function __construct(array $options = null) { $periods = new Periods(); $period_options = $periods->getMedievalCoinsPeriodList(); $cats = new CategoriesCoins(); $cat_options = $cats->getCategoriesAll(); $rulers = new Rulers(); $ruler_options = $rulers->getAllMedRulers(); parent::__construct($options); $this->setName('medievaltype'); $type = new Zend_Form_Element_Text('type'); $type->setLabel('Coin type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('You must enter a type name.'); $periodID = new Zend_Form_Element_Select('periodID'); $periodID->setLabel('Medieval period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int'); $rulerID = new Zend_Form_Element_Select('rulerID'); $rulerID->setLabel('Ruler assigned: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(null => 'Choose a ruler', 'Available rulers' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->addValidator('Int'); $datefrom = new Zend_Form_Element_Text('datefrom'); $datefrom->setLabel('Date in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $dateto = new Zend_Form_Element_Text('dateto'); $dateto->setLabel('Date in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits'); $categoryID = new Zend_Form_Element_Select('categoryID'); $categoryID->setLabel('Coin category: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a category', 'Available categories' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->addValidator('Int'); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($type, $rulerID, $periodID, $categoryID, $datefrom, $dateto, $submit)); $this->addDisplayGroup(array('periodID', 'type', 'categoryID', 'rulerID', 'datefrom', 'dateto', 'submit'), 'details'); $this->details->setLegend('Medieval type details: '); parent::init(); }
public function __construct($options = null) { $periods = new Periods(); $period_options = $periods->getMedievalCoinsPeriodList(); $cats = new CategoriesCoins(); $cat_options = $cats->getCategoriesAll(); $rulers = new Rulers(); $ruler_options = $rulers->getAllMedRulers(); parent::__construct($options); $this->setAttrib('accept-charset', 'UTF-8'); $this->setName('medievaltype'); $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'))); $type = new Zend_Form_Element_Text('type'); $type->setLabel('Coin type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('You must enter a type name.')->setDecorators($decorators); $periodID = new Zend_Form_Element_Select('periodID'); $periodID->setLabel('Medieval period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(NULL => NULL, 'Choose a period' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addValidator('Int')->setDecorators($decorators); $rulerID = new Zend_Form_Element_Select('rulerID'); $rulerID->setLabel('Ruler assigned: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(NULL => NULL, 'Choose a ruler' => $ruler_options))->addValidator('InArray', false, array(array_keys($ruler_options)))->addValidator('Int')->setDecorators($decorators); $datefrom = new Zend_Form_Element_Text('datefrom'); $datefrom->setLabel('Date in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators); $dateto = new Zend_Form_Element_Text('dateto'); $dateto->setLabel('Date in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators); $categoryID = new Zend_Form_Element_Select('categoryID'); $categoryID->setLabel('Coin category: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose a category' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)))->addValidator('Int')->setDecorators($decorators); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper'); $this->addElements(array($type, $rulerID, $periodID, $categoryID, $datefrom, $dateto, $submit)); $this->addDisplayGroup(array('periodID', 'type', 'categoryID', 'rulerID', 'datefrom', 'dateto', 'submit'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->setLegend('Mint 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->getMedievalCoinsPeriodList(); parent::__construct($options); $this->setName('medievaltype'); $category = new Zend_Form_Element_Text('category'); $category->setLabel('Medieval coin category: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a category name.'); $periodID = new Zend_Form_Element_Select('periodID'); $periodID->setLabel('Medieval 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)); $description = new Pas_Form_Element_CKEditor('description'); $description->setLabel('Description: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $submit = new Zend_Form_Element_Submit('submit'); $this->addElements(array($category, $description, $periodID, $submit)); $this->addDisplayGroup(array('category', 'periodID', 'description', 'submit'), 'details'); parent::init(); }
public function __construct($options = null) { $periods = new Periods(); $period_options = $periods->getMedievalCoinsPeriodList(); parent::__construct($options); $this->setName('medievaltype'); $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'))); $category = new Zend_Form_Element_Text('category'); $category->setLabel('Medieval coin category: ')->setRequired(true)->setAttrib('size', 60)->addFilter(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a category name.')->setDecorators($decorators); $periodID = new Zend_Form_Element_Select('periodID'); $periodID->setLabel('Medieval period: ')->setRequired(true)->addFilter(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(NULL => NULL, 'Choose a period' => $period_options))->setDecorators($decorators); $description = new Zend_Form_Element_RTE('description'); $description->setLabel('Description: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars')); $submit = new Zend_Form_Element_Submit('submit'); $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper'); $this->addElements(array($category, $description, $periodID, $submit)); $this->addDisplayGroup(array('category', 'periodID', 'description', 'submit'), 'details')->removeDecorator('HtmlTag'); $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul')))); $this->details->removeDecorator('DtDdWrapper'); $this->details->removeDecorator('HtmlTag'); }