Exemplo n.º 1
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('research');
     $investigator = new Zend_Form_Element_Text('investigator');
     $investigator->setLabel('Principal work conducted by: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a lead for this project.');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => null, 'Choose type of research' => $projectype_list))->addValidator('inArray', false, array(array_keys($projectype_list)));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 60)->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
     $startDate = new ZendX_JQuery_Form_Element_DatePicker('startDate');
     $startDate->setLabel('Start date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter a start date for this project');
     $endDate = new ZendX_JQuery_Form_Element_DatePicker('endDate');
     $endDate->setLabel('End date of project')->setAttrib('size', 20)->setJQueryParam('dateFormat', 'yy-mm-dd')->setRequired(false)->addErrorMessage('You must enter an end date for this project');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Make public: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $description, $level, $startDate, $endDate, $valid, $investigator, $submit));
     $this->addDisplayGroup(array('title', 'investigator', 'level', 'description', 'startDate', 'endDate', 'valid'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 2
0
 /** the constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getCoinsPeriod();
     parent::__construct($options);
     $this->setName('moneyers');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Moneyer\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter a moneyer\'s name');
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available Options' => $period_options));
     $date_1 = new Zend_Form_Element_Text('date_1');
     $date_1->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the start of moneyer period');
     $date_2 = new Zend_Form_Element_Text('date_2');
     $date_2->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a date for the end of moneyer period');
     $appear = new Zend_Form_Element_Text('appear');
     $appear->setLabel('Appearance on coins: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $RRC = new Zend_Form_Element_Text('RRC');
     $RRC->setLabel('RRC ID number: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $bio = new Pas_Form_Element_CKEditor('bio');
     $bio->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($period, $name, $date_1, $date_2, $bio, $appear, $RRC, $valid, $submit));
     $this->addDisplayGroup(array('name', 'period', 'date_1', 'date_2', 'appear', 'RRC', 'bio', 'valid', 'submit'), 'details');
     parent::init();
 }
Exemplo n.º 3
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $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!')->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: ')->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: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid address!')->setDescription('Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Please enter something in the comments box!');
     $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' => $this->_privateKey, 'pubKey' => $this->_pubKey, 'theme' => 'clean', 'ssl' => true)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $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, $comment_author_email, $comment_content, $comment_author_url, $captcha, $submit, $hash));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'captcha'), 'details');
         $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, $comment_author_email, $comment_content, $comment_author_url, $submit, $hash));
         $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content'), 'details');
         $this->details->setLegend('Enter your comments: ');
     }
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 4
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('suggested');
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a level', 'Research levels' => $projectype_list))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StringTrim', 'StripTags'));
     $period = new Zend_Form_Element_Select('period');
     $period->setLabel('Broad research period: ')->setRequired(true)->addMultiOptions(array(null => 'Please choose a period', 'Periods available' => $period_options))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StringTrim', 'StripTags'));
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(false)->setAttribs(array('cols' => 80, 'rows' => 10))->addFilters(array('BasicHtml', 'StringTrim', 'EmptyParagraph'));
     $valid = new Zend_Form_Element_Checkbox('taken');
     $valid->setLabel('Is the topic taken: ')->setRequired(true)->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $level, $period, $description, $valid, $submit, $hash));
     $this->addDisplayGroup(array('title', 'level', 'period', 'description', 'taken'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 5
0
 /** The form constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $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);
     $this->setName('EmperorDetails');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Emperor\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter an emperor name!');
     $reeceID = new Zend_Form_Element_Select('reeceID');
     $reeceID->setLabel('Reece period assigned: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a Reece period', 'Available periods' => $reeces_options))->addValidator('InArray', false, array(array_keys($reeces_options)))->addValidator('Int');
     $pasID = new Zend_Form_Element_Select('pasID');
     $pasID->setLabel('Database ID: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(null => 'Choose a database id', 'Available ids' => $rulers_options))->addValidator('Int')->addErrorMessage('You must assign the bio to an existing entry');
     $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');
     $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');
     $biography = new Pas_Form_Element_CKEditor('biography');
     $biography->setLabel('Biography: ')->setRequired(true)->addFilters(array('StringTrim', 'WordChars', 'BasicHtml', 'EmptyParagraph'))->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Finds')->addErrorMessage('You must enter a biography');
     $dynasty = new Zend_Form_Element_Select('dynasty');
     $dynasty->setLabel('Dynastic grouping: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($dynasties_options)))->addMultiOptions(array(null => 'Choose a dynasty', 'Available dynasties' => $dynasties_options))->addErrorMessage('You must select a dynastic grouping');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($name, $reeceID, $pasID, $date_from, $date_to, $biography, $dynasty, $submit, $hash));
     $this->addDisplayGroup(array('name', 'reeceID', 'pasID', 'date_from', 'date_to', 'biography', 'dynasty', 'submit'), 'details');
     parent::init();
 }
Exemplo n.º 6
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $staffregions = new StaffRegions();
     $staffregions_options = $staffregions->getOptions();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('vacancies');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Role title: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a title for this vacancy.')->setAttrib('size', 60);
     $salary = new Zend_Form_Element_Text('salary');
     $salary->setLabel('Salary: ')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->setAttrib('size', 20)->addErrorMessage('You must enter a salary.');
     $specification = new Pas_Form_Element_CKEditor('specification');
     $specification->setLabel('Job specification: ')->setRequired(true)->addFilters(array('BasicHtml', 'StringTrim'))->setAttribs(array('cols' => 50, 'rows' => 10, 'Height' => 400))->addErrorMessage('You must enter a job description.');
     $regionID = new Zend_Form_Element_Select('regionID');
     $regionID->setLabel('Location of role: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addValidator('InArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Choose region', 'Available regions' => $staffregions_options))->addErrorMessage('You must choose a region');
     $live = new ZendX_JQuery_Form_Element_DatePicker('live');
     $live->setLabel('Date for advert to go live: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $expire = new ZendX_JQuery_Form_Element_DatePicker('expire');
     $expire->setLabel('Date for advert to expire: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->setJQueryParam('maxDate', '+1y')->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $status = new Zend_Form_Element_Select('status');
     $status->SetLabel('Publish status: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose a status', 2 => 'Publish', 1 => 'Draft'))->setValue(2)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must choose a status');
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($title, $salary, $specification, $regionID, $live, $expire, $status, $submit, $hash));
     $this->addDisplayGroup(array('title', 'salary', 'specification', 'regionID'), 'details');
     $this->details->setLegend('Vacancy details');
     $this->addDisplayGroup(array('live', 'expire', 'status'), 'dates');
     $this->dates->setLegend('Publication details');
     $this->setLegend('Vacancy details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('comments');
     $commentType = new Zend_Form_Element_Hidden('comment_type');
     $commentType->addFilters(array('StripTags', 'StringTrim'));
     $comment_findID = new Zend_Form_Element_Hidden('contentID');
     $comment_findID->addFilters(array('StripTags', 'StringTrim'));
     $comment_author = new Zend_Form_Element_Text('comment_author');
     $comment_author->setLabel('Enter your name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('Please enter a valid name!');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true))->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_author_url = new Zend_Form_Element_Text('comment_author_url');
     $comment_author_url->setLabel('Enter your web address: ')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addErrorMessage('Please enter a valid address!')->addValidator('Url')->setDescription('* Not compulsory');
     $comment_content = new Pas_Form_Element_CKEditor('comment_content');
     $comment_content->setLabel('Enter your comment: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $status = new Zend_Form_Element_Radio('commentStatus');
     $status->setLabel('Message status:')->addMultiOptions(array('isspam' => 'Set as spam', 'isham' => 'Submit ham?', 'notspam' => 'Spam free'))->setValue('notSpam')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $commentApproval = new Zend_Form_Element_Radio('comment_approved');
     $commentApproval->setLabel('Approval:')->addMultiOptions(array('moderation' => 'Moderation', 'approved' => 'Approved'))->setValue('approved')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setOptions(array('separator' => ''));
     $this->addElements(array($comment_author, $comment_author_email, $comment_content, $comment_author_url, $comment_findID, $commentApproval, $commentType, $status, $hash, $submit));
     $this->addDisplayGroup(array('comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'commentStatus', 'comment_approved', 'contentID', 'comment_type'), 'details');
     $this->details->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 8
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     parent::__construct($options);
     $this->setName('activity');
     $title = new Zend_Form_Element_Text('title');
     $title->setLabel('Project title: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Choose title for the project.');
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Short description of project: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->setAttrib('ToolbarSet', 'Basic')->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim'));
     $length = new Zend_Form_Element_Text('length');
     $length->setLabel('Length of project: ')->setAttrib('size', 12)->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a duration for this project in months')->addValidator('Digits')->setDescription('Enter length in months');
     $managedBy = new Zend_Form_Element_Select('managedBy');
     $managedBy->setLabel('Managed by: ')->addMultiOptions(array('Choose an author' => $authorOptions))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('InArray', false, array(array_keys($authorOptions)))->addErrorMessage('You must enter a manager for this project.');
     $suitableFor = new Zend_Form_Element_Select('suitableFor');
     $suitableFor->setLabel('Suitable for: ')->addMultiOptions(array(null => 'Choose type of research', 'Available types' => $projectype_list))->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($projectype_list)))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter suitability for this task.');
     $location = new Zend_Form_Element_Text('location');
     $location->setLabel('Where would this be located?: ')->setAttrib('size', 12)->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a location for the task.');
     $valid = new Zend_Form_Element_Checkbox('status');
     $valid->setLabel('Publish this task? ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(480);
     $this->addElements(array($title, $description, $length, $valid, $managedBy, $suitableFor, $location, $submit, $hash));
     $this->addDisplayGroup(array('title', 'description', 'length', 'location', 'suitableFor', 'managedBy', 'status', 'submit'), 'details');
     $this->details->setLegend('Activity details: ');
     parent::init();
 }
Exemplo n.º 9
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getPeriodFrom();
     parent::__construct($options);
     $this->setName('period');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Period name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper'))->addValidator('Alpha', false, array('allowWhiteSpace' => true))->setAttrib('size', 60)->addErrorMessage('You must enter a period name');
     $fromdate = new Zend_Form_Element_Text('fromdate');
     $fromdate->setLabel('Date period starts: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a start date');
     $todate = new Zend_Form_Element_Text('todate');
     $todate->setLabel('Date period ends: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter an end date');
     $notes = new Pas_Form_Element_CKEditor('notes');
     $notes->setLabel('Period notes: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Period is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int')->addErrorMessage('You must enter a status');
     $parent = new Zend_Form_Element_Select('parent');
     $parent->setLabel('Period belongs to: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose period to', 'Available periods' => $period_options))->addValidator('InArray', false, array(array_keys($period_options)))->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $fromdate, $todate, $valid, $notes, $parent, $submit, $hash));
     $this->addDisplayGroup(array('term', 'fromdate', 'todate', 'parent', 'notes', 'valid'), 'details');
     $this->details->setLegend('Period details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 10
0
 /** The form constructor
  * @access public
  * @param array $options
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('accountupgrades');
     $researchOutline = new Pas_Form_Element_CKEditor('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setAttribs(array('rows' => 10, 'cols' => 40, 'Height' => 400))->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Outline must be present.')->setDescription('Use this text area 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 find spots 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)->addFilters(array('StripTags', 'StringTrim'));
     $referenceEmail = $this->addElement('Text', 'referenceEmail', array('label' => 'Please provide an email address for your referee:', 'size' => '40'))->referenceEmail;
     $referenceEmail->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('EmailAddress');
     $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' => ''));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Submit request');
     $this->addElements(array($researchOutline, $submit, $already));
     $this->addDisplayGroup(array('researchOutline', 'reference', 'referenceEmail', 'already'), 'details');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 11
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $users = new Users();
     $users_options = $users->getOptions();
     $countries = new Countries();
     $countries_options = $countries->getOptions();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $organisations = new Organisations();
     $organisations_options = $organisations->getOrgs();
     parent::__construct($options);
     $this->setName('people');
     $title = new Zend_Form_Element_Select('title');
     $title->setLabel('Title: ')->addFilters(array('StripTags', 'StringTrim'))->setValue('Mr')->addErrorMessage('Choose title of person')->setAttrib('class', 'span2 selectpicker show-menu-arrow')->addMultiOptions(array('Mr' => 'Mr', 'Mrs' => 'Mrs', 'Miss' => 'Miss', 'Ms' => 'Ms', 'Dr' => 'Dr.', 'Prof' => 'Prof.', 'Sir' => 'Sir', 'Lord' => 'Lord', 'Lady' => 'Lady', 'Other' => 'Other', 'Captain' => 'Captain', 'Master' => 'Master', 'Dame' => 'Dame', 'Duke' => 'Duke', 'Admiral' => 'Admiral', 'Baron' => 'Baron', 'Baroness' => 'Baroness', 'Brigadier' => 'Brigadier', 'Captain' => 'Captain', 'Colonel' => 'Colonel', 'Colonel Sir' => 'Colonel Sir', 'Commander' => 'Commander', 'Commodore' => 'Commodore', 'Countess' => 'Countess', 'Earl' => 'Earl', 'Field Marshal Lord' => 'Field Marshal Lord', 'General' => 'General', 'Group Captain' => 'Group Captain', 'Lieutenant' => 'Lieutenant', 'Lieutenant Commander' => 'Lieutenant Commander', 'Lt-Col' => 'Lt-Col', 'Lt-Gen Sir' => 'Lt-Gen Sir', 'Maj-Gen' => 'Maj-Gen', 'Major' => 'Major', 'Prince' => 'Prince', 'Princesss' => 'Princess', 'Rear Admiral' => 'Rear Admiral', 'Squadron Leader' => 'Squadron Leader', 'The Baroness' => 'The Baroness', 'The Countess' => 'The Countess', 'The Countess of' => 'The Countess of', 'The Duchess of' => 'The Duchess of', 'The Duke of' => 'The Duke of', 'The Earl of' => 'The Earl of', 'The Hon' => 'The Hon', 'His Honour Judge' => 'His Honour Judge', 'The Hon Mrs' => 'The Hon Mrs', 'The Marchioness of' => 'The Marchioness of', 'The Marquess of' => 'The Marquess of', 'The Viscount' => 'The Viscount', 'The Viscountess' => 'The Viscountess', 'Wing Commander' => 'Wing Commander', 'The Reverend' => 'The Reverend', 'Archbishop' => 'Archbishop', 'Canon' => 'Canon', 'Bishop' => 'Bishop'));
     $forename = new Zend_Form_Element_Text('forename');
     $forename->setLabel('Forename: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter person\'s forename')->addFilter(new Zend_Filter_Callback(array('callback' => 'ucfirst')));
     $surname = new Zend_Form_Element_Text('surname');
     $surname->setLabel('Surname: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addFilter(new Zend_Filter_Callback(array('callback' => 'ucfirst')))->addErrorMessage('Please enter person\'s surname');
     $fullname = new Zend_Form_Element_Text('fullname');
     $fullname->setLabel('Fullname: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter person\'s fullname');
     $email = new Zend_Form_Element_Text('email');
     $email->SetLabel('Email address: ')->addFilters(array('StringTrim', 'StringToLower', 'StripTags'))->addValidator('StringLength', false, array(1, 200))->addValidator('EmailAddress', false, array('mx' => true))->setAttrib('size', '60');
     $dbaseID = new Zend_Form_Element_Select('dbaseID');
     $dbaseID->setLabel('User account: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addValidator('InArray', false, array(array_keys($users_options), null))->addMultiOptions(array(null => 'Choose a user account', 'Existing accounts' => $users_options))->addErrorMessage('You must enter a database account.');
     $canRecord = $this->addElement('checkbox', 'canRecord', array('label' => 'Allowed to record: '))->canRecord;
     $address = new Zend_Form_Element_Text('address');
     $address->SetLabel('Address: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 500));
     $town_city = new Zend_Form_Element_Text('town_city');
     $town_city->SetLabel('Town: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 200));
     $countyID = new Zend_Form_Element_Select('countyID');
     $countyID->setLabel('County: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose a county', 'Valid counties' => $county_options));
     $postcode = new Zend_Form_Element_Text('postcode');
     $postcode->SetLabel('Postcode: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'StringToUpper', 'Purifier'))->addValidator('StringLength', false, array(1, 200))->addValidator('ValidPostCode');
     $country = new Zend_Form_Element_Select('country');
     $country->SetLabel('Country: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('StringLength', false, array(1, 4))->addValidator('InArray', false, array(array_keys($countries_options)))->addMultiOptions(array(null => 'Please choose a country of residence', 'Valid countries' => $countries_options))->setValue('GB');
     $hometel = new Zend_Form_Element_Text('hometel');
     $hometel->SetLabel('Home telephone number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 30));
     $worktel = new Zend_Form_Element_Text('worktel');
     $worktel->SetLabel('Work telephone number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 30));
     $fax = new Zend_Form_Element_Text('faxno');
     $fax->SetLabel('Fax number: ')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addValidator('StringLength', false, array(1, 30));
     $comments = new Pas_Form_Element_CKEditor('comments');
     $comments->SetLabel('Comments: ')->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $organisationID = new Zend_Form_Element_Select('organisationID');
     $organisationID->SetLabel('Organisation attached to: ')->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Please choose an organisation', 'Valid organisations' => $organisations_options))->addValidator('InArray', false, array(array_keys($organisations_options)));
     $primary_activity = new Zend_Form_Element_Select('primary_activity');
     $primary_activity->SetLabel('Person\'s primary activity: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('Int')->addValidator('InArray', false, array(array_keys($activities_options)))->addMultiOptions(array(null => 'Choose a primary activity', 'Valid activities' => $activities_options))->addErrorMessage('You must enter an activity for this person.');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($title, $forename, $surname, $fullname, $email, $address, $town_city, $countyID, $postcode, $country, $dbaseID, $canRecord, $hometel, $worktel, $fax, $comments, $organisationID, $primary_activity, $submit));
     $this->addDisplayGroup(array('title', 'forename', 'surname', 'fullname', 'email', 'address', 'town_city', 'countyID', 'postcode', 'country', 'dbaseID', 'canRecord', 'hometel', 'worktel', 'faxno', 'comments', 'organisationID', 'primary_activity'), 'details');
     $this->details->setLegend('Person details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 12
0
 /** The form constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $projecttypes = new ProjectTypes();
     $projectype_list = $projecttypes->getTypes();
     $this->setName('acceptupgrades');
     ZendX_JQuery::enableForm($this);
     $level = new Zend_Form_Element_Select('level');
     $level->setLabel('Level of research: ')->setRequired(true)->addMultiOptions(array(null => 'Choose type of research', 'Available types' => $projectype_list))->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set the level of research')->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $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.');
     $researchOutline = new Pas_Form_Element_CKEditor('researchOutline');
     $researchOutline->setLabel('Research outline: ')->setRequired(true)->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'))->addErrorMessage('Outline must be present.');
     $reference = new Zend_Form_Element_Text('reference');
     $reference->setLabel('Referee\'s name: ')->setAttrib('size', 30)->addFilters(array('StringTrim', 'StripTags'));
     $referenceEmail = new Zend_Form_Element_Text('referenceEmail');
     $referenceEmail->setLabel('Referee\'s email address: ')->setAttrib('size', 30)->addValidator('EmailAddress')->addFilters(array('StringToLower', 'StringTrim', 'StripTags'));
     $message = new Pas_Form_Element_CKEditor('message');
     $message->setLabel('Message to user: '******'rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', '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');
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->addMultiOptions(array(null => 'Available institutions', 'Choose institution' => $inst_options));
     $institution->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->addMultiOptions(array(null => 'Available roles', 'Choose role' => $role_options));
     $role->removeMultiOption('admin');
     $role->setAttribs(array('class' => 'input-xxlarge selectpicker show-menu-arrow'));
     $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')->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: ')->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!');
     $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 is not'))->setRequired(true)->setOptions(array('separator' => ''));
     $insert = new Zend_Form_Element_Checkbox('insert');
     $insert->setLabel('Insert details into research register: ')->setCheckedValue(1);
     $valid = new Zend_Form_Element_Radio('higherLevel');
     $valid->setLabel('Approve?: ')->addMultiOptions(array(1 => 'Unauthorised', 0 => 'Authorised'))->setRequired(true)->setOptions(array('separator' => ''));
     $submit = new Zend_Form_Element_Submit('submit');
     $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');
     $this->details->setLegend('Details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 13
0
 /** The constructor
  * @access public
  * @return void
  * @param array $options
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('institution');
     $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.');
     $description = new Pas_Form_Element_CKEditor('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'));
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($institution, $description, $submit));
     $this->addDisplayGroup(array('institution', 'description'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 14
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('ironagetribes');
     $tribe = new Zend_Form_Element_Text('tribe');
     $tribe->setLabel('Tribe name: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('You must enter a name for the tribe.');
     $description = new Pas_Form_Element_CKEditor('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'));
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->SetLabel('Is this tribe currently valid: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($tribe, $description, $valid, $submit));
     $this->addDisplayGroup(array('tribe', 'description', 'valid', 'submit'), 'details');
     parent::init();
 }
Exemplo n.º 15
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('Manufactures');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Method of manufacture term: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid title for this method!');
     $termdesc = new Pas_Form_Element_CKEditor('termdesc');
     $termdesc->setLabel('Description of manufacture method: ')->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'))->addValidator('Digits');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $termdesc, $valid, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details');
     $this->details->setLegend('Method of manufacture details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 16
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $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');
     $termdesc = new Pas_Form_Element_CKEditor('termdesc');
     $termdesc->setLabel('Description of decoration style: ')->setRequired(true)->setAttribs(array('rows' => 10, 'cols' => 80))->addFilters(array('BasicHtml', 'EmptyParagraph', 'StringTrim', 'WordChars'))->addErrorMessage('You must enter a description for this surface treatment');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Term is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set a status for this treatment term');
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $termdesc, $valid, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details');
     $this->details->setLegend('Surface treatment details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 17
0
 /** the constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $period_options = $periods->getMedievalCoinsPeriodList();
     parent::__construct($options);
     $this->setName('medievaltype');
     $category = new Zend_Form_Element_Text('category');
     $category->setLabel('Medieval coin category: ')->setRequired(true)->setAttrib('size', 60)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a category name.');
     $periodID = new Zend_Form_Element_Select('periodID');
     $periodID->setLabel('Medieval period: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a period for this type')->addMultioptions(array(null => 'Choose a period', 'Available Options' => $period_options));
     $description = new Pas_Form_Element_CKEditor('description');
     $description->setLabel('Description: ')->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($category, $description, $periodID, $submit));
     $this->addDisplayGroup(array('category', 'periodID', 'description', 'submit'), 'details');
     parent::init();
 }
Exemplo n.º 18
0
 /** Construct the form
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('activity');
     $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);
     $termdesc = new Pas_Form_Element_CKEditor('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');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ')->setRequired(false)->addValidator('NotEmpty', 'boolean');
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $termdesc, $valid, $submit));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid', 'submit'), 'details');
     $this->details->setLegend('Primary activity details: ');
     parent::init();
 }
Exemplo n.º 19
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $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!');
     $termdesc = new Pas_Form_Element_CKEditor('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'))->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->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 20
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('Culture');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Ascribed Culture name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('size', 60)->addErrorMessage('Please enter a valid title for this culture!');
     $termdesc = new Pas_Form_Element_CKEditor('termdesc');
     $termdesc->setLabel('Description of ascribed culture: ')->setRequired(true)->setAttrib('rows', 30)->setAttrib('cols', 60)->addErrorMessage('You must enter a main body of text or David Williams will eat you.')->addFilter('HtmlBody')->setAttrib('Height', 400)->addFilter('EmptyParagraph')->addFilter('StringTrim')->addFilter('WordChars');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ')->setRequired(true)->addErrorMessage('You must set the status of this term');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $termdesc, $valid, $submit, $hash));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 21
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('degreeofwear');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Decoration style term: ')->setRequired(true)->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('Please enter a valid title for this surface treatment');
     $termdesc = new Pas_Form_Element_CKEditor('termdesc');
     $termdesc->setLabel('Description of decoration style: ')->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 for this surface treatment');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Period is currently in use: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set a status for this treatment term');
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $this->addElements(array($term, $termdesc, $valid, $submit, $hash));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details');
     $this->details->setLegend('Surface treatment details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 22
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('Decstyles');
     $term = new Zend_Form_Element_Text('term');
     $term->setLabel('Decoration style term: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('Please enter a valid title for this decorative style');
     $termdesc = new Pas_Form_Element_CKEditor('termdesc');
     $termdesc->setLabel('Description of decoration style: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilter('BasicHtml')->addFilter('EmptyParagraph')->addFilter('WordChars');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ')->setRequired(true);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($term, $termdesc, $valid, $submit, $hash));
     $this->addDisplayGroup(array('term', 'termdesc', 'valid'), 'details');
     $this->details->setLegend('Decoration style details: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 23
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $actionTypes = new TreasureActionTypes();
     $actionlist = $actionTypes->getList();
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('actionsForTreasure');
     $actionDescription = new Pas_Form_Element_CKEditor('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'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($actionlist)))->addMultiOptions($actionlist);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($action, $actionDescription, $submit, $hash));
     $this->addDisplayGroup(array('actionID', 'actionTaken'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 24
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $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!');
     $comment_author_email = new Zend_Form_Element_Text('comment_author_email');
     $comment_author_email->setLabel('Enter your email address: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->addValidator('EmailAddress')->addErrorMessage('Please enter a valid email address!')->setDescription('* This will not be displayed to the public.');
     $comment_content = new Pas_Form_Element_CKEditor('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_CKEditor('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');
     $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->setLegend('Enter your comments: ');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 25
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $rulers = new Rulers();
     $rulers_options = $rulers->getAllMedRulers();
     $dynasties = new Dynasties();
     $dynasties_options = $dynasties->getOptions();
     parent::__construct($options);
     $this->setName('MonarchDetails');
     $name = new Zend_Form_Element_Text('name');
     $name->setLabel('Monarch\'s name: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', '50')->addErrorMessage('You must enter a Monarch\'s name');
     $styled = new Zend_Form_Element_Text('styled');
     $styled->setLabel('Styled as: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $alias = new Zend_Form_Element_Text('alias');
     $alias->setLabel('Monarch\'s alias: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $dbaseID = new Zend_Form_Element_Select('dbaseID');
     $dbaseID->setLabel('Database ID: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('InArray', false, array(array_keys($rulers_options)))->addMultiOptions(array(null => 'Choose Database ID', 'Available rulers' => $rulers_options));
     $date_from = new Zend_Form_Element_Text('date_from');
     $date_from->setLabel('Issued coins from: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $date_to = new Zend_Form_Element_Text('date_to');
     $date_to->setLabel('Issued coins until: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $born = new Zend_Form_Element_Text('born');
     $born->setLabel('Born: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $died = new Zend_Form_Element_Text('died');
     $died->setLabel('Died: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $biography = new Pas_Form_Element_CKEditor('biography');
     $biography->setLabel('Biography: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $dynasty = new Zend_Form_Element_Select('dynasty');
     $dynasty->setLabel('Dynastic grouping: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits');
     $publishState = new Zend_Form_Element_Select('publishState');
     $publishState->setLabel('Publication status: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('Digits')->addMultiOptions(array(null => 'Set status', 'Available status options' => array('1' => 'Draft', '2' => 'Published')))->setValue(1);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($name, $styled, $alias, $dbaseID, $date_from, $date_to, $born, $died, $biography, $dynasty, $publishState, $submit, $hash));
     $this->addDisplayGroup(array('name', 'styled', 'alias'), 'names');
     $this->names->setLegend('Nomenclature');
     $this->addDisplayGroup(array('dbaseID', 'date_from', 'date_to', 'born', 'died'), 'periods');
     $this->periods->setLegend('Dates');
     $this->addDisplayGroup(array('biography', 'dynasty', 'publishState'), 'details');
     $this->details->setLegend('Biographical details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 26
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     ZendX_JQuery::enableForm($this);
     parent::__construct($options);
     $this->setName('finalvaluation');
     $value = new Zend_Form_Element_Text('value');
     $value->setLabel('Estimated market value: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Currency');
     $comments = new Pas_Form_Element_CKEditor('comments');
     $comments->setLabel('Valuation comments: ')->setRequired(false)->setAttrib('rows', 10)->setAttrib('cols', 40)->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Finds')->addFilters(array('StripTags', 'StringTrim', 'BasicHtml', 'EmptyParagraph'));
     $dateOfValuation = new ZendX_JQuery_Form_Element_DatePicker('dateOfValuation');
     $dateOfValuation->setLabel('Valuation provided on: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must enter a chase date')->setAttrib('size', 20);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $this->addElements(array($value, $dateOfValuation, $comments, $submit, $hash));
     $this->addDisplayGroup(array('value', 'dateOfValuation', 'comments'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 27
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $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->setName('event');
     $eventTitle = new Zend_Form_Element_Text('eventTitle');
     $eventTitle->setLabel('Event title: ')->setRequired(true)->addErrorMessage('You must enter an event title')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->setAttrib('size', 70);
     $eventDescription = new Pas_Form_Element_CKEditor('eventDescription');
     $eventDescription->setLabel('Event description: ')->setRequired(true)->addFilters(array('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)->addErrorMessage('You must enter an address')->setAttrib('size', 70)->addFilters(array('StripTags', 'StringTrim', 'Purifier'));
     $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'))->setDescription('Enter in 24 hour clock format');
     $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'))->setDescription('Enter in 24 hour clock format');
     $eventStartDate = new ZendX_JQuery_Form_Element_DatePicker('eventStartDate');
     $eventStartDate->setLabel('Event start date: ')->setRequired(true)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You need a start date')->setAttrib('size', 20);
     $eventEndDate = new ZendX_JQuery_Form_Element_DatePicker('eventEndDate');
     $eventEndDate->setLabel('Event end date: ')->setRequired(false)->setJQueryParam('dateFormat', 'yy-mm-dd')->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You need an end date')->setAttrib('size', 20);
     $eventRegion = new Zend_Form_Element_Select('eventRegion');
     $eventRegion->setLabel('Organising section: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($staffregions_options)))->addMultiOptions(array(null => 'Please choose a region', 'Valid regions' => $staffregions_options));
     $eventType = new Zend_Form_Element_Select('eventType');
     $eventType->setLabel('Type of event: ')->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addFilters(array('StripTags', 'StringTrim'))->addValidator('stringLength', false, array(1, 10))->addValidator('inArray', false, array(array_keys($event_options)))->addMultiOptions($event_options);
     $adultsAttend = new Zend_Form_Element_Text('adultsAttend');
     $adultsAttend->setLabel('Adults attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $childrenAttend = new Zend_Form_Element_Text('childrenAttend');
     $childrenAttend->setLabel('Children attending: ')->setRequired(false)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Int');
     $organisation = new Zend_Form_Element_Select('organisation');
     $organisation->setLabel('Organised by: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setValue('PAS')->addFilters(array('StripTags', 'StringTrim'))->addMultioptions(array(null => 'Choose an organisation', 'Available institutions' => $orgs))->addValidator('InArray', false, array(array_keys($orgs)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($eventTitle, $eventDescription, $eventStartTime, $eventEndTime, $eventStartDate, $eventEndDate, $organisation, $childrenAttend, $eventRegion, $adultsAttend, $address, $eventType, $submit, $hash));
     $this->addDisplayGroup(array('eventTitle', 'eventDescription', 'eventLocation', 'eventStartTime', 'eventEndTime', 'eventStartDate', 'eventEndDate', 'eventRegion', 'organisation', 'childrenAttend', 'adultsAttend', 'eventType'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 28
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $f = new Contacts();
     $flos = $f->getFloEmailsForForm();
     parent::__construct($options);
     $this->setName('notifyFlo');
     $flo = new Zend_Form_Element_Select('flo');
     $flo->setLabel('Which flo is yours?: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addMultiOptions(array(null => 'Choose your FLO', 'Available FLOs' => $flos));
     $type = new Zend_Form_Element_Select('type');
     $type->setLabel('Message type: ')->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true)->addMultiOptions(array(null => 'Choose reason', 'Choose error type' => array('Can you publish this please?' => 'Can you publish this please?', 'More info' => 'I have further information', 'Image problem' => 'Image problem', 'Grid reference issues' => 'Grid reference issues', 'Duplicated record' => 'Duplicated record', 'Data problems apparent' => 'Data problems - what do I do?', 'Other' => 'Other reason')))->addErrorMessage('You must enter an error report type');
     $content = new Pas_Form_Element_CKEditor('content');
     $content->setLabel('Enter your comment: ')->setRequired(true)->addFilter('StringTrim')->setAttrib('Height', 400)->setAttrib('ToolbarSet', 'Basic')->addFilters(array('StringTrim', 'WordChars', 'HtmlBody', 'EmptyParagraph'))->addErrorMessage('Please enter something in the comments box!');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($content, $flo, $type, $submit, $hash));
     $this->addDisplayGroup(array('flo', 'type', 'content'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 29
0
 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     parent::__construct($options);
     $this->setName('discoverymethods');
     $method = new Zend_Form_Element_Text('method');
     $method->setLabel('Discovery method term: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('NotEmpty')->addErrorMessage('You must enter a valid term');
     $termdesc = new Pas_Form_Element_CKEditor('termdesc');
     $termdesc->setLabel('Description of method: ')->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 for this term');
     $valid = new Zend_Form_Element_Checkbox('valid');
     $valid->setLabel('Is this term valid?: ')->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addErrorMessage('You must set a status for this term');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(60);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $this->addElements(array($method, $termdesc, $valid, $submit, $hash));
     $this->addDisplayGroup(array('method', 'termdesc', 'valid'), 'details');
     $this->details->setLegend('Discovery methods');
     $this->addDisplayGroup(array('submit'), 'buttons');
     parent::init();
 }
Exemplo n.º 30
0
 public function __construct(array $options = null)
 {
     $authors = new Users();
     $authorOptions = $authors->getAuthors();
     $sections = new Zend_Config_Ini(APPLICATION_PATH . '/config/sections.ini', 'production');
     $sectionList = $sections->toArray();
     parent::__construct($options);
     $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');
     $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');
     $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'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('NotEmpty')->addErrorMessage('You must choose an author');
     $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_CKEditor('body');
     $body->setLabel('Main body of text: ')->setRequired(true)->addErrorMessage('You must enter a main body of text')->addFilters(array('StringTrim', 'BasicHtml', 'EmptyParagraph', 'WordChars'));
     $section = new Zend_Form_Element_Select('section');
     $section->setLabel('Set site section to appear under: ')->addMultiOptions($sectionList)->setRequired(true)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->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?: ')->setRequired(false)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow');
     $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)->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->setRequired(true);
     $slug = new Zend_Form_Element_Text('slug');
     $slug->setLabel('Page slug: ')->setAttrib('size', 50)->addFilter('UrlSlug')->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $frontPage = new Zend_Form_Element_Checkbox('frontPage');
     $frontPage->setLabel('Appear on section\'s front page?: ')->addValidators(array('NotEmpty', 'Int'))->setRequired(true);
     $submit = new Zend_Form_Element_Submit('submit');
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     $this->addElements(array($title, $author, $body, $section, $publishState, $excerpt, $metaKeywords, $metaDescription, $slug, $frontPage, $submit, $menuTitle, $hash));
     $this->addDisplayGroup(array('title', 'menuTitle', 'author', 'body', 'section', 'publishState', 'excerpt', 'metaKeywords', 'metaDescription', 'slug', 'frontPage'), 'details');
     $this->addDisplayGroup(array('submit'), 'buttons');
     $this->details->setLegend('Add new site content');
     parent::init();
 }