Beispiel #1
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $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('quotes');
     $quote = new Pas_Form_Element_RTE('quote');
     $quote->setLabel('Quote or announcement: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Basic')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $quotedBy = new Zend_Form_Element_Text('quotedBy');
     $quotedBy->setLabel('Origin of quote/announcement: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please state where this comes from.');
     $expire = new Zend_Form_Element_Text('expire');
     $expire->setLabel('Expires from use: ')->setRequired(true)->setAttrib('size', 10)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please provide expiry date.')->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('status');
     $valid->setLabel('Quote/Announcement is in use: ')->setRequired(true)->addValidator('Int')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setValue('quote')->addMultiOptions(array(NULL => 'Choose type', 'quote' => 'Quote', 'announcement' => 'Announcement'))->setDecorators($decorators);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(4800);
     $this->addElement($hash);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('HtmlTag');
     $this->addElements(array($quote, $quotedBy, $valid, $expire, $type, $submit));
     $this->addDisplayGroup(array('quote', 'quotedBy', 'status', 'expire', 'type', 'submit'), 'details');
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
 }
Beispiel #2
0
 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('dynasticDetails');
     $dynasty = new Zend_Form_Element_Text('dynasty');
     $dynasty->setLabel('Dynastic name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('Come on it\'s not that hard, enter a name for this dynasty!')->setDecorators($decorators);
     $date_from = new Zend_Form_Element_Text('date_from');
     $date_from->setLabel('Issued coins from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the start of reign')->setDecorators($decorators);
     $date_to = new Zend_Form_Element_Text('date_to');
     $date_to->setLabel('Issued coins until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the end of reign')->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('You must enter a description')->addDecorator('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this dynasty valid?')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($dynasty, $date_from, $date_to, $description, $valid, $submit));
     $this->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('dynasty', 'date_from', 'date_to', 'description', 'valid', 'submit'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('tag' => '', 'placement' => 'append')), array('Errors', array('placement' => 'append', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('comments');
     $comment_author_IP = new Zend_Form_Element_Hidden('comment_author_IP');
     $comment_author_IP->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setValue($_SERVER['REMOTE_ADDR'])->addValue('Ip');
     $comment_agent = new Zend_Form_Element_Hidden('comment_agent');
     $comment_agent->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setValue($_SERVER['HTTP_USER_AGENT'])->setRequired(false)->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('comment_findID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'))->setDecorators(array(array('ViewHelper'), array('Description', array('tag' => '')), array('Errors'), array('HtmlTag', array('tag' => 'p')), array('Label', array('tag' => ''))));
     $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!')->setDecorators($decorators);
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setDecorators($decorators)->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: ')->setDecorators($decorators)->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_RTE('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');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $approval = new Zend_Form_Element_Radio('comment_approval');
     $approval->setLabel('What would you like to do? ')->addMultiOptions(array('spam' => 'Set as spam', 'ham' => 'Submit ham?', 'approved' => 'Publish it?', 'delete' => 'Delete it?'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $this->addElements(array($comment_author_IP, $comment_agent, $comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $approval, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_approval', 'comment_findID'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 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');
 }
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('accountupgrades');
        $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')));
        $researchOutline = new Pas_Form_Element_RTE('researchOutline');
        $researchOutline->setLabel('Research outline: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('Outline must be present.')->setDescription('Use this textarea to tell us whether you want to become a 
		research level user and why. We would also like to know the probable length of time 
		for this project so that we can inform our research board of progress. 
		We need a good idea as we have to respect privacy of findspots and landowner/finder personal data');
        $reference = $this->addElement('Text', 'reference', array('label' => 'Please provide a referee:', 'size' => '40', 'description' => 'We ask you to provide a referee who can substantiate your request for higher level access. 
		Ideally they will be an archaeologist of good standing.'))->reference;
        $reference->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim');
        $reference->setDecorators($decorators);
        $referenceEmail = $this->addElement('Text', 'referenceEmail', array('label' => 'Please provide an email address for your referee:', 'size' => '40'))->referenceEmail;
        $referenceEmail->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress');
        $referenceEmail->setDecorators($decorators);
        $already = new Zend_Form_Element_Radio('already');
        $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
        //Submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setLabel('Submit request');
        $this->addElements(array($researchOutline, $submit, $already));
        $this->addDisplayGroup(array('researchOutline', 'reference', 'referenceEmail', 'already'), 'details')->removeDecorator('HtmlTag');
        $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
        $this->details->removeDecorator('DtDdWrapper');
        $this->details->removeDecorator('HtmlTag');
        $this->details->setLegend('Details: ');
        $this->addDisplayGroup(array('submit'), 'submit');
    }
Beispiel #6
0
 public function __construct($options = null)
 {
     $landuses = new Landuses();
     $landuse_opts = $landuses->getUsesValid();
     $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')));
     parent::__construct($options);
     $this->setName('Landuse');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Landuse term name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid title for this landuse!')->setDecorators($decorators);
     $oldID = new Zend_Form_Element_Text('oldID');
     $oldID->setLabel('Old landuse type code: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid title for this landuse!')->setDecorators($decorators);
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Description of landuse type: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $belongsto = new Zend_Form_Element_Select('belongsto');
     $belongsto->setLabel('Belongs to landuse type: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL, 'Choose period:' => $landuse_opts))->addValidator('InArray', false, array(array_keys($landuse_opts)))->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Landuse type is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($term, $termdesc, $oldID, $valid, $belongsto, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'oldID', 'belongsto', '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');
 }
Beispiel #7
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $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('workflow');
     $workflowstage = new Zend_Form_Element_Text('workflowstage');
     $workflowstage->setLabel('Work flow stage title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Workflow stage is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('Digits');
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Description of workflow stage: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Basic')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($workflowstage, $valid, $termdesc, $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('workflowstage', 'termdesc', 'valid'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('HER details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 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');
 }
Beispiel #9
0
 public function __construct($options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     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('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')->setDecorators($decorators);
     $fromdate = new Zend_Form_Element_Text('fromdate');
     $fromdate->setLabel('Date period starts: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidators('Digits')->addErrorMessage('You must enter a start date')->setDecorators($decorators);
     $todate = new Zend_Form_Element_Text('todate');
     $todate->setLabel('Date period ends: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidators('Digits')->addErrorMessage('You must enter an end date')->setDecorators($decorators);
     $notes = new Pas_Form_Element_RTE('notes');
     $notes->setLabel('Period notes: ')->setRequired(false)->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')->setDecorators($decorators);
     $parent = new Zend_Form_Element_Select('parent');
     $parent->setLabel('Period belongs to: ')->setRequired(false)->addMultiOptions(array(NULL => NULL, 'Choose period to' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($term, $fromdate, $todate, $valid, $notes, $parent, $submit));
     $this->addDisplayGroup(array('term', 'fromdate', 'todate', 'parent', 'notes', 'valid'), 'details')->removeDecorator('HtmlTag');
     $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->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Period details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     $tribes = new Tribes();
     $tribes_options = $tribes->getTribes();
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('ironageregion');
     $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')));
     $area = new Zend_Form_Element_Text('area');
     $area->setLabel('Area: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter an area name.')->setDecorators($decorators);
     $region = new Zend_Form_Element_Text('region');
     $region->setLabel('Region name: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a region name')->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description: ')->setRequired(true)->setAttrib('rows', 5)->setAttrib('cols', 60)->setAttrib('ToolbarSet', 'Finds')->setAttrib('Height', 250)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $tribe = new Zend_Form_Element_Select('tribe');
     $tribe->setLabel('Associated tribe: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(NULL => NULL, 'Choose a tribe' => $tribes_options))->addValidator('inArray', false, array(array_keys($tribes_options)))->addErrorMessage('You must enter a tribe from the dropdown.')->addValidator('Int')->addErrorMessage('You must enter a tribe.')->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this area valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addErrorMessage('You must set the validity')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($area, $region, $tribe, $valid, $description, $submit));
     $this->addDisplayGroup(array('area', 'region', 'tribe', 'description', 'valid', 'submit'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }
 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: ');
 }
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     $crimes = new CrimeTypes();
     $crimeoptions = $crimes->getTypes();
     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')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $crimeType = new Zend_Form_Element_Select('crimeType');
     $crimeType->setLabel('Crime type: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set crime type or no point entering it!')->addMultiOptions(array(NULL => 'Choose a crime type', 'Valid types' => $crimeoptions))->addValidator('inArray', false, array(array_keys($crimeoptions)))->setDecorators($decorators);
     $subject = new Zend_Form_Element_Text('subject');
     $subject->setLabel('Title: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setAttrib('size', 50)->addErrorMessage('You must enter a subject for this crime');
     $reporterID = new Zend_Form_Element_Hidden('reporterID');
     $reporterID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You do not appear to have chosen a reporter');
     $reporter = new Zend_Form_Element_Text('reporter');
     $reporter->setLabel('Source: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name and address of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportingPerson = new Zend_Form_Element_Text('reportingPerson');
     $reportingPerson->setLabel('Person making the report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setDescription('Name of person providing intelligence.')->addErrorMessage('You must enter a reporter name');
     $reportSubject = new Zend_Form_Element_Text('reportSubject');
     $reportSubject->setLabel('Subject of report: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators)->setDescription('Name of suspect if known.')->addErrorMessage('You must enter a reporter name');
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('inArray', false, array(array_keys($county_options)))->setDecorators($decorators);
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose district after county'));
     $reliability = new Zend_Form_Element_Select('reliability');
     $reliability->setLabel('Source Evaluation: ')->addMultiOptions(array('1' => 'Always reliable', '2' => 'Mostly reliable', '3' => 'Sometimes reliable', '4' => 'Unreliable', '5' => 'Don\'t know'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $intellEvaluation = new Zend_Form_Element_Select('intellEvaluation');
     $intellEvaluation->setLabel('Intelligence Evaluation: ')->addMultiOptions(array('1' => 'Known to be true', '2' => 'Known to be true by the source, but not by the person making the report', '3' => 'Not known, but is corroborated', '4' => 'Cannot be judged', '5' => 'Suspected to be false!'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setDescription('What you know about the intelligence itself.')->setOptions(array('separator' => ''))->setDecorators($decorators);
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setDecorators($decorators)->addMultiOptions(array(NULL => 'Choose parish after district'))->addFilters(array('StripTags', 'StringTrim'));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Associated NGR: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'ValidGridRef'))->setAttrib('maxlength', 16)->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description of crime - Main report: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $subjectDetails = new Pas_Form_Element_RTE('subjectDetails');
     $subjectDetails->setLabel('Subject details: ')->setRequired(false)->setDescription('DOB,address,description,etc if known.')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $evaluation = new Pas_Form_Element_RTE('evaluation');
     $evaluation->setLabel('Offences: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $incidentDate = new ZendX_JQuery_Form_Element_DatePicker('incidentDate');
     $incidentDate->setLabel('Date of incident: ')->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('NotEmpty', 'Date'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $sam = new Zend_Form_Element_Text('sam');
     $sam->setLabel('Associated with scheduled monument: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->setAttrib('size', 35);
     $samID = new Zend_Form_Element_Hidden('samID');
     $samID->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($crimeType, $incidentDate, $samID, $sam, $reporter, $reporterID, $county, $district, $parish, $gridref, $description, $reliability, $evaluation, $subject, $reliability, $intellEvaluation, $subjectDetails, $reportSubject, $reportingPerson, $submit));
     $this->addDisplayGroup(array('subject', 'crimeType', 'description', 'incidentDate', 'evaluation', 'reportingPerson', 'reporter', 'reporterID', 'reliability', 'intellEvaluation', 'reportSubject', 'subjectDetails', 'sam', 'samID', 'gridref', 'county', 'district', 'parish'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Crime details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
 public function __construct($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('acceptupgrades');
     ZendX_JQuery::enableForm($this);
     $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(NULL => NULL, 'Choose type of research' => $projectype_list))->setDecorators($decorators)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('You must set the level of research');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->setAttrib('size', 60)->addErrorMessage('This project needs a title.')->setDecorators($decorators);
     $researchOutline = new Pas_Form_Element_RTE('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('Outline must be present.');
     $reference = new Zend_Form_Element_Text('reference');
     $reference->setLabel('Referee\'s name: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators);
     $referenceEmail = new Zend_Form_Element_Text('referenceEmail');
     $referenceEmail->setLabel('Referee\'s email address: ')->setAttrib('size', 30)->addValidator('EmailAddress')->addFilter('StringToLower')->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators);
     $message = new Pas_Form_Element_RTE('message');
     $message->setLabel('Message to user: '******'rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addErrorMessage('You must enter a message for the user to know they have been approved.');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setAttrib('size', 30)->addFilter('StringTrim')->addFilter('StripTags')->setDecorators($decorators);
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options));
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->setDecorators($decorators);
     $role->addMultiOptions(array(NULL => NULL, 'Choose role' => $role_options));
     $role->removeMultiOption('admin');
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project: ')->setAttrib('size', 12)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilter('StringTrim')->addFilter('StripTags')->addValidator('Date')->setRequired(false)->addErrorMessage('You must enter a valid start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project: ')->addValidator('Date')->addFilter('StringTrim')->addFilter('StripTags')->setJQueryParam('dateFormat', 'yy-mm-dd')->setAttrib('size', 12)->setRequired(false)->addErrorMessage('You must enter a valid end date for this project');
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('emailAddress')->setRequired(true)->addFilter('StringToLower')->addErrorMessage('Please enter a valid address!')->setDecorators($decorators);
     $already = new Zend_Form_Element_Radio('already');
     $already->setLabel('Is your topic already listed on our research register?: ')->addMultiOptions(array(1 => 'Yes it is', 0 => 'No it isn\'t'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
     $insert = new Zend_Form_Element_Checkbox('insert');
     $insert->setLabel('Insert details into research register: ')->setCheckedValue(1)->setDecorators($decorators);
     $valid = new Zend_Form_Element_Radio('higherLevel');
     $valid->setLabel('Approve?: ')->addMultiOptions(array(1 => 'Unauthorised', 0 => 'Authorised'))->setRequired(true)->setOptions(array('separator' => ''))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($reference, $referenceEmail, $researchOutline, $startDate, $endDate, $fullname, $valid, $level, $title, $submit, $already, $insert, $message));
     $this->addDisplayGroup(array('fullname', 'username', 'email', 'institution', 'level', 'role', 'reference', 'referenceEmail', 'message', 'researchOutline', 'title', 'startDate', 'endDate', 'already', 'higherLevel', 'insert'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Beispiel #14
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');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $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('SimpleInput');
     $decoratorSelect = array('SelectInput');
     $decorators = array(array('ViewHelper'), array('Description', array('tag' => '', 'placement' => 'append')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->setName('comments');
     $comment_author_IP = new Zend_Form_Element_Hidden('user_ip');
     $comment_author_IP->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->addValidator('Ip')->setValue($_SERVER['REMOTE_ADDR']);
     $comment_agent = new Zend_Form_Element_Hidden('user_agent');
     $comment_agent->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->addFilters(array('StripTags', 'StringTrim'))->setValue($_SERVER['HTTP_USER_AGENT'])->setRequired(true);
     $comment_subject = new Zend_Form_Element_Hidden('comment_subject');
     $comment_subject->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim'))->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setRequired(true);
     $comment_findID = new Zend_Form_Element_Hidden('comment_findID');
     $comment_findID->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidators(array('Int'))->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label');
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid name!')->setDecorators($decorators);
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setDecorators($decorators)->setRequired(true)->setAttrib('size', 40)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress')->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public');
     $comment_type = new Zend_Form_Element_Select('comment_type');
     $comment_type->setLabel('Error type: ')->setRequired(true)->setDecorators($decorators)->addMultiOptions(array(NULL => NULL, 'Choose error type' => array('Incorrect ID' => 'Incorrect identification', 'More info' => 'I have further information', 'Incorrect image' => 'Incorrect image', 'Incorrect parish' => 'Incorrect parish', 'Grid reference issues' => 'Grid reference wrong', 'Date found wrong' => 'Date of discovery wrong', 'Spelling errors' => 'Spelling errors', 'Duplicated record' => 'Duplicated record', 'Data problems apparent' => 'Data problems', 'Other' => 'Other reason')))->addErrorMessage('You must enter an error report type');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->setDecorators($decorators)->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_RTE('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->addFilter('StringTrim')->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Basic')->addFilter('StringTrim')->addFilter('WordChars')->addFilter('HtmlBody')->addFilter('EmptyParagraph')->addErrorMessage('Please enter something in the comments box!');
     $config = Zend_registry::get('config');
     $privateKey = $config->recaptcha->privatekey;
     $pubKey = $config->recaptcha->pubkey;
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'label' => 'Prove you are not a robot you varmint!', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'privKey' => $privateKey, 'pubKey' => $pubKey, 'theme' => 'clean')));
     $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')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->addElements(array($comment_findID, $comment_author_IP, $comment_agent, $comment_subject, $comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_type, $captcha, $submit));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_type', 'comment_content', 'captcha', 'submit'), 'details');
     } else {
         $this->addElements(array($comment_findID, $comment_subject, $comment_author_IP, $comment_agent, $comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_type, $submit));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_type', 'comment_content', 'submit'), 'details');
     }
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Enter your error report: ');
 }
Beispiel #16
0
 public function __construct($options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     $eventtypes = new EventTypes();
     $event_options = $eventtypes->getTypes();
     $orgs = array('PAS' => 'The Portable Antiquities Scheme', 'BM' => 'The British Museum', 'MLA' => 'MLA', 'HLF' => 'Heritage Lottery Fund', 'IFA' => 'Institute of Archaeology', 'CBA' => 'Council for British Archaeology', 'ARCH' => 'Current Archaeology', 'AF' => 'The Art Fund', 'LOC' => 'Local museum', 'NADFAS' => 'NADFAS', 'CASPAR' => 'CASPAR');
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $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('event');
     $eventTitle = new Zend_Form_Element_Text('eventTitle');
     $eventTitle->setLabel('Event title: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 70)->setDecorators($decorators);
     $eventDescription = new Pas_Form_Element_RTE('eventDescription');
     $eventDescription->setLabel('Event description: ')->setRequired(true)->addFilters('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds');
     $address = new Zend_Form_Element_Text('eventLocation');
     $address->setLabel('Address: ')->setRequired(true)->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $eventStartTime = new Zend_Form_Element_Text('eventStartTime');
     $eventStartTime->setLabel('Event start time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->setDecorators($decorators);
     $eventEndTime = new Zend_Form_Element_Text('eventEndTime');
     $eventEndTime->setLabel('Event end time: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator(new Zend_Validate_Date('H:i:s'))->setDecorators($decorators);
     $eventStartDate = new ZendX_JQuery_Form_Element_DatePicker('eventStartDate');
     $eventStartDate->setLabel('Event start date: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $eventEndDate = new ZendX_JQuery_Form_Element_DatePicker('eventEndDate');
     $eventEndDate->setLabel('Event end date: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $eventRegion = new Zend_Form_Element_Select('eventRegion');
     $eventRegion->setLabel('Organising section: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($staffregions_options)))->addMultiOptions($staffregions_options)->setDecorators($decorators);
     $eventType = new Zend_Form_Element_Select('eventType');
     $eventType->setLabel('Type of event: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($event_options)))->addMultiOptions($event_options)->setDecorators($decorators);
     $adultsAttend = new Zend_Form_Element_Text('adultsAttend');
     $adultsAttend->setLabel('Adults attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     $childrenAttend = new Zend_Form_Element_Text('childrenAttend');
     $childrenAttend->setLabel('Children attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->setDecorators($decorators);
     $organisation = new Zend_Form_Element_Select('organisation');
     $organisation->setLabel('Organised by: ')->setRequired(false)->setValue('PAS')->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(NULL => 'Choose an organisation', 'Available institutions' => array($orgs)))->addValidator('InArray', false, array(array_keys($orgs)))->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(60);
     $this->addElement($hash);
     $this->addElements(array($eventTitle, $eventDescription, $eventStartTime, $eventEndTime, $eventStartDate, $eventEndDate, $organisation, $childrenAttend, $eventRegion, $adultsAttend, $address, $eventType, $submit));
     $this->addDisplayGroup(array('eventTitle', 'eventDescription', 'eventLocation', 'eventStartTime', 'eventEndTime', 'eventStartDate', 'eventEndDate', 'eventRegion', 'organisation', 'childrenAttend', 'adultsAttend', 'eventType'), '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');
 }
Beispiel #17
0
 public function __construct($options = null)
 {
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $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->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setName('addcontent');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Content Title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addValidator('NotEmpty')->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $menuTitle = new Zend_Form_Element_Text('menuTitle');
     $menuTitle->setLabel('Menu Title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addValidator('NotEmpty')->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $author = new Zend_Form_Element_Select('author');
     $author->setLabel('Set the author of the article: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('You must choose an author')->setDecorators($decorators);
     $excerpt = new Zend_Form_Element_Textarea('excerpt');
     $excerpt->setLabel('Optional excerpt: ')->setRequired(false)->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StripTags', 'StringTrim'));
     $body = new Pas_Form_Element_RTE('body');
     $body->setLabel('Main body of text: ')->setRequired(true)->setAttrib('rows', 30)->setAttrib('cols', 60)->addErrorMessage('You must enter a main body of text')->addFilter('HtmlBody')->setAttrib('Height', 400)->addFilter('EmptyParagraph')->addFilter('StringTrim')->addFilter('WordChars');
     $section = new Zend_Form_Element_Select('section');
     $section->setLabel('Set site section to appear under: ')->addMultiOptions(array('index' => 'Home page', 'info' => 'Site information', 'staffs' => 'Staffordshire Hoard Symposium', 'getinvolved' => 'Get involved', 'frg' => 'Voluntary recording guide', 'byzantinecoins' => 'Byzantine coin guide', 'greekromancoins' => 'Greek and Roman coin guide', 'conservation' => 'Conservation pages', 'news' => 'News', 'reviews' => 'Scheme reviews', 'reports' => 'Annual reports', 'treports' => 'Treasure annual reports', 'romancoins' => 'Roman coin guide', 'ironagecoins' => 'Iron Age coin guide', 'earlymedievalcoins' => 'Early Medieval coin guide', 'medievalcoins' => 'Medieval coin guide', 'postmedievalcoins' => 'Post Medieval coin guide', 'research' => 'Research', 'api' => 'Applications Programming Interface', 'databasehelp' => 'Database help', 'events' => 'Events', 'treasure' => 'Treasure', 'help' => 'Help section', 'publications' => 'Publications', 'database' => 'Database front page', 'oai' => 'OAI instructions', 'bronzeage' => 'Bronze Age guide'))->setDecorators($decorators)->setRequired(true)->addErrorMessage('You must choose a section for this to be filed under');
     $parentcontent = new Zend_Form_Element_Select('parent');
     $parentcontent->setLabel('Does this have a parent?: ')->setDecorators($decorators)->setRequired(false);
     $metaKeywords = new Zend_Form_Element_Textarea('metaKeywords');
     $metaKeywords->setLabel('Meta keywords: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $metaDescription = new Zend_Form_Element_Textarea('metaDescription');
     $metaDescription->setLabel('Meta description: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publishing status: ')->addMultiOptions(array('Please choose publish state' => array('1' => 'Draft', '2' => 'Admin to review', '3' => 'Published')))->setValue(1)->setDecorators($decorators)->setRequired(true);
     $slug = new Zend_Form_Element_Text('slug');
     $slug->setLabel('Page slug: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilter('UrlSlug')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $frontPage = new Zend_Form_Element_Checkbox('frontPage');
     $frontPage->setLabel('Appear on section\'s front page?: ')->setDecorators($decorators)->addValidator('NotEmpty', 'Integer')->setRequired(true);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large');
     $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($title, $author, $body, $section, $publishState, $excerpt, $metaKeywords, $metaDescription, $slug, $frontPage, $submit, $menuTitle));
     $this->addDisplayGroup(array('title', 'menuTitle', 'author', 'body', 'section', 'publishState', 'excerpt', 'metaKeywords', 'metaDescription', 'slug', 'frontPage'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Add new site content');
 }
Beispiel #18
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('tag' => '', 'placement' => 'append')), array('Errors', array('placement' => 'append', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('comments');
     $comment_author_IP = new Zend_Form_Element_Hidden('comment_author_IP');
     $comment_author_IP->removeDecorator('HtmlTag')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setValue($_SERVER['REMOTE_ADDR'])->addValidator('Ip');
     $comment_agent = new Zend_Form_Element_Hidden('comment_agent');
     $comment_agent->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->removeDecorator('Label')->setValue($_SERVER['HTTP_USER_AGENT'])->setRequired(false);
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid name!')->setDecorators($decorators)->setDescription('If you are offering us SEO services, you will be added to the akismet spam list.');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setDecorators($decorators)->setRequired(true)->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->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: ')->setDecorators($decorators)->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid address!')->setDescription('Not compulsory');
     $comment_content = new Pas_Form_Element_RTE('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Please enter something in the comments box!');
     $privateKey = $this->_config->webservice->recaptcha->privatekey;
     $pubKey = $this->_config->webservice->recaptcha->pubkey;
     $captcha = new Zend_Form_Element_Captcha('captcha', array('captcha' => 'ReCaptcha', 'label' => 'Please fill in this reCaptcha to prove human life exists at your end!', 'captchaOptions' => array('captcha' => 'ReCaptcha', 'privKey' => $privateKey, 'pubKey' => $pubKey, 'theme' => 'clean')));
     $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')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large')->setLabel('Submit your query');
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->addElements(array($comment_author_IP, $comment_agent, $comment_author, $comment_author_email, $comment_content, $comment_author_url, $captcha, $submit));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'captcha'), 'details')->removeDecorator('HtmlTag');
         $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
         $this->details->removeDecorator('DtDdWrapper');
         $this->details->removeDecorator('HtmlTag');
         $this->details->setLegend('Enter your comments: ');
     } else {
         $user = $auth->getIdentity();
         $comment_author->setValue($user->fullname);
         $comment_author_email->setValue($user->email);
         $this->addElements(array($comment_author_IP, $comment_agent, $comment_author, $comment_author_email, $comment_content, $comment_author_url, $submit));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content'), 'details')->removeDecorator('HtmlTag');
         $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
         $this->details->removeDecorator('DtDdWrapper');
         $this->details->removeDecorator('HtmlTag');
         $this->details->setLegend('Enter your comments: ');
     }
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setName('ironagetribes');
     $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')));
     $tribe = new Zend_Form_Element_Text('tribe');
     $tribe->setLabel('Tribe name: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a name for the tribe.')->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description of the tribe: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper');
     $this->addElements(array($tribe, $description, $submit));
     $this->addDisplayGroup(array('tribe', 'description', 'submit'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     //Get data to form select menu for periods
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     //Materials menu
     $materials = new Materials();
     $material_options = $materials->getMetals();
     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('denomination');
     $denomination = new Zend_Form_Element_Text('denomination');
     $denomination->setLabel('Denomination name: ')->setRequired(true)->setAttrib('size', 70)->addErrorMessage('Please enter a term.')->setDecorators($decorators);
     //Period from: Assigned via dropdown
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Period assigned to: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($period_options)))->addMultiOptions(array(NULL => NULL, 'Choose period from' => $period_options))->setDecorators($decorators)->addErrorMessage('You must enter a period for this denomination');
     //Primary material
     $material = new Zend_Form_Element_Select('material');
     $material->setLabel('Material: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($material_options)))->addMultiOptions(array(NULL => NULL, 'Choose material' => $material_options))->addErrorMessage('You must enter a material for this denomination.')->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Description: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('You must enter a description for this denomination.');
     $rarity = new Zend_Form_Element_Textarea('rarity');
     $rarity->setLabel('Rarity: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 70)->addFilters(array('BasicHtml', 'EmptyParagraph', 'WordChars'));
     $weight = new Zend_Form_Element_Text('weight');
     $weight->setLabel('Weight: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 5)->setDecorators($decorators);
     $diameter = new Zend_Form_Element_Text('diameter');
     $diameter->setLabel('Diameter: ')->setRequired(false)->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $thickness = new Zend_Form_Element_Text('thickness');
     $thickness->setLabel('Thickness: ')->setRequired(false)->setAttrib('size', 5)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Denomination in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set a status')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($denomination, $period, $material, $description, $weight, $rarity, $thickness, $diameter, $valid, $submit));
     $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->addDisplayGroup(array('denomination', 'period', 'material', 'description', 'rarity', 'thickness', 'diameter', 'weight', '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('Denomination details: ');
 }
Beispiel #21
0
 public function __construct($options = null)
 {
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $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->setAttrib('enctype', 'multipart/form-data');
     $this->setDecorators(array('FormElements', 'Form'));
     $this->setName('help');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Content Title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 60)->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $menuTitle = new Zend_Form_Element_Text('menuTitle');
     $menuTitle->setLabel('Menu Title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 60)->addErrorMessage('You must enter a title')->setDecorators($decorators);
     $author = new Zend_Form_Element_Select('author');
     $author->setLabel('Set the author of the article: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose an author')->setDecorators($decorators);
     $excerpt = new Zend_Form_Element_Textarea('excerpt');
     $excerpt->setLabel('Optional excerpt: ')->setRequired(false)->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StringTrim', 'StripTags'));
     $body = new Pas_Form_Element_RTE('body');
     $body->setLabel('Main body of text: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $section = new Zend_Form_Element_Select('section');
     $section->setLabel('Set site section to appear under: ')->addMultiOptions(array('databasehelp' => 'Database help', 'help' => 'Site help'))->setDecorators($decorators)->setRequired(true)->addErrorMessage('You must choose a section for this to be filed under');
     $parentcontent = new Zend_Form_Element_Select('parent');
     $parentcontent->setLabel('Does this have a parent?: ')->setDecorators($decorators)->setRequired(false)->addFilters(array('StringTrim', 'StripTags'));
     $metaKeywords = new Zend_Form_Element_Textarea('metaKeywords');
     $metaKeywords->setLabel('Meta keywords: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StringTrim', 'StripTags'))->setRequired(true);
     $metaDescription = new Zend_Form_Element_Textarea('metaDescription');
     $metaDescription->setLabel('Meta description: ')->setAttrib('rows', 5)->setAttrib('cols', 60)->addFilters(array('StringTrim', 'StripTags'))->setRequired(true);
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publishing status: ')->addMultiOptions(array('Please choose publish state' => array('1' => 'Draft', '2' => 'Admin to review', '3' => 'Published')))->setValue(1)->setDecorators($decorators)->setRequired(true)->addFilters(array('StringTrim', 'StripTags'));
     $slug = new Zend_Form_Element_Text('slug');
     $slug->setLabel('Page slug: ')->setAttrib('size', 50)->setDecorators($decorators)->addFilters(array('StringTrim', 'StripTags', 'UlSlug'))->setRequired(true);
     $frontPage = new Zend_Form_Element_Checkbox('frontPage');
     $frontPage->setLabel('Appear on section\'s front page?: ')->setDecorators($decorators)->setRequired(true)->addFilters(array('StringTrim', 'StripTags'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large');
     $submit->removeDecorator('DtDdWrapper');
     $submit->removeDecorator('HtmlTag');
     $this->addElements(array($title, $author, $body, $section, $publishState, $excerpt, $metaKeywords, $metaDescription, $slug, $frontPage, $submit, $menuTitle));
     $this->addDisplayGroup(array('title', 'menuTitle', 'author', 'body', 'section', 'publishState', 'excerpt', 'metaKeywords', 'metaDescription', 'slug', 'frontPage'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('submit'), 'submit')->removeDecorator('HtmlTag');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
     $this->details->setLegend('Add new site content');
 }
Beispiel #22
0
 public function __construct($options = null)
 {
     $counties = new Counties();
     $county_options = $counties->getCountyName2();
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error')), array('Label'), array('HtmlTag', array('tag' => 'li')));
     $this->setName('rally');
     $rally_name = new Zend_Form_Element_Text('rally_name');
     $rally_name->setLabel('Rally name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('Come on it\'s not that hard, enter a name for the rally!')->setDecorators($decorators);
     $organisername = new Zend_Form_Element_Text('organisername');
     $organisername->setLabel('Rally Organiser: ')->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators);
     $organiser = new Zend_Form_Element_Hidden('organiser');
     $organiser->removeDecorator('Label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->addFilters(array('StripTags', 'StringTrim'));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('County: ')->addMultiOptions(array(NULL => 'Choose a county', 'Valid counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)))->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $district = new Zend_Form_Element_Select('district');
     $district->setLabel('District: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose district after county'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $parish = new Zend_Form_Element_Select('parish');
     $parish->setLabel('Parish: ')->setRegisterInArrayValidator(false)->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => 'Choose parish after district'))->addValidator('Alpha', false, array('allowWhiteSpace' => true));
     $gridref = new Zend_Form_Element_Text('gridref');
     $gridref->setLabel('Centred on field at NGR: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('maxlength', 16)->setDecorators($decorators)->addValidators(array('NotEmpty', 'ValidGridRef'));
     $record_method = new Pas_Form_Element_RTE('record_method');
     $record_method->setLabel('Recording methodology employed: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments on rally: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 80)->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     //Date found from
     $date_from = new ZendX_JQuery_Form_Element_DatePicker('date_from');
     $date_from->setLabel('Start date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     //Date found to
     $date_to = new ZendX_JQuery_Form_Element_DatePicker('date_to');
     $date_to->setLabel('End date of rally: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Date')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($rally_name, $date_from, $date_to, $organiser, $organisername, $county, $district, $parish, $gridref, $comments, $record_method, $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('rally_name', 'comments', 'record_method', 'date_from', 'date_to', 'organiser', 'organisername', 'county', 'district', 'parish', 'gridref'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Rally details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Beispiel #23
0
 public function __construct($options = null)
 {
     parent::__construct($options);
     ZendX_JQuery::enableForm($this);
     $this->setName('newsstory');
     $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')));
     $date = Zend_Date::now()->toString('yyyy-MM-dd');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('News story title: ')->setRequired(false)->setAttrib('size', 60)->addErrorMessage('Please enter a title for this story.')->setDecorators($decorators);
     $summary = new Zend_Form_Element_Textarea('summary');
     $summary->setLabel('Short summary: ')->setRequired(true)->setAttrib('rows', 5)->setAttrib('cols', 70)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contents = new Pas_Form_Element_RTE('contents');
     $contents->setLabel('News story content: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $address = new Zend_Form_Element_Text('primaryNewsLocation');
     $address->setLabel('News address (puts it on map): ')->setRequired(true)->setAttrib('size', 50)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $author = new Zend_Form_Element_Text('author');
     $author->setLabel('Principal author: ')->setRequired(true)->setAttrib('size', 60)->addErrorMessage('Please enter a title for this story.')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contactEmail = new Zend_Form_Element_Text('contactEmail');
     $contactEmail->setLabel('Contact email address: ')->setRequired(false)->setAttrib('size', 50)->addErrorMessage('Please enter a valid email.')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress')->setDecorators($decorators);
     $contactName = new Zend_Form_Element_Text('contactName');
     $contactName->setLabel('Contact name: ')->setRequired(false)->setAttrib('size', 50)->addErrorMessage('Please enter a title for this story.')->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $contactTel = new Zend_Form_Element_Text('contactTel');
     $contactTel->setLabel('Contact telephone number: ')->addFilters(array('StripTags', 'StringTrim'))->setRequired(false)->addErrorMessage('Please enter a valid telephone number.')->setDecorators($decorators)->addValidator('Alnum', false, array('allowWhiteSpace' => true));
     $keywords = new Zend_Form_Element_Text('keywords');
     $keywords->setLabel('Keywords for the story: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 50)->addErrorMessage('Please enter a valid tags.')->setDecorators($decorators);
     $golive = new ZendX_JQuery_Form_Element_DatePicker('golive');
     $golive->setLabel('News story to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 20)->removeDecorator('DtDdWrapper')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'));
     $publishstate = new Zend_Form_Element_Radio('publish_state');
     $publishstate->setLabel('Publication state: ')->addMultiOptions(array('0' => 'Draft', '1' => 'Publish'))->setValue(1)->addFilters(array('StripTags', 'StringTrim'))->setOptions(array('separator' => ''))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($title, $summary, $contents, $author, $contactEmail, $contactTel, $contactName, $keywords, $address, $golive, $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('title', 'summary', 'contents', 'author', 'contactName', 'contactTel', 'contactEmail', 'primaryNewsLocation', 'keywords', 'golive', 'publish_state'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Story details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
Beispiel #24
0
 public function __construct($options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $decorator = array('SimpleInput');
     $decoratorSelect = array('SelectInput');
     $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('vacancies');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60)->setDecorators($decorators);
     $salary = new Zend_Form_Element_Text('salary');
     $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addValidator('Currency')->addErrorMessage('You must enter a salary.')->setDecorators($decorators);
     $specification = new Pas_Form_Element_RTE('specification');
     $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->setAttrib('ToolbarSet', 'Basic')->addErrorMessage('You must enter a job description.');
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('Location of role: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(NULL => NULL, 'Choose region' => $staffregions_options))->setDecorators($decorators)->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'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $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'))->addValidator('Date')->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20)->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'li'))->removeDecorator('DtDdWrapper');
     $status = new Zend_Form_Element_Select('status');
     $status->SetLabel('Publish status: ')->setRequired(true)->addMultiOptions(array(NULL => 'Choose a status', '2' => 'Publish', '1' => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->setDecorators($decorators)->addErrorMessage('You must choose a status');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->setAttrib('class', 'large');
     $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $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('DtDdWrapper');
     $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
     $this->details->setLegend('Vacancy details');
     $this->details->removeDecorator('DtDdWrapper');
     $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
     $this->dates->setLegend('Publication details');
     $this->dates->removeDecorator('DtDdWrapper');
     $this->setLegend('Vacancy details');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Beispiel #25
0
 public function __construct($options = null)
 {
     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')));
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Activity title: ')->setRequired(true)->addFilter('StringTrim')->addFilter('StripTags')->addErrorMessage('Choose title for the activity.')->setAttrib('size', 70)->setDecorators($decorators);
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Activity description: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('StringTrim')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars')->addDecorator('HtmlTag', array('tag' => 'li'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ')->setRequired(false)->addValidator('NotEmpty', 'boolean')->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($term, $termdesc, $valid, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid', 'submit'), 'details')->removeDecorator('HtmlTag');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->details->setLegend('Primary activity details: ');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setName('institution');
     $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')));
     $institution = new Zend_Form_Element_Text('institution');
     $institution->setLabel('Recording institution title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Choose title for the role.')->setDecorators($decorators);
     $description = new Pas_Form_Element_RTE('description');
     $description->setLabel('Role description: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addDecorator('HtmlTag', array('tag' => 'li'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $this->addElements(array($institution, $description, $submit));
     $this->addDisplayGroup(array('institution', 'description'), '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');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $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('preservations');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Title for preservation state: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid title for the state!')->setDecorators($decorators);
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Description of preservation state: ')->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('Is this term valid?: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('Digits');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('Label');
     $this->addElements(array($term, $termdesc, $valid, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details');
     $this->details->setLegend('Preservation state details: ');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 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('surfmethods');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Decoration style term: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alpha', true, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid title for this surface treatment')->setDecorators($decorators);
     $termdesc = new Pas_Form_Element_RTE('termdesc');
     $termdesc->setLabel('Description of decoration style: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 80))->addFilter(array('BasicHtml', 'EmptyParagraph', 'StringTrim', 'WordChars'))->addErrorMessage('You must enter a description for this surface treatment');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Termis currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set a status for this treatment term')->setDecorators($decorators);
     $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, $hash));
     $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->details->setLegend('Surface treatment details: ');
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->submit->removeDecorator('DtDdWrapper');
     $this->submit->removeDecorator('HtmlTag');
 }
 public function __construct($options = null)
 {
     parent::__construct($options);
     $decorators = array(array('ViewHelper'), array('Description', array('tag' => '', 'placement' => 'append')), array('Errors', array('placement' => 'append', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *')), array('HtmlTag', array('tag' => 'li')));
     $this->setName('comments');
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid name!')->setDecorators($decorators);
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setDecorators($decorators)->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress')->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_content = new Pas_Form_Element_RTE('comment_content');
     $comment_content->setLabel('Message submitted by user: '******'rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $messagetext = new Pas_Form_Element_RTE('messagetext');
     $messagetext->setLabel('Your reply: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton')->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('DtDdWrapper')->setAttrib('class', 'large');
     $this->addElements(array($comment_author, $comment_author_email, $comment_content, $messagetext, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'messagetext'), 'details');
     $this->details->addDecorators(array('FormElements', array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'submit');
 }
Beispiel #30
0
 public function __construct($options = null)
 {
     $reeces = new Reeces();
     $reeces_options = $reeces->getOptions();
     $rulers = new Rulers();
     $rulers_options = $rulers->getOptions();
     $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('EmperorDetails');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Emperor\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Come on it\'s not that hard, enter a firstname!')->setDecorators($decorators);
     $reeceID = new Zend_Form_Element_Select('reeceID');
     $reeceID->setLabel('Reece period assigned: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addMultiOptions(array(NULL => NULL, 'Choose a Reece period' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->addValidator('Int')->setDecorators($decorators);
     $pasID = new Zend_Form_Element_Select('pasID');
     $pasID->setLabel('Database ID: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(NULL => NULL, 'Choose a database id' => $rulers_options))->addValidator('Int')->addErrorMessage('You must assign the bio to an existing entry')->setDecorators($decorators);
     $date_from = new Zend_Form_Element_Text('date_from');
     $date_from->setLabel('Issued coins from: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the start of reign')->setDecorators($decorators);
     $date_to = new Zend_Form_Element_Text('date_to');
     $date_to->setLabel('Issued coins until: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a date for the end of reign')->setDecorators($decorators);
     $biography = new Pas_Form_Element_RTE('biography');
     $biography->setLabel('Biography: ')->setRequired(true)->addFilters('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography')->addDecorator('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li'));
     $dynasty = new Zend_Form_Element_Select('dynasty');
     $dynasty->setLabel('Dynastic grouping: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($dynasties_options)))->addMultiOptions(array(NULL => NULL, 'Choose a dynasty' => $dynasties_options))->addErrorMessage('You must select a dynastic grouping')->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submit')->setAttrib('class', 'large')->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addElements(array($name, $reeceID, $pasID, $date_from, $date_to, $biography, $dynasty, $submit));
     $this->addDisplayGroup(array('name', 'reeceID', 'pasID', 'date_from', 'date_to', 'biography', 'dynasty', 'submit'), 'details');
     $this->details->addDecorators(array(array('HtmlTag', array('tag' => 'ul'))));
     $this->details->removeDecorator('HtmlTag');
     $this->details->removeDecorator('DtDdWrapper');
     $this->details->removeDecorator('HtmlTag');
 }