本文整理汇总了PHP中Pas_Form类的典型用法代码示例。如果您正苦于以下问题:PHP Pas_Form类的具体用法?PHP Pas_Form怎么用?PHP Pas_Form使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pas_Form类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/** 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();
}
示例2: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('Decmethods');
$decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'apppend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
$term = new Zend_Form_Element_Text('term');
$term->setLabel('Decoration style term: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid title for this decorative method!')->setDecorators($decorators);
$termdesc = new Pas_Form_Element_RTE('termdesc');
$termdesc->setLabel('Description of decoration style: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('BasicHtml', 'EmptyParagraph'))->addFilter('WordChars');
$valid = new Zend_Form_Element_Checkbox('valid');
$valid->setLabel('Is this term valid?: ')->setRequired(true)->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')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
$this->addElements(array($term, $termdesc, $valid, $submit));
$this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details')->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
$this->addDisplayGroup(array('submit'), 'submit');
$this->submit->removeDecorator('DtDdWrapper');
$this->submit->removeDecorator('HtmlTag');
$this->details->setLegend('Decoration method details: ');
}
示例3: __construct
public function __construct($options = null)
{
$periods = new Periods();
$periodword_options = $periods->getPeriodFromWords();
$counties = new Counties();
$county_options = $counties->getCountyName2();
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$this->setMethod('post');
$this->setName('filterfinds');
$this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
$this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
$this->addPrefixPath('Pas_Form_Decorator', 'Pas/Form/Decorator/', 'decorator');
$decorator = array('TableDecInput');
$objecttype = new Zend_Form_Element_Text('objecttype');
$objecttype->setLabel('Filter by object type')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 10)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
$oldfindID = new Zend_Form_Element_Text('old_findID');
$oldfindID->setLabel('Filter by find ID #')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 11)->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
$broadperiod = new Zend_Form_Element_Select('broadperiod');
$broadperiod->setLabel('Filter by broadperiod')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose period from' => $periodword_options))->addValidator('InArray', false, array(array_keys($periodword_options)));
$county = new Zend_Form_Element_Select('county');
$county->setLabel('Filter by county')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 200))->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addMultiOptions(array(NULL => NULL, 'Choose county' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton')->setLabel('Filter:')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'td'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'largefilter');
$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($objecttype, $oldfindID, $broadperiod, $county, $submit));
}
示例4: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
ZendX_JQuery::enableForm($this);
parent::__construct($options);
$this->setName('research');
$investigator = new Zend_Form_Element_Text('investigator');
$investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.');
$level = new Zend_Form_Element_Select('level');
$level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => null, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)));
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.');
$description = new Pas_Form_Element_CKEditor('description');
$description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
$startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
$startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter a start date for this project');
$endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
$endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter an end date for this project');
$valid = new Zend_Form_Element_Checkbox('valid');
$valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
$submit = new Zend_Form_Element_Submit('submit');
$this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit));
$this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details');
$this->addDisplayGroup(array('submit'), 'buttons');
parent::init();
}
示例5: __construct
public function __construct($options = null)
{
$curators = new Peoples();
$assigned = $curators->getValuers();
ZendX_JQuery::enableForm($this);
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('provisionalvaluations');
$valuerID = new Zend_Form_Element_Select('valuerID');
$valuerID->setLabel('Valuation provided by: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 25))->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators);
$value = new Zend_Form_Element_Text('value');
$value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Float')->setDecorators($decorators);
$comments = new Pas_Form_Element_RTE('comments');
$comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
$dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation');
$dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addValidator('Date')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
$this->addElements(array($valuerID, $value, $dateOfValuation, $comments, $submit));
$this->addDisplayGroup(array('valuerID', 'value', 'dateOfValuation', 'comments'), 'details')->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
$this->addDisplayGroup(array('submit'), 'submit');
$this->submit->removeDecorator('DtDdWrapper');
$this->submit->removeDecorator('HtmlTag');
}
示例6: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$staffregions = new StaffRegions();
$staffregions_options = $staffregions->getOptions();
ZendX_JQuery::enableForm($this);
parent::__construct($options);
$this->setName('vacancies');
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60);
$salary = new Zend_Form_Element_Text('salary');
$salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addErrorMessage('You must enter a salary.');
$specification = new Pas_Form_Element_CKEditor('specification');
$specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->addErrorMessage('You must enter a job description.');
$regionID = new Zend_Form_Element_Select('regionID');
$regionID->setLabel('Location of role: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Choose region', 'Available regions' => $staffregions_options))->addErrorMessage('You must choose a region');
$live = new ZendX_JQuery_Form_Element_DatePicker('live');
$live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
$expire = new ZendX_JQuery_Form_Element_DatePicker('expire');
$expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
$status = new Zend_Form_Element_Select('status');
$status->SetLabel('Publish status: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a status', 2 => 'Publish', 1 => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose a status');
$submit = new Zend_Form_Element_Submit('submit');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(4800);
$this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit, $hash));
$this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
$this->details->setLegend('Vacancy details');
$this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
$this->dates->setLegend('Publication details');
$this->setLegend('Vacancy details');
$this->addDisplayGroup(array('submit'), 'buttons');
parent::init();
}
示例7: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
$periods = new Periods();
$period_options = $periods->getPeriodFrom();
parent::__construct($options);
$this->setName('suggested');
$level = new Zend_Form_Element_Select('level');
$level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a level', 'Research levels' => $projectype_list))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'));
$period = new Zend_Form_Element_Select('period');
$period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a period', 'Periods available' => $period_options))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'));
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Choose title for the project.');
$description = new Pas_Form_Element_CKEditor('description');
$description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
$valid = new Zend_Form_Element_Checkbox('taken');
$valid->setLabel('Is the topic taken: ')->setRequired(true)->addValidator('Int');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(4800);
$submit = new Zend_Form_Element_Submit('submit');
$this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
$this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), 'details');
$this->addDisplayGroup(array('submit'), 'buttons');
parent::init();
}
示例8: init
/** Initialise the form
* @access public
* @return void
*/
public function init()
{
$roles = new Roles();
$role_options = $roles->getRoles();
$inst = new Institutions();
$inst_options = $inst->getInsts();
$username = $this->addElement('text', 'username', array('label' => 'Username: '))->username;
$username->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
$firstName = $this->addElement('text', 'first_name', array('label' => 'First Name', 'size' => '30'))->first_name;
$firstName->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a firstname');
$lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name', 'size' => '30'))->last_name;
$lastName->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a surname');
$preferred_name = $this->addElement('text', 'preferred_name', array('label' => 'Preferred Name: ', 'size' => '30'))->preferred_name;
$preferred_name->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter your preferred name');
$fullname = $this->addElement('text', 'fullname', array('label' => 'Full name: ', 'size' => '30'))->fullname;
$fullname->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter your preferred name');
$email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
$email->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
$password = $this->addElement('password', 'password', array('label' => 'Change password: ', 'size' => '30'))->password;
$password->setRequired(false);
$institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
$institution->addMultiOptions(array(null => 'Choose institution', 'Available institutions' => $inst_options))->setAttrib('class', 'input-xlarge selectpicker show-menu-arrow');
$canRecord = $this->addElement('checkbox', 'canRecord', array('label' => 'Allowed to record: '))->canRecord;
$role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
$role->addMultiOptions(array(null => 'Choose a role', 'Available roles' => $role_options))->setAttrib('class', 'input-medium selectpicker show-menu-arrow');
$person = $this->addElement('text', 'person', array('label' => 'Personal details attached: '))->person;
$peopleID = $this->addElement('hidden', 'peopleID', array())->peopleID;
$submit = new Zend_Form_Element_Submit('submit');
$this->addElement($submit);
$this->addDisplayGroup(array('username', 'first_name', 'last_name', 'fullname', 'preferred_name', 'email', 'institution', 'role', 'password', 'person', 'peopleID', 'canRecord'), 'userdetails');
$this->addDisplayGroup(array('submit'), 'buttons');
$this->setLegend('Edit account details: ');
parent::init();
}
示例9: __construct
public function __construct($options = null)
{
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
$periods = new Periods();
$period_options = $periods->getPeriodFrom();
parent::__construct($options);
$this->setName('suggested');
$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')));
$level = new Zend_Form_Element_Select('level');
$level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array('Please choose a level' => NULL, 'Research levels' => $projectype_list))->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
$period = new Zend_Form_Element_Select('period');
$period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array('Please choose a period' => NULL, 'Periods available' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators);
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Choose title for the project.')->setDecorators($decorators);
$description = $this->addElement('Textarea', 'description', array('label' => 'Short description of project: '));
$description = $this->getElement('description')->setRequired(false)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->setAttribs(array('cols' => 80, 'rows' => 10))->addDecorator('HtmlTag', array('tag' => 'li'));
$valid = new Zend_Form_Element_Checkbox('taken');
$valid->setLabel('Is the topic taken: ')->setRequired(true)->setDecorators($decorators)->addValidator('Int');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submit')->removeDecorator('label')->removeDecorator('HtmlTag')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper');
$this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
$this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), 'details')->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
$this->addDisplayGroup(array('submit'), 'submit');
}
示例10: __construct
/** 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();
}
示例11: __construct
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');
}
示例12: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('enctype', 'multipart/form-data');
$this->setName('AddRulerImage');
$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')));
$image = new Zend_Form_Element_File('image');
$image->setLabel('Upload an image: ')->setRequired(true)->setDestination('./images/rulers/')->addValidator('Size', false, 2097152)->addValidator('Extension', false, 'jpeg,tif,jpg,png,gif,JPG,TIFF')->setMaxFileSize(1024000)->setAttribs(array('class' => 'textInput'))->addValidator('Count', false, array('min' => 1, 'max' => 1))->addDecorator('File');
$caption = new Zend_Form_Element_Text('caption');
$caption->setLabel('Image caption')->setRequired(true)->setAttrib('size', 60)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a label');
$rulerID = new Zend_Form_Element_Hidden('rulerID');
$rulerID->removeDecorator('label')->removeDecorator('HtmlTag')->addValidator('Int')->setRequired(true);
$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 button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Upload an image of a ruler')->setAttribs(array('class' => 'large'));
$this->addElements(array($image, $rulerID, $caption, $submit))->setLegend('Add an image to a ruler profile');
$this->addDisplayGroup(array('image', 'caption'), 'details')->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
$this->addDisplayGroup(array('submit'), 'submit');
$this->submit->removeDecorator('DtDdWrapper');
$this->submit->removeDecorator('HtmlTag');
}
示例13: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$periods = new Periods();
$period_options = $periods->getPeriodFromWords();
$counties = new OsCounties();
$counties_options = $counties->getCountiesID();
parent::__construct($options);
$this->setName('whatwherewhen');
$old_findID = new Zend_Form_Element_Text('old_findID');
$old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!');
//Objecttype - autocomplete from thesaurus
$objecttype = new Zend_Form_Element_Text('objecttype');
$objecttype->setLabel('What: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!');
$broadperiod = new Zend_Form_Element_Select('broadperiod');
$broadperiod->setLabel('When: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period from', 'Available periods' => $period_options))->addValidator('InArray', false, array($period_options));
$county = new Zend_Form_Element_Select('county');
$county->setLabel('Where: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose county', 'Available counties' => $counties_options))->addValidator('InArray', false, array($counties_options));
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Search!');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(4800);
$this->addElements(array($old_findID, $objecttype, $county, $broadperiod, $submit, $hash));
$this->addDisplayGroup(array('old_findID', 'objecttype', 'broadperiod', 'county', 'submit'), 'Search');
$this->Search->setLegend('What/Where/When search');
parent::init();
}
示例14: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('MintToRuler');
$reverseID = new Zend_Form_Element_Select('reverseID');
$reverseID->setLabel('Reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setAttribs(array('class' => 'textInput'));
$rulerID = new Zend_Form_Element_Hidden('rulerID');
$rulerID->removeDecorator('label')->removeDecorator('HtmlTag')->addValidator('Int');
$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 button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Add a reverse type for this ruler')->setAttribs(array('class' => 'large'));
$this->addElements(array($reverseID, $rulerID, $submit));
$this->addDisplayGroup(array('reverseID'), 'details')->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
$this->details->setLegend('Add an active Mint');
$this->addDisplayGroup(array('submit'), 'submit');
$this->submit->removeDecorator('DtDdWrapper');
$this->submit->removeDecorator('HtmlTag');
$this->details->setLegend('Add an active reverse type');
}
示例15: __construct
public function __construct($options = null)
{
$periods = new Periods();
$period_options = $periods->getPeriodFromWords();
$counties = new Counties();
$counties_options = $counties->getCountyname2();
parent::__construct($options);
$decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label'), array('HtmlTag', array('tag' => 'li')));
$this->setName('whatwherewhen');
$this->removeDecorator('HtmlTag');
$old_findID = new Zend_Form_Element_Text('old_findID');
$old_findID->setLabel('Find number: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
//Objecttype - autocomplete from thesaurus
$objecttype = new Zend_Form_Element_Text('objecttype');
$objecttype->setLabel('What: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->addErrorMessage('Please enter a valid string!')->setDecorators($decorators);
$broadperiod = new Zend_Form_Element_Select('broadperiod');
$broadperiod->setLabel('When: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $period_options))->addValidator('InArray', false, array($period_options))->setDecorators($decorators);
$county = new Zend_Form_Element_Select('county');
$county->setLabel('Where: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose county' => $counties_options))->addValidator('InArray', false, array($counties_options))->setDecorators($decorators);
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Search!')->setAttribs(array('class' => 'large'))->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
$this->addElements(array($old_findID, $objecttype, $county, $broadperiod, $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('old_findID', 'objecttype', 'broadperiod', 'county', 'submit'), 'Search');
$this->Search->removeDecorator('DtDdWrapper');
$this->Search->removeDecorator('HtmlTag');
$this->Search->addDecorators(array(array('HtmlTag', array('tag' => 'ul', 'id' => 'www'))))->setLegend('What/Where/When search')->addDecorator('FieldSet');
}