public function __construct(array $data = null, array $options = null) { $passwordOpts = array('requireAlpha' => true, 'requireNumeric' => true, 'requireCapital' => false, 'minPasswordLength' => 8); $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'new_password' => array('allowEmpty' => false, new Auth_Form_Validator_PasswordStrong($passwordOpts), new Auth_Form_Validator_PasswordSpecialCharacters()), 'new_password_confirm' => array('allowEmpty' => true, 'validators' => array('name' => 'Identical', 'options' => array('token' => 'new_password')), new Auth_Form_Validator_PasswordStrong($passwordOpts), new Auth_Form_Validator_PasswordHistory($data), new Auth_Form_Validator_PasswordSpecialCharacters(), new Auth_Form_Validator_PasswordDuplicate($data))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'box_code' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Box code.')), 'fallback' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Fallback.')), 'start_dt' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Start Date.')), 'end_dt' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify End Date.')), 'title' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Title.')), 'content' => array('allowEmpty' => true), 'item_template' => array('allowEmpty' => true), 'teaser_ids' => array(new Zend_Validate_Callback(function ($value) use($data) { return isset($data['teaser_ids']) && is_array($data['teaser_ids']) && count($data['teaser_ids']) > 0; }), 'presence' => 'required', 'allowEmpty' => true, 'messages' => array(0 => 'Please select at least one container', 1 => 'Please specify item container.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array('url_id' => HCMS_Filter_CharConvert::createSEOFilter($data, $options)); // $subData = isset ($data['data'])?$data['data']:array(); // $this->_dataSubform = new Cms_Form_Sub_CategoryData($subData, $options); $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'url_id' => array('presence' => 'required', new Zend_Validate_NotEmpty(), 'messages' => array(0 => 'Please specify URL ID.')), 'set_id' => array('allowEmpty' => false), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Name.')), 'data' => array('allowEmpty' => true), 'description' => array('allowEmpty' => true), 'parent_id' => array('allowEmpty' => true), 'meta' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { /* @var $fileHelper HFB_File_Helper */ $fileHelper = Zend_Registry::get("fileHelper"); $paths = $fileHelper->getPath(""); $filterRules = array(); $validatorRules = array('image' => array('presence' => 'required', 'allowEmpty' => true, new HCMS_Validate_File_Extension(array("dir" => $paths['real'], "extensions" => "png,jpeg,jpg,gif")), 'messages' => array(0 => 'Please specify an Image.')), 'description' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $passwordOpts = array('requireAlpha' => true, 'requireNumeric' => true, 'requireCapital' => false, 'minPasswordLength' => 8); $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'role_id' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify role.')), 'username' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, new Zend_Validate_Db_NoRecordExists(array('adapter' => Zend_Registry::get('db'), 'table' => 'auth_user', 'field' => 'username', 'exclude' => array('field' => 'id', 'value' => isset($data['id']) ? $data['id'] : ""))), 'messages' => array(0 => 'Username already exist.')), 'password' => array('presence' => !isset($data['id']) || empty($data['id']) ? 'required' : "", 'allowEmpty' => false, new Auth_Form_Validator_PasswordConfirmation($data), new Auth_Form_Validator_PasswordStrong($passwordOpts), new Auth_Form_Validator_PasswordSpecialCharacters()), 'new_password' => array('presence' => isset($data['id']) && $data['id'] != '' ? 'required' : "", 'allowEmpty' => true, new Auth_Form_Validator_PasswordConfirmation($data), new Auth_Form_Validator_PasswordStrong($passwordOpts), new Auth_Form_Validator_PasswordHistory($data), new Auth_Form_Validator_PasswordSpecialCharacters(), new Auth_Form_Validator_PasswordDuplicate($data)), 'old_password' => array('presence' => isset($data['old_password']) && $data['old_password'] != '' ? 'required' : ""), 'first_name' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify First Name .')), 'last_name' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Last Name .')), 'email' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, new Zend_Validate_EmailAddress(), new Zend_Validate_Db_NoRecordExists(array('adapter' => Zend_Registry::get('db'), 'table' => 'auth_user', 'field' => 'email', 'exclude' => array('field' => 'id', 'value' => isset($data['id']) ? $data['id'] : ""))), 'messages' => array(0 => 'Please specify Email.')), 'lang' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Language.')), 'status' => array('presence' => $data['isAdminLogged'] ? 'required' : '', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Status.')), 'image_path' => array('allowEmpty' => true)); if (!$data['isAdminLogged']) { $validatorRules["new_password"][] = new Auth_Form_Validator_Oldpsw($data); } parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Construct Translation_Form_Menu * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $tr = Zend_Registry::get('Zend_Translate'); if (Zend_Registry::isRegistered('prefix_table')) { $this->_prefix = Zend_Registry::get('prefix_table'); } $filterRules = array('name' => array(new Zend_Filter_StringTrim())); $validatorRules = array('id' => array('allowEmpty' => true, new Zend_Validate_Digits(), 'messages' => array(0 => "Id " . "'{$data['id']}'" . $tr->_(" contains characters which are not digits; but only digits are allowed "))), 'name' => array('allowEmpty' => false, new Zend_Validate_Db_NoRecordExists(array('table' => $this->_prefix . 'translate_menu', 'field' => 'name', 'exclude' => array('field' => 'id', 'value' => $data['id']))))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Construct Translation_Form_Type * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $tr = Zend_Registry::get('Zend_Translate'); if (Zend_Registry::isRegistered('prefix_table')) { $this->_prefix = Zend_Registry::get('prefix_table'); } $filterRules = array(); $validatorRules = array('key' => array('presence' => 'required', 'allowEmpty' => false, new Zend_Validate_Db_NoRecordExists(array('table' => $this->_prefix . 'translate', 'field' => 'key', 'exclude' => array('field' => 'id', 'value' => $data['id'])))), 'section' => array('presence' => 'required', 'allowEmpty' => false)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { /* @var $fileHelper HFB_File_Helper */ $fileHelper = Zend_Registry::get("fileHelper"); $paths = $fileHelper->getPath(""); $validatorRules = array('show_pic' => array('presence' => 'required', 'allowEmpty' => true)); if (isset($data['show_pic']) && $data['show_pic'] == 'yes') { $validatorRules['picture'] = array('presence' => 'required', 'allowEmpty' => false, new Zend_Validate_File_Exists($paths['real']), new HCMS_Validate_File_Extension(array("dir" => $paths['real'], "extensions" => "png,jpeg,jpg,gif")), 'messages' => array(0 => 'Please specify a File.')); } parent::__construct(array(), $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { if ($data['route'] == '') { $data['dialog_url'] = ''; } // $null = new Zend_Db_Expr("NULL"); // if(isset($data['route_uri']) && $data['route_uri'] == '') // $data['route_uri'] = $null; $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Menu Name.')), 'menu' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Menu.')), 'level' => array('allowEmpty' => true), 'parent_id' => array('allowEmpty' => true), 'page_id' => array('allowEmpty' => true), 'page_id_new' => array('allowEmpty' => $data['dialog_url'] != '' ? false : true, 'presence' => $data['dialog_url'] != '' ? 'required' : false, new Zend_Validate_NotEmpty(), self::MESSAGES => array(0 => 'For this destination module, page is required.')), 'route' => array('allowEmpty' => true), 'path' => array('allowEmpty' => true), 'params' => array('allowEmpty' => true), 'params_old' => array('allowEmpty' => true), 'uri' => array('allowEmpty' => true), 'ord_num' => array('allowEmpty' => true), 'hidden' => array('allowEmpty' => true), 'route_uri' => array('allowEmpty' => true, isset($data['page_id']) && $data['page_id'] != '' ? new Zend_Validate_Db_NoRecordExists(array('adapter' => Zend_Registry::get('db'), 'table' => 'cms_route', 'field' => 'uri', 'exclude' => array('field' => 'page_id', 'value' => $data['page_id']))) : new Zend_Validate_Db_NoRecordExists(array('adapter' => Zend_Registry::get('db'), 'table' => 'cms_route', 'field' => 'uri', 'exclude' => array('field' => 'path', 'value' => isset($data['path']) ? $data['path'] : ''))), 'messages' => array(0 => 'URL is already assigned to an item from the menu.')), 'meta' => array('allowEmpty' => true), 'target' => array('allowEmpty' => true), 'dialog_url' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'ga_active' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'tracking_id' => array('presence' => 'required', 'allowEmpty' => true, 'messages' => array(0 => 'Please specify Tracking Id.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null, array $fields = array(), Zend_Controller_Request_Abstract $request = null) { $this->loadFromArray($fields); parent::__construct($this->filterRules, $this->validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'from_email' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify from email.')), 'from_name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify from name.')), 'transport' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify transport.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'uri' => array('allowEmpty' => false, 'presence' => 'required', new Zend_Validate_Db_NoRecordExists(array('adapter' => Zend_Registry::get('db'), 'table' => 'cms_route', 'field' => 'uri', 'exclude' => array('field' => 'id', 'value' => isset($data['id']) ? $data['id'] : ''))), 'messages' => array(0 => 'URL is already assigned to an route.')), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Name.')), 'params' => array('presence' => 'required', 'allowEmpty' => false, new Zend_Validate_Callback(array('Zend_Uri', 'check')), 'messages' => array(0 => 'Please specify valid URL which starts with http:// or https:// .')), 'lang' => array('presence' => 'required', 'allowEmpty' => true, 'messages' => array(0 => 'Please specify Language.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('extensions' => array('allowEmpty' => false, 'NotEmpty', 'messages' => array(0 => 'Please specify Extension.')), 'mimetypes' => array('allowEmpty' => false, 'NotEmpty', 'messages' => array(0 => 'Please specify Mimetype.')), 'default_extensions' => array('allowEmpty' => false, 'NotEmpty', 'messages' => array(0 => 'Please specify Extension.')), 'default_mimetypes' => array('allowEmpty' => false, 'NotEmpty', 'messages' => array(0 => 'Please specify Mimetype.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'code' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Menu Code.')), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Menu Name.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'name' => array('presence' => 'required', 'allowEmpty' => true, 'messages' => array(0 => 'Please specify Name.')), 'cx' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify CX.')), 'active' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'title-color' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'title-font-size' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'snippet-color' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'snippet-font-size' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'visible-url-color' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'visible-url-font-size' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'wmt_active' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify is Active.')), 'wmt_meta' => array('presence' => 'required', 'allowEmpty' => true, new Admin_Form_Validator_Metatag(), 'messages' => array(0 => 'Please specify propper Meta tag.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'user_id' => array('allowEmpty' => true, 'messages' => array(0 => 'Please specify User Id.')), 'screen_name' => array('allowEmpty' => true, 'messages' => array(0 => 'Please specify User Screen Name.')), 'count' => array('allowEmpty' => true, 'messages' => array(0 => 'Please specify Count of Tweets.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'api_id' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Api Id.')), 'api_key' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Api Key.')), 'api_secret' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Api Secret.')), 'canvas_page' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Canvas Page.')), 'domain' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Domain.')), 'base_url' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Base Url.')), 'page_url' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Page Url.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('menu' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'uri' => array('allowEmpty' => true, new Zend_Validate_Db_NoRecordExists(array('adapter' => Zend_Registry::get('db'), 'table' => 'cms_route', 'field' => 'uri', 'exclude' => array('field' => 'page_id', 'value' => isset($data['page_id']) ? $data['page_id'] : ''))), 'messages' => array(0 => 'URL is already assigned to an route.')), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Name.')), 'path' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Destination Module.')), 'params' => array('allowEmpty' => true), 'lang' => array('presence' => 'required', 'allowEmpty' => false, new Zend_Validate_NotEmpty(), 'messages' => array(0 => 'Please specify Language.')), 'page_id' => array('allowEmpty' => isset($data['dialog_url']) && $data['dialog_url'] != '' ? false : true, 'presence' => isset($data['dialog_url']) && $data['dialog_url'] != '' ? 'required' : false, new Zend_Validate_NotEmpty(), 'messages' => array(0 => 'For this destination module, page is required.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null, $lang = null) { $filterRules = array('url_id' => HCMS_Filter_CharConvert::createSEOFilter($data, $options)); $validatorRules = array('id' => array('allowEmpty' => true), 'title' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Page title.')), 'code' => array('allowEmpty' => true, 'messages' => array(0 => 'Please specify Page code.')), 'url_id' => array('presence' => 'required', new Zend_Validate_NotEmpty(), new Cms_Form_Validator_UrlId($data, $lang), 'messages' => array(0 => 'Please specify URL ID.', 1 => 'The same URL Id already exists in some other page.')), 'status' => array('presence' => 'required', 'allowEmpty' => false), 'type_id' => array('presence' => 'required', 'allowEmpty' => false), 'format' => array('presence' => 'required', 'allowEmpty' => false), 'teaser' => array('allowEmpty' => true), 'content' => array('allowEmpty' => true), 'meta' => array('allowEmpty' => true), 'data' => array('allowEmpty' => true)); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify name.')), 'email' => array('presence' => 'required', 'allowEmpty' => false, new Zend_Validate_EmailAddress(), 'messages' => array(0 => 'Please specify email.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('id' => array('allowEmpty' => true), 'name' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Name.')), 'description' => array('allowEmpty' => true), 'module' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Module.')), 'page_type_id' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify Page Type.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }
/** * Constructor * * @param array $data * @param array $options */ public function __construct(array $data = null, array $options = null) { $filterRules = array(); $validatorRules = array('server' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify server.')), 'auth' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify auth.')), 'username' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify username.')), 'password' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify password.')), 'port' => array('presence' => 'required', 'allowEmpty' => false, 'messages' => array(0 => 'Please specify port.'))); parent::__construct($filterRules, $validatorRules, $data, $options); }