Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $avatar = new Media_Form_Model_Admin_File();
     $this->addReferenceSubForm($avatar, 'avatar');
     $user = new Auth_Form_Model_User();
     $this->addReferenceSubForm($user, 'user');
 }
Ejemplo n.º 2
0
 /**
  * Initialize form (used by extending classes)
  *
  * @return void
  */
 public function init()
 {
     parent::init();
     $this->getElement('username')->addValidators(array(array('Regex', false, array('/^[a-z][a-z0-9._]{2,}$/i', 'messages' => array('regexNotMatch' => $this->_translate('Special characters are not allowed')))), array(new Centurion_Form_Model_Validator_AlreadyTaken('auth/user', 'username'))));
     $this->getElement('password')->addValidator('stringLength', false, array('min' => 4));
     $this->getElement('email')->setRequired(true)->addValidator('EmailAddress');
     $password = clone $this->getElement('password');
     $password->addValidator(new Centurion_Validate_IdenticalField('password', 'Password'))->setLabel($this->_translate('Password confirmation'))->setName('password_again');
     $this->getElement('email')->addValidator(new Centurion_Form_Model_Validator_AlreadyTaken('auth/user', 'email'));
     $email = clone $this->getElement('email');
     $email->addValidator(new Centurion_Validate_IdenticalField('email', 'Email'))->setLabel($this->_translate('Email confirmation'))->setName('email_again')->setRequired(true);
     $this->addElements(array($password, $email))->moveElement('password_again', 'after', 'password')->moveElement('email_again', 'after', 'email');
 }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     $this->setLegend($this->_translate('Edit flatpage'));
     $this->getElement('body')->setAttrib('class', 'field-rte')->setAttrib('large', true)->removeFilter('StripTags');
     $this->getElement('flatpage_template_id')->setAttrib('large', true);
     //$this->getElement('mptt_parent_id')->setAttrib('large', true);
     $this->getElement('published_at')->setAttrib('large', true);
     $this->getElement('published_at')->setRequired(false)->setAttrib('class', 'field-datetimepicker');
     $this->getElement('url')->addValidator(new Centurion_Form_Model_Validator_AlreadyTaken('cms/flatpage', 'url'));
     $this->addElement('info', 'created_at', array('label' => 'Created at'));
     $this->addElement('info', 'updated_at', array('label' => 'Updated at'));
     $pic = new Media_Form_Model_Admin_File(array('name' => 'cover'));
     $pic->getFilename()->getValidator('Size')->setMax(4 * 1024 * 1024);
     $this->addReferenceSubForm($pic, 'cover');
 }
Ejemplo n.º 4
0
 public function init()
 {
     parent::init();
     $this->getElement('description')->setAttrib('class', 'field-rte')->setAttrib('large', true)->removeFilter('StripTags');
 }