本文整理汇总了PHP中Zend_Form_Element_Hash::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Hash::setValue方法的具体用法?PHP Zend_Form_Element_Hash::setValue怎么用?PHP Zend_Form_Element_Hash::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Hash
的用法示例。
在下文中一共展示了Zend_Form_Element_Hash::setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($options = null)
{
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('reeceperiods');
$period_name = new Zend_Form_Element_Text('period_name');
$period_name->setLabel('Reece Period name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('You must enter a period name')->setDecorators($decorators);
$description = new Zend_Form_Element_Textarea('description');
$description->setLabel('Description of period: ')->setRequired(true)->setAttrib('cols', 70)->setAttrib('rows', 20)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'))->addErrorMessage('You must enter a description');
$date_range = new Zend_Form_Element_Text('date_range');
$date_range->setLabel('Date range of period: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date range for this period')->setDecorators($decorators);
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
$this->addElements(array($period_name, $description, $date_range, $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->removeDecorator('HtmlTag');
$this->addDisplayGroup(array('period_name', 'description', 'date_range', 'submit'), 'details');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->setLegend('Reece Periods');
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
}
示例2: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
parent::__construct($options);
$this->setName('comments');
$commentType = new Zend_Form_Element_Hidden('comment_type');
$commentType->addFilters(array('StripTags', 'StringTrim'));
$comment_findID = new Zend_Form_Element_Hidden('contentID');
$comment_findID->addFilters(array('StripTags', 'StringTrim'));
$comment_author = new Zend_Form_Element_Text('comment_author');
$comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!');
$comment_author_email = new Zend_Form_Element_Text('comment_author_email');
$comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
$comment_author_url = new Zend_Form_Element_Text('comment_author_url');
$comment_author_url->setLabel('Enter your web address: ')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
$comment_content = new Pas_Form_Element_CKEditor('comment_content');
$comment_content->setLabel('Enter your comment: ')->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');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(4800);
$status = new Zend_Form_Element_Radio('commentStatus');
$status->setLabel('Message status:')->addMultiOptions(array('isspam' => 'Set as spam', 'isham' => 'Submit ham?', 'notspam' => 'Spam free'))->setValue('notSpam')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
$commentApproval = new Zend_Form_Element_Radio('comment_approved');
$commentApproval->setLabel('Approval:')->addMultiOptions(array('moderation' => 'Moderation', 'approved' => 'Approved'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
$this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $commentApproval, $commentType, $status, $hash, $submit));
$this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'commentStatus', 'comment_approved', 'contentID', 'comment_type'), 'details');
$this->details->setLegend('Enter your comments: ');
$this->addDisplayGroup(array('submit'), 'buttons');
parent::init();
}
示例3: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$periods = new Periods();
$period_options = $periods->getPeriodFrom();
parent::__construct($options);
$this->setName('period');
$term = new Zend_Form_Element_Text('term');
$term->setLabel('Period name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('You must enter a period name');
$fromdate = new Zend_Form_Element_Text('fromdate');
$fromdate->setLabel('Date period starts: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a start date');
$todate = new Zend_Form_Element_Text('todate');
$todate->setLabel('Date period ends: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter an end date');
$notes = new Pas_Form_Element_CKEditor('notes');
$notes->setLabel('Period notes: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
$valid = new Zend_Form_Element_Checkbox('valid');
$valid->setLabel('Period is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a status');
$parent = new Zend_Form_Element_Select('parent');
$parent->setLabel('Period belongs to: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
$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($term, $fromdate, $todate, $valid, $notes, $parent, $submit, $hash));
$this->addDisplayGroup(array('term', 'fromdate', 'todate', 'parent', 'notes', 'valid'), 'details');
$this->details->setLegend('Period details: ');
$this->addDisplayGroup(array('submit'), 'buttons');
parent::init();
}
示例4: __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');
}
示例5: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
$authors = new Users();
$authorOptions = $authors->getAuthors();
parent::__construct($options);
$this->setName('activity');
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Choose title for the project.');
$description = new Pas_Form_Element_CKEditor('description');
$description->setLabel('Short description of project: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Basic')->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
$length = new Zend_Form_Element_Text('length');
$length->setLabel('Length of project: ')->setAttrib('size', 12)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a duration for this project in months')->addValidator('Digits')->setDescription('Enter length in months');
$managedBy = new Zend_Form_Element_Select('managedBy');
$managedBy->setLabel('Managed by: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($authorOptions)))->addErrorMessage('You must enter a manager for this project.');
$suitableFor = new Zend_Form_Element_Select('suitableFor');
$suitableFor->setLabel('Suitable for: ')->addMultiOptions(array(null => 'Choose type of research', 'Available types' => $projectype_list))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter suitability for this task.');
$location = new Zend_Form_Element_Text('location');
$location->setLabel('Where would this be located?: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location for the task.');
$valid = new Zend_Form_Element_Checkbox('status');
$valid->setLabel('Publish this task? ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
$submit = new Zend_Form_Element_Submit('submit');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(480);
$this->addElements(array($title, $description, $length, $valid, $managedBy, $suitableFor, $location, $submit, $hash));
$this->addDisplayGroup(array('title', 'description', 'length', 'location', 'suitableFor', 'managedBy', 'status', 'submit'), 'details');
$this->details->setLegend('Activity details: ');
parent::init();
}
示例6: __construct
public function __construct($options = null)
{
$refs = new Coinclassifications();
$ref_list = $refs->getClass();
parent::__construct($options);
$this->setName('addcoinreference');
$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')));
$classID = new Zend_Form_Element_Select('classID');
$classID->setLabel('Publication title: ')->setRequired(true)->addMultiOptions(array(NULL => 'Choose reference', 'Valid choices' => $ref_list))->addValidator('InArray', false, array(array_keys($ref_list)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a title')->setDecorators($decorators);
$volume = new Zend_Form_Element_Text('vol_no');
$volume->setLabel('Volume number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 9)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
$reference = new Zend_Form_Element_Text('reference');
$reference->setLabel('Reference number: ')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 15)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
$this->addElements(array($classID, $volume, $reference, $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('classID', 'vol_no', 'reference'), '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 a new reference');
$this->addDisplayGroup(array('submit'), 'submit');
}
示例7: __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');
}
示例8: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
parent::__construct($options);
$roles = new Roles();
$role_options = $roles->getRoles();
$inst = new Institutions();
$inst_options = $inst->getInsts();
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
$this->setName('emailsearch');
ZendX_JQuery::enableForm($this);
$message = new Zend_Form_Element_Textarea('messageToUser');
$message->setLabel('Message to user: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10))->addFilter('BasicHtml')->addErrorMessage('You must enter a message to your recipient.');
$fullname = new Zend_Form_Element_Text('fullname');
$fullname->setLabel('Send this to: ')->addFilters(array('StringTrim', 'StripTags', 'Purifier'))->setAttrib('size', 30);
$email = $this->addElement('text', 'email', array('label' => 'Their email Address', 'size' => '30'))->email;
$email->addValidator('EmailAddress')->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(60);
$this->addElement($hash);
$this->addElements(array($fullname, $submit, $message));
$this->addDisplayGroup(array('fullname', 'email', 'messageToUser'), 'details');
$this->details->setLegend('Details: ');
$this->addDisplayGroup(array('submit'), 'buttons');
parent::init();
}
示例9: __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));
}
示例10: __construct
public function __construct($options = null)
{
parent::__construct($options);
$this->setAttrib('accept-charset', 'UTF-8');
$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')));
$this->setName('dieaxis');
$die_axis_name = new Zend_Form_Element_Text('die_axis_name');
$die_axis_name->setLabel('Die axis term: ')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('Please enter a term.')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
$valid = new Zend_Form_Element_Checkbox('valid');
$valid->setLabel('Die axis term is in use: ')->setRequired(true)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$submit->removeDecorator('DtDdWrapper');
$submit->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($die_axis_name, $valid, $submit));
$this->addDisplayGroup(array('die_axis_name', 'valid'), 'details');
$this->details->setLegend('Die axis details: ');
$this->details->removeDecorator('HtmlTag');
$this->details->removeDecorator('DtDdWrapper');
$this->addDisplayGroup(array('submit'), 'submit');
}
示例11: __construct
public function __construct($options = null)
{
$curators = new Peoples();
$assigned = $curators->getCurators();
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('actionsForTreasure');
$curatorID = new Zend_Form_Element_Select('curatorID');
$curatorID->setLabel('Curator assigned: ')->setRequired(true)->addValidator('InArray', false, array(array_keys($assigned)))->addMultiOptions($assigned)->setDecorators($decorators);
$chaseDate = new ZendX_JQuery_Form_Element_DatePicker('chaseDate');
$chaseDate->setLabel('Chase date assigned: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
$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', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
$this->addElements(array($curatorID, $chaseDate, $submit, $hash));
$this->addDisplayGroup(array('curatorID', 'chaseDate'), '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');
}
示例12: __construct
public function __construct($options = null)
{
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
parent::__construct($options);
$this->setName('activity');
$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')));
$decorators2 = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('HtmlTag', array('tag' => 'li')));
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Choose title for the project.')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
$description = new Zend_Form_Element_Textarea('description');
$description->setLabel('Short description of project: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'))->addDecorator('HtmlTag', array('tag' => 'li'));
$length = new Zend_Form_Element_Text('length');
$length->setLabel('Length of project: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a duration for this project in months')->addValidator('Digits')->setDecorators($decorators);
$managedBy = new Zend_Form_Element_Text('managedBy');
$managedBy->setLabel('Managed by: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a manager for this project.')->setDecorators($decorators);
$suitableFor = new Zend_Form_Element_Select('suitableFor');
$suitableFor->setLabel('Suitable for: ')->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->setRequired(true)->addValidator('InArray', false, array($projectype_list))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter suitability for this task.')->setDecorators($decorators);
$location = new Zend_Form_Element_Text('location');
$location->setLabel('Where would this be located?: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location for the task.')->setDecorators($decorators);
$valid = new Zend_Form_Element_Checkbox('valid');
$valid->setLabel('Publish this task? ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->removeDecorator('HtmlTag');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setDecorators($decorators2);
$this->addElements(array($title, $description, $length, $valid, $managedBy, $suitableFor, $location, $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('title', 'description', 'length', 'location', 'suitableFor', 'managedBy', 'valid', 'submit'), 'details')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'))->removeDecorator('HtmlTag');
$this->details->setLegend('Activity details: ');
$this->details->removeDecorator('DtDdWrapper');
$this->details->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
}
示例13: __construct
/** The constructor
* @access public
* @param array $options
* @return void
*/
public function __construct(array $options = null)
{
$reeces = new Reeces();
$reeces_options = $reeces->getRevTypes();
parent::__construct($options);
$this->setName('reversetype');
$type = new Zend_Form_Element_Text('type');
$type->setLabel('Reverse type inscription: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter an inscription.')->setAttrib('size', 70);
$translation = new Zend_Form_Element_Text('translation');
$translation->setLabel('Translation: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70);
$description = new Zend_Form_Element_Text('description');
$description->setLabel('Description: ')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a translation.')->setAttrib('size', 70);
$gendate = new Zend_Form_Element_Text('gendate');
$gendate->setLabel('General date for reverse type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a general date for this reverse type.')->setAttrib('size', 30);
$reeceID = new Zend_Form_Element_Select('reeceID');
$reeceID->setLabel('Reece period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(null => 'Choose a Reece period', 'Available Reece period' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)));
$common = new Zend_Form_Element_Radio('common');
$common->setLabel('Is this reverse type commonly found: ')->setRequired(false)->addMultiOptions(array('1' => 'Yes', '2' => 'No'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setOptions(array('separator' => ''));
//Submit button
$submit = new Zend_Form_Element_Submit('submit');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_salt)->setTimeout(4800);
$this->addElements(array($type, $gendate, $description, $translation, $reeceID, $common, $submit, $hash));
$this->addDisplayGroup(array('type', 'translation', 'description', 'gendate', 'reeceID', 'common', 'submit'), 'details');
$this->details->setLegend('Reverse type details: ');
$this->details->setLegend('Issuer or ruler details: ');
parent::init();
}
示例14: __construct
public function __construct($options = null)
{
$actionTypes = new TreasureActionTypes();
$actionlist = $actionTypes->getList();
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('actionsForTreasure');
$actionDescription = new Pas_Form_Element_RTE('actionTaken');
$actionDescription->setLabel('Action summary: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400, 'ToolbarSet' => 'Basic'))->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'));
$action = new Zend_Form_Element_Select('actionID');
$action->setLabel('Type of action taken: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($actionlist)))->addMultiOptions($actionlist)->setDecorators($decorators);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton')->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(4800);
$this->addElements(array($action, $actionDescription, $submit, $hash));
$this->addDisplayGroup(array('actionID', 'actionTaken'), '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');
}
示例15: __construct
public function __construct($options = null)
{
$projecttypes = new ProjectTypes();
$projectype_list = $projecttypes->getTypes();
ZendX_JQuery::enableForm($this);
parent::__construct($options);
$this->setName('research');
$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')));
$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.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
$level = new Zend_Form_Element_Select('level');
$level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)))->setDecorators($decorators);
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
$description = $this->addElement('RTE', 'description', array('label' => 'Short description of project: '));
$description = $this->getElement('description')->setRequired(false)->addFilter('stringTrim')->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'))->addDecorator('HtmlTag', array('tag' => 'li'));
$startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
$startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->addValidator('Date')->setRequired(false)->addErrorMessage('You must enter a start date for this project')->setDecorators($decorators);
$endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
$endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addValidator('Date')->addErrorMessage('You must enter an end date for this project')->setDecorators($decorators);
$valid = new Zend_Form_Element_Checkbox('valid');
$valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submit')->removeDecorator('label')->setAttrib('class', 'large')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
$hash = new Zend_Form_Element_Hash('csrf');
$hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
$this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit, $hash));
$this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details')->removeDecorator('HtmlTag');
$this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
$this->details->removeDecorator('DtDdWrapper');
$this->addDisplayGroup(array('submit'), 'submit');
}