예제 #1
0
 /**
  * Construct for validation.
  *
  * This is used to make the validation messages run through __()
  *
  * @param mixed $id
  * @param mixed $table
  * @param mixed $ds
  */
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->_configTypes = array(0 => __('Please Select', true), 'string' => __('String', true), 'integer' => __('Integer', true), 'dropdown' => __('Dropdown', true), 'bool' => __('Bool', true), 'array' => __('Array', true));
     $ruleCheck = $this->_configTypes;
     unset($ruleCheck[0]);
     $this->validate = array('key' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter the name of this config', true)), 'validKeyName' => array('rule' => '/^[A-Z][A-Za-z]*\\.[a-z_]+$/', 'message' => __('The key must be in the format "Plugin.config_name"', true), 'on' => 'create')), 'value' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter the value', true))), 'type' => array('allowedChoice' => array('rule' => array('inList', array_keys($ruleCheck)), 'message' => __('Please select the type', true))), 'options' => array('customOptionCheck' => array('rule' => 'customOptionCheck', 'message' => __('Please enter some valid options', true))), 'description' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter a good description for this config', true))));
 }
예제 #2
0
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->request['uri']['query']['q'] = str_replace('%site%', 'http://cakephp.org', $this->request['uri']['query']['q']);
 }
예제 #3
0
파일: page.php 프로젝트: rchavik/infinitas
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->_schema = array('file_name' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'primary'), 'slug' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 255), 'name' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'unique'), 'body' => array('type' => 'text', 'null' => false, 'default' => '', 'length' => null));
     $this->validate = array('file_name' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter a filename for this item', true)), 'isUnique' => array('rule' => 'isUnique', 'message' => __('The page name must be unique', true)), 'validFileName' => array('rule' => '/^[A-Za-z0-9_]*\\.ctp$/', 'message' => __('The filename can only be alphanumeric or _ (underscore)', true))), 'body' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('The page can not be empty', true))));
 }
예제 #4
0
파일: user.php 프로젝트: rchavik/infinitas
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $message = Configure::read('Website.password_validation');
     $this->validate = array('username' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter your username', true)), 'isUnique' => array('rule' => 'isUnique', 'message' => __('That username is taken, sorry', true))), 'email' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter your email address', true)), 'email' => array('rule' => array('email', true), 'message' => __('That email address does not seem to be valid', true)), 'isUnique' => array('rule' => 'isUnique', 'message' => __('It seems you are already registered, please use the forgot password option', true))), 'password' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter a password', true))), 'confirm_password' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please re-enter your password', true)), 'validPassword' => array('rule' => 'validPassword', 'message' => !empty($message) ? $message : __('Please enter a stronger password', true)), 'matchPassword' => array('rule' => 'matchPassword', 'message' => __('The passwords entered do not match', true))));
 }
예제 #5
0
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->validate = array('name' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter your name', true))), 'email' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter your email address', true)), 'email' => array('rule' => array('email'), 'message' => __('Please enter a valid email address', true))), 'comment' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter your comments', true))));
 }