public function _initAttributeValue() { $element = new Zend_Form_Element_Text('attribute_value'); $element->setRequired(true); $element->setAllowEmpty(false); return $this->addElement($element); }
/** * @return EngineBlock_Form_GroupProviderGroupMemberFilter */ public function _initProperty() { $element = new Zend_Form_Element_Text('group_member_filter_property'); $element->setRequired(TRUE); $element->setAllowEmpty(false); return $this->addElement($element); }
public function _initLogoUrl() { $element = new Zend_Form_Element_Text('logoUrl'); $element->setRequired(TRUE); $element->setAllowEmpty(false); return $this->addElement($element); }
/** * @return EngineBlock_Form_VirtualOrganisationIdp */ public function _initIdpId() { $element = new Zend_Form_Element_Text('idp_id'); $element->setRequired(TRUE); $element->setAllowEmpty(false); return $this->addElement($element); }
public function __construct() { parent::__construct(); $this->setAttrib('id', 'feedback_form'); $this->setAction("/index/feedback"); /* Name. */ $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name:')->setRequired(true)->addValidator('NotEmpty')->setAttrib('class', 'validate[required]')->setErrorMessages(array('You must supply your name.'))->setDecorators(Sahara_Decorator_Table::$ELEMENT); $this->addElement($name); /* Email. */ $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email:')->setRequired(true)->addValidator('EmailAddress')->setAttrib('class', 'validate[required,custom[email]]')->setErrorMessages(array('You must supply your contact email address.'))->setDecorators(Sahara_Decorator_Table::$ELEMENT); $this->addElement($email); /* Type. */ $type = new Zend_Form_Element_Select('type'); $type->setLabel('Type:')->setMultiOptions(array('Help Request' => 'Help Request', 'General comment' => 'General comment', 'Fault report' => 'Fault report', 'Feature request' => 'Feature request'))->setDecorators(Sahara_Decorator_Table::$ELEMENT); $this->addElement($type); /* Purpose of use. */ $purpose = new Zend_Form_Element_Text('purpose'); $purpose->setLabel('Purpose:')->setRequired(true)->setAttrib('class', 'validate[required]')->setErrorMessages(array('You must supply the purpose of your Remote Laboratory use.'))->setDecorators(Sahara_Decorator_Table::$ELEMENT); $this->addElement($purpose); /* Feedback. */ $feedback = new Zend_Form_Element_Textarea('feedback'); $feedback->setLabel('Feedback:')->setRequired(true)->setAttrib('class', 'validate[required]')->setErrorMessages(array('You must supply some feedback!'))->setAttrib('rows', '10')->setAttrib('cols', '55')->setDecorators(Sahara_Decorator_Table::$ELEMENT); $this->addElement($feedback); /** Bots f**k off! */ $bots = new Zend_Form_Element_Text('botsfu'); $bots->setAllowEmpty(true)->setRequired(false)->setAttrib('id', 'botsfu')->setDecorators(Sahara_Decorator_Table::$ELEMENT); $this->addElement($bots); $this->addDisplayGroup(array('name', 'email', 'type', 'purpose', 'feedback', 'botsfu'), 'feedback_form'); $dg = $this->getDisplayGroup('feedback_form'); $dg->setDecorators(Sahara_Decorator_Table::$DISPLAYGROUP); }
/** * @return EngineBlock_Form_GroupProviderPrecondition */ public function _initClassName() { $element = new Zend_Form_Element_Text('precondition_class_name'); $element->setRequired(TRUE); $element->setAllowEmpty(false); return $this->addElement($element); }
/** * @return Portal_Form_GadgetDefinition */ public function _initScreenShotUrl() { $element = new Zend_Form_Element_Text('screenShotUrl'); $element->setRequired(TRUE); $element->setAllowEmpty(FALSE); return $this->addElement($element); }
/** * @return EngineBlock_Form_VirtualOrganisation */ public function _initVOId() { $element = new Zend_Form_Element_Text('vo_id'); $element->setRequired(TRUE); $element->setAllowEmpty(false); $validator = new Zend_Validate_Regex("/^[a-zA-Z0-9\\-_]+\$/"); $element->addValidator($validator); $element->addErrorMessage("Illegal characters detected."); return $this->addElement($element); }
function __construct() { parent::__construct(); $this->setMethod('POST'); $this->setAction('/cashout/admin/minimum'); $amount = new Zend_Form_Element_Text('amount'); $submit = new Zend_Form_Element_Submit('submit'); $amount->addValidator(new Fund_Models_Forms_Validators_Currency()); $amount->setAllowEmpty(false); $amount->setLabel('Amount'); $submit->setLabel('Set Minimum'); $this->addElements(array($amount, $submit)); }
/** * Add user defined checkfields * * @return void */ protected function addCheckFields() { $check = 1; foreach ($this->checkFields as $label => &$value) { if ($value instanceof \Zend_Form_Element) { $element = $value; } else { if ($value) { $element = new \Zend_Form_Element_Text('check_' . $check); $element->setAllowEmpty(false); $element->setLabel($label); $validator = new \Zend_Validate_Identical($value); $validator->setMessage(sprintf($this->_('%s is not correct.'), $label), \Zend_Validate_Identical::NOT_SAME); $element->addValidator($validator); $value = $element; $check++; } else { // Nothing to check for unset($this->checkFields[$label]); continue; } } $this->addElement($element); } }
/** * @return EngineBlock_Form_EmailConfiguration */ public function _initEmailSubject() { $element = new Zend_Form_Element_Text('email_subject'); $element->setAllowEmpty(false); return $this->addElement($element); }
/** * @return Portal_Form_TextContent */ public function _initField() { $element = new Zend_Form_Element_Text('field'); $element->setAllowEmpty(false); return $this->addElement($element); }