Пример #1
0
 /** Construct the form
  * @access public
  * @param type $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $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('Medieval type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'textInput', 'class' => 'span8'));
     $broadperiod = new Zend_Form_Element_Select('periodID');
     $broadperiod->setLabel('Broadperiod for type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultioptions(array(null => 'Choose broadperiod', 'Available options' => array(47 => 'Early Medieval', 29 => 'Medieval', 36 => 'Post Medieval')));
     $category = new Zend_Form_Element_Select('categoryID');
     $category->setLabel('Coin category: ')->setAttribs(array('class' => 'textInput'))->addFilter('StringTrim')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addMultioptions(array(null => 'Choose a category', 'Available options' => $cat_options))->addValidator('InArray', false, array(array_keys($cat_options)));
     $ruler = new Zend_Form_Element_Select('rulerID');
     $ruler->setLabel('Ruler assigned to: ')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'))->addFilter('StringTrim')->addMultioptions(array(null => 'Choose a ruler', 'Available options' => $ruler_options))->addValidator('inArray', false, array(array_keys($ruler_options)));
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date type in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'));
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date type in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit details for medieval coin type');
     $this->addElements(array($type, $broadperiod, $category, $ruler, $datefrom, $dateto, $submit))->setLegend('Add an active type of Medieval coin')->setMethod('post');
     parent::init();
 }
Пример #2
0
 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');
 }
Пример #3
0
 public function __construct($options = null)
 {
     $cats = new CategoriesCoins();
     $cat_options = $cats->getCategoriesAll();
     $rulers = new Rulers();
     $ruler_options = $rulers->getAllMedRulers();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setName('MedievalType');
     $type = new Zend_Form_Element_Text('type');
     $type->setLabel('Medieval type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttribs(array('class' => 'textInput', 'size' => 60));
     $broadperiod = new Zend_Form_Element_Select('periodID');
     $broadperiod->setLabel('Broadperiod for type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'textInput'))->addMultioptions(array(NULL => NULL, 'Choose broadperiod' => array('47' => 'Early Medieval', '29' => 'Medieval', '36' => 'Post Medieval')));
     $category = new Zend_Form_Element_Select('categoryID');
     $category->setLabel('Coin category: ')->setAttribs(array('class' => 'textInput'))->addValidator('Int')->addFilter('StringTrim')->addMultioptions(array(NULL => NULL, 'Choose a category' => $cat_options))->addValidator('InArray', true, array($cat_options));
     $ruler = new Zend_Form_Element_Select('rulerID');
     $ruler->setLabel('Ruler assigned to: ')->setAttribs(array('class' => 'textInput'))->addValidator('Int')->addFilter('StringTrim')->addMultioptions(array(NULL => NULL, 'Choose a category' => $ruler_options))->addValidator('inArray', true, array($ruler_options));
     $datefrom = new Zend_Form_Element_Text('datefrom');
     $datefrom->setLabel('Date type in use from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'textInput'));
     $dateto = new Zend_Form_Element_Text('dateto');
     $dateto->setLabel('Date type in use until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'textInput'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit details for medieval coin type')->setAttribs(array('class' => 'large'));
     $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($type, $broadperiod, $category, $ruler, $datefrom, $dateto, $submit))->setLegend('Add an active type of Medieval coin')->setMethod('post')->addDecorators(array('Fieldset', 'form', array('HtmlTag', array('tag' => 'div'))));
 }
Пример #4
0
 /** 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();
 }
Пример #5
0
 public function __construct($options = null)
 {
     $rulers = new Rulers();
     $rulers_options = $rulers->getAllMedRulers();
     $dynasties = new Dynasties();
     $dynasties_options = $dynasties->getOptions();
     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('MonarchDetails');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Monarch\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', '50')->addErrorMessage('You must enter a Monarch\'s name')->setDecorators($decorators);
     $styled = new Zend_Form_Element_Text('styled');
     $styled->setLabel('Styled as: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
     $alias = new Zend_Form_Element_Text('alias');
     $alias->setLabel('Monarch\'s alias: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
     $dbaseID = new Zend_Form_Element_Select('dbaseID');
     $dbaseID->setLabel('Database ID: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(NULL => NULL, 'Choose Database ID' => $rulers_options))->setDecorators($decorators);
     $date_from = new Zend_Form_Element_Text('date_from');
     $date_from->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $date_to = new Zend_Form_Element_Text('date_to');
     $date_to->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $born = new Zend_Form_Element_Text('born');
     $born->setLabel('Born: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $died = new Zend_Form_Element_Text('died');
     $died->setLabel('Died: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $biography = new Pas_Form_Element_RTE('biography');
     $biography->setLabel('Biography: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $dynasty = new Zend_Form_Element_Select('dynasty');
     $dynasty->setLabel('Dynastic grouping: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publication status: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(NULL => NULL, 'Set status' => array('1' => 'Draft', '2' => 'Published')))->setValue(1)->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($name, $styled, $alias, $dbaseID, $date_from, $date_to, $born, $died, $biography, $dynasty, $publishState, $submit));
     $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->addDisplayGroup(array('name', 'styled', 'alias'), 'names');
     $this->names->setLegend('Nomenclature');
     $this->names->removeDecorator('DtDdWrapper');
     $this->names->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('dbaseID', 'date_from', 'date_to', 'born', 'died'), 'periods');
     $this->periods->setLegend('Dates');
     $this->periods->removeDecorator('DtDdWrapper');
     $this->periods->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('biography', 'dynasty', 'publishState'), 'details');
     $this->details->setLegend('Biographical details');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Пример #6
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $rulers = new Rulers();
     $rulers_options = $rulers->getAllMedRulers();
     $dynasties = new Dynasties();
     $dynasties_options = $dynasties->getOptions();
     parent::__construct($options);
     $this->setName('MonarchDetails');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Monarch\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', '50')->addErrorMessage('You must enter a Monarch\'s name');
     $styled = new Zend_Form_Element_Text('styled');
     $styled->setLabel('Styled as: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $alias = new Zend_Form_Element_Text('alias');
     $alias->setLabel('Monarch\'s alias: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $dbaseID = new Zend_Form_Element_Select('dbaseID');
     $dbaseID->setLabel('Database ID: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(null => 'Choose Database ID', 'Available rulers' => $rulers_options));
     $date_from = new Zend_Form_Element_Text('date_from');
     $date_from->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $date_to = new Zend_Form_Element_Text('date_to');
     $date_to->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $born = new Zend_Form_Element_Text('born');
     $born->setLabel('Born: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $died = new Zend_Form_Element_Text('died');
     $died->setLabel('Died: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $biography = new Pas_Form_Element_CKEditor('biography');
     $biography->setLabel('Biography: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $dynasty = new Zend_Form_Element_Select('dynasty');
     $dynasty->setLabel('Dynastic grouping: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publication status: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(null => 'Set status', 'Available status options' => array('1' => 'Draft', '2' => 'Published')))->setValue(1);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($name, $styled, $alias, $dbaseID, $date_from, $date_to, $born, $died, $biography, $dynasty, $publishState, $submit, $hash));
     $this->addDisplayGroup(array('name', 'styled', 'alias'), 'names');
     $this->names->setLegend('Nomenclature');
     $this->addDisplayGroup(array('dbaseID', 'date_from', 'date_to', 'born', 'died'), 'periods');
     $this->periods->setLegend('Dates');
     $this->addDisplayGroup(array('biography', 'dynasty', 'publishState'), 'details');
     $this->details->setLegend('Biographical details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }