public function __construct($minPass = 8, $options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'mailbox/form/email-settings.phtml')))); $this->setMethod('post')->setAttrib('id', 'email_settings_form')->setAttrib('name', 'email_settings_form'); $type = $this->createElement('select', 'type')->setLabel('Email')->setRequired(true)->setRegisterInArrayValidator(true)->setAttrib('title', 'Email')->setAttrib('class', 'required')->addFilter('StringTrim')->addFilter('StripSlashes')->addValidator('NotEmpty', true); $email = $this->createElement('text', 'email')->setAttrib('size', 32)->setLabel('Other Email(s)')->setAttrib('data-prompt', 'Add an email address')->setAttrib('title', 'Other Email(s)')->setAttrib('placeholder', 'email1@expample.com,email2@example.com')->setAttrib('class', 'required')->setRequired(false)->addValidator('StringLength', false, array(5, 90))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $this->addElement($type)->addElement($email); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'domain/form/assign-admin.phtml')))); $this->setMethod('post')->setAttrib('id', 'domain_assing_admin_form')->setAttrib('name', 'domain_assign_admin_form'); $admin = $this->createElement('select', 'admin')->setLabel(_('Admin'))->setAttrib('title', _('Admin'))->setRequired(true)->setRegisterInArrayValidator(true)->addValidator('NotEmpty', true)->setAttrib('class', 'required')->addFilter('Digits'); $submit = $this->createElement('submit', 'save')->setLabel(_('Save')); $this->addElement($admin)->addElement($submit); // $this->setElementDecorators( array( 'ViewHelper' ) ); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/form/password.phtml')))); $this->setMethod('post')->setAttrib('id', 'change_password_form')->setAttrib('name', 'change_password_form'); $password = $this->createElement('text', 'password')->setAttrib('size', 40)->setLabel(_('Password'))->setAttrib('title', _('Password'))->setAttrib('class', 'required')->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', false, array(8, 40))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $sendEmail = $this->createElement('checkbox', 'email')->setLabel(_('Send email'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $submit = $this->createElement('submit', 'change')->setLabel(_('Submit')); $this->addElement($password)->addElement($sendEmail)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'auth/form/password-reset.phtml')))); $this->setMethod('post')->setAttrib('id', 'password_reset_form')->setAttrib('name', 'password_reset_form'); $vEmail = $this->createElement('text', 'username')->setAttrib('size', 32)->setLabel(_('Username'))->setAttrib('title', _('Username'))->setAttrib('class', 'required')->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('EmailAddress', true, array('mx' => true))->addValidator('StringLength', false, array(5, 90))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $vEmail->getValidator('NotEmpty')->setMessage(_('You must enter your email address'), Zend_Validate_NotEmpty::IS_EMPTY); $vSubmit = $this->createElement('submit', 'reset')->setLabel(_('Submit')); $this->addElement($vEmail)->addElement($vSubmit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'auth/form/login.phtml')))); $this->setMethod('post')->setAttrib('id', 'login_form')->setAttrib('name', 'login_form'); $username = $this->createElement('text', 'username')->setAttrib('size', 30)->setLabel(_('Username'))->setAttrib('title', _('Username'))->setAttrib('class', 'required')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('EmailAddress', true, array('mx' => true))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $username->getValidator('NotEmpty')->setMessage(_('You must enter your email address'), Zend_Validate_NotEmpty::IS_EMPTY); $password = $this->createElement('password', 'password')->setLabel(_('Password'))->setAttrib('title', _('Password'))->setAttrib('size', 30)->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 32))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $submit = $this->createElement('submit', 'login')->setLabel(_('Log In')); $this->addElement($username)->addElement($password)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/form/change-password.phtml')))); $this->setMethod('post')->setAttrib('id', 'change_password_form')->setAttrib('name', 'change_password_form'); $currentPassword = $this->createElement('password', 'current_password')->setLabel('Current Password')->setAttrib('title', 'Current Password')->setAttrib('size', 20)->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 255))->addFilter('StripSlashes'); $password = $this->createElement('password', 'password')->setLabel('New Password')->setAttrib('title', 'New Password')->setAttrib('size', 20)->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 255))->addFilter('StripSlashes'); $confirmPassword = $this->createElement('password', 'confirm_password')->setLabel('Confirm New Password')->setAttrib('title', 'Confirm New Password')->setAttrib('size', 20)->setRequired(true)->addValidator('NotEmpty', true)->addValidator('OSSIdenticalField', true, array('fieldName' => 'password', 'fieldTitle' => 'the new password'))->addFilter('StripSlashes'); $confirmPassword->getValidator('NotEmpty')->setMessage('The confirmation password is required and must match the new password', Zend_Validate_NotEmpty::IS_EMPTY); $this->addElement($currentPassword)->addElement($password)->addElement($confirmPassword); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null, $domainList, $admin) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/form/add-domain.phtml')))); $this->setMethod('post')->setAttrib('id', 'admin_add_domain_form')->setAttrib('name', 'admin_add_domain_form'); $adminId = $this->createElement('hidden', 'adminId')->setValue($admin->id); $domain = $this->createElement('select', 'domain')->setOptions(array('multiOptions' => $domainList))->setLabel(_('Domain'))->setAttrib('title', _('Domain'))->setRequired(true)->setAttrib('class', 'required')->addFilter('Digits')->addValidator('InArray', true, array(array_keys($domainList))); $domain->getValidator('InArray')->setMessage(_('You must select a domain.'), Zend_Validate_InArray::NOT_IN_ARRAY); $cancel = $this->createElement('button', 'cancel')->setLabel(_('Cancel')); $submit = $this->createElement('submit', 'save')->setLabel(_('Save')); $this->addElement($adminId)->addElement($domain)->addElement($cancel)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null, $domainList) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'alias/form/edit.phtml')))); $this->setMethod('post')->setAttrib('id', 'alias_edit_form')->setAttrib('name', 'alias_edit_form'); $localPart = $this->createElement('text', 'local_part')->setAttrib('size', 40)->setLabel(_('Local Part'))->setAttrib('title', _('Local Part'))->setRequired(false)->addValidator('StringLength', false, array(0, 255))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StringToLower')->addFilter('StripSlashes'); $domain = $this->createElement('select', 'domain')->setOptions(array('multiOptions' => array('' => '- select -') + $domainList))->setLabel(_('Domain'))->setAttrib('title', _('Domain'))->setRequired(true)->setAttrib('class', 'required')->addFilter('Digits')->addValidator('InArray', true, array(array_keys($domainList))); $domain->getValidator('InArray')->setMessage(_('You must select a domain.'), Zend_Validate_InArray::NOT_IN_ARRAY); $active = $this->createElement('checkbox', 'active')->setLabel(_('Active'))->addValidator('InArray', false, array(array(0, 1)))->setValue(1)->addFilter('Digits'); $goto = $this->createElement('text', 'goto')->setLabel(_('Goto'))->setRequired(false); $submit = $this->createElement('submit', 'save')->setLabel(_('Save')); $this->addElement($localPart)->addElement($domain)->addElement($active)->addElement($goto)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'mailbox/form/change-password.phtml')))); $this->setMethod('post')->setAttrib('id', 'change_password_form')->setAttrib('name', 'change_password_form'); $username = $this->createElement('text', 'username')->setLabel(_('Username'))->setAttrib('title', _('Username'))->setAttrib('class', 'required')->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('EmailAddress', true, array('mx' => true))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $username->getValidator('NotEmpty')->setMessage(_('You must enter your email address'), Zend_Validate_NotEmpty::IS_EMPTY); $currentPassword = $this->createElement('password', 'current_password')->setLabel(_('Current Password'))->setAttrib('title', _('Current Password'))->setAttrib('class', 'required')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 32))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $newPassword = $this->createElement('password', 'new_password')->setLabel(_('New Password'))->setAttrib('title', _('New Password'))->setAttrib('class', 'required')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 32))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $confirmNewPassword = $this->createElement('password', 'confirm_new_password')->setLabel(_('Confirm New Password'))->setAttrib('title', _('Confirm New Password'))->setAttrib('class', 'required')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('IdenticalField', true, array('fieldName' => 'new_password', 'fieldTitle' => _('the new password')))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $confirmNewPassword->getValidator('NotEmpty')->setMessage(_('The confirmation password is required and must match the new password'), Zend_Validate_NotEmpty::IS_EMPTY); $cancel = $this->createElement('button', 'cancel')->setLabel(_('Cancel')); $submit = $this->createElement('submit', 'change')->setLabel(_('Submit')); $this->addElement($username)->addElement($currentPassword)->addElement($newPassword)->addElement($confirmNewPassword)->addElement($cancel)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'admin/form/edit.phtml')))); $this->setMethod('post')->setAttrib('id', 'admin_edit_form')->setAttrib('name', 'admin_edit_form'); $salt = $this->createElement('text', 'salt')->setLabel(_('Security Salt'))->setAttrib('title', _('Security Salt'))->setAttrib('size', 64)->setAttrib('class', 'required')->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('NotEmpty', true)->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $username = $this->createElement('text', 'username')->setAttrib('size', 30)->setLabel(_('Username'))->setAttrib('title', _('Username'))->setAttrib('class', 'required')->setAttrib('autocomplete', 'off')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('EmailAddress', true, array('mx' => true))->addValidator('DoctrineUniqueness', true, array('table' => 'Admin', 'column' => 'username'))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $username->getValidator('NotEmpty')->setMessage(_('You must enter an email address.'), Zend_Validate_NotEmpty::IS_EMPTY); $password = $this->createElement('password', 'password')->setLabel(_('Password'))->setAttrib('title', _('Password'))->setAttrib('size', 40)->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 32))->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $active = $this->createElement('checkbox', 'active')->setLabel(_('Active'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $super = $this->createElement('checkbox', 'super')->setLabel(_('Superadmin'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $welcomeEmail = $this->createElement('checkbox', 'welcome_email')->setLabel(_('Welcome email'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $cancel = $this->createElement('button', 'cancel')->setLabel(_('Cancel')); $submit = $this->createElement('submit', 'save')->setLabel(_('Save')); $this->addElement($salt)->addElement($username)->addElement($password)->addElement($active)->addElement($super)->addElement($welcomeEmail)->addElement($cancel)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'domain/form/edit.phtml')))); $this->setMethod('post')->setAttrib('id', 'domain_edit_form')->setAttrib('name', 'domain_edit_form'); $domain = $this->createElement('text', 'domain')->setAttrib('size', 40)->setLabel(_('Domain'))->setAttrib('title', _('Domain'))->setAttrib('class', 'required')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('Hostname', true, array('allow' => Zend_Validate_Hostname::ALLOW_DNS))->addValidator('DoctrineUniqueness', true, array('table' => 'Domain', 'column' => 'domain'))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StringToLower')->addFilter('StripSlashes'); $description = $this->createElement('textarea', 'description')->setLabel(_('Description'))->setAttrib('title', _('Description'))->setAttrib('rows', 2)->setAttrib('cols', 60)->setRequired(false)->addValidator('StringLength', true, array(0, 255))->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $backupMx = $this->createElement('checkbox', 'backupmx')->setLabel(_('Backup MX'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $active = $this->createElement('checkbox', 'active')->setLabel(_('Active'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $aliases = $this->createElement('text', 'aliases')->setLabel(_('Aliases'))->setAttrib('title', _('Aliases'))->setAttrib('size', 5)->setRequired(false)->addFilter('Digits'); $mailboxes = $this->createElement('text', 'mailboxes')->setLabel(_('Mailboxes'))->setAttrib('title', _('Mailboxes'))->setAttrib('size', 5)->setRequired(false)->addFilter('Digits'); $maxQuota = $this->createElement('text', 'maxquota')->setLabel(_('Max Quota'))->setAttrib('title', _('Max Quota'))->setAttrib('size', 5)->setRequired(false)->addFilter('Digits'); $quota = $this->createElement('text', 'quota')->setLabel(_('Quota'))->setAttrib('title', _('Quota'))->setAttrib('size', 5)->setRequired(false)->addFilter('Digits'); $transport = $this->createElement('text', 'transport')->setAttrib('size', 40)->setLabel(_('Transport'))->setAttrib('title', _('Transport'))->setRequired(false)->addValidator('StringLength', false, array(0, 255))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $submit = $this->createElement('submit', 'save')->setLabel(_('Save')); $this->addElement($domain)->addElement($description)->addElement($backupMx)->addElement($active)->addElement($aliases)->addElement($mailboxes)->addElement($maxQuota)->addElement($quota)->addElement($transport)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
public function __construct($options = null, $domainList) { parent::__construct($options); $this->setDecorators(array(array('ViewScript', array('viewScript' => 'mailbox/form/edit.phtml')))); $this->setMethod('post')->setAttrib('id', 'mailbox_edit_form')->setAttrib('name', 'mailbox_edit_form'); $localPart = $this->createElement('text', 'local_part')->setAttrib('size', 40)->setLabel(_('Local Part'))->setAttrib('title', _('Local Part'))->setAttrib('class', 'required')->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', false, array(1, 255))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StringToLower')->addFilter('StripSlashes'); $domain = $this->createElement('select', 'domain')->setOptions(array('multiOptions' => array('' => '- select -') + $domainList))->setLabel(_('Domain'))->setAttrib('title', _('Domain'))->setRequired(true)->setAttrib('class', 'required')->addValidator('NotEmpty', true)->addValidator('StringLength', false, array(1, 255))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes')->addValidator('InArray', true, array(array_keys($domainList))); $domain->getValidator('InArray')->setMessage(_('You must select a domain.'), Zend_Validate_InArray::NOT_IN_ARRAY); $name = $this->createElement('text', 'name')->setAttrib('size', 40)->setLabel(_('Name'))->setAttrib('title', _('Name'))->setRequired(false)->addValidator('StringLength', false, array(0, 255))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $password = $this->createElement('text', 'password')->setLabel(_('Password'))->setAttrib('title', _('Password'))->setAttrib('size', 40)->setRequired(true)->addValidator('NotEmpty', true)->addValidator('StringLength', true, array(8, 32))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $active = $this->createElement('checkbox', 'active')->setLabel(_('Active'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $quota = $this->createElement('text', 'quota')->setLabel(_('Quota'))->setAttrib('title', _('Quota'))->setAttrib('size', 5)->setRequired(false)->addFilter('Digits'); $welcomeEmail = $this->createElement('checkbox', 'welcome_email')->setAttrib('onclick', "\$('#cc_welcome_email_tr').toggle('fast');")->setLabel(_('Welcome email'))->addValidator('InArray', false, array(array(0, 1)))->addFilter('Digits'); $ccWelcomeEmail = $this->createElement('text', 'cc_welcome_email')->setAttrib('size', 40)->setLabel(_('CC welcome email'))->setAttrib('title', _('CC welcome email'))->setRequired(false)->addValidator('EmailAddress', true, array('mx' => true))->addFilter('StringTrim')->addFilter('HtmlEntitiesDecode')->addFilter('StripSlashes'); $submit = $this->createElement('submit', 'save')->setLabel(_('Save')); $this->addElement($localPart)->addElement($domain)->addElement($name)->addElement($password)->addElement($active)->addElement($quota)->addElement($welcomeEmail)->addElement($ccWelcomeEmail)->addElement($submit); $this->setElementDecorators(array('ViewHelper')); }
/** * Constructor * * Overriding constructor to disable load default decorators * and prevent subforms to be created as forms. * * @param null|array $options */ public function __construct($options = null) { //Disabling default decorators $this->setDisableLoadDefaultDecorators(true); parent::__construct($options); }