Ejemplo n.º 1
0
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('block_id' => array('numeric' => array('rule' => array('numeric'), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => false, 'required' => true, 'on' => 'update')), 'key' => array('notBlank' => array('rule' => array('notBlank'), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => false, 'required' => true, 'on' => 'update')), 'click_count' => array('numeric' => array('rule' => array('numeric'), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => true)), 'url' => array('notBlank' => array('rule' => array('notBlank'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('links', 'URL')), 'allowEmpty' => false, 'required' => true), 'url' => array('rule' => array('url'), 'message' => sprintf(__d('net_commons', 'Unauthorized pattern for %s. Please input the data in %s format.'), __d('links', 'URL'), __d('links', 'URL')), 'allowEmpty' => false, 'required' => true)), 'title' => array('notBlank' => array('rule' => array('notBlank'), 'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('links', 'Title')), 'allowEmpty' => false, 'required' => true))));
     return parent::beforeValidate($options);
 }
Ejemplo n.º 2
0
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('block_key' => array('notBlank' => array('rule' => array('notBlank'), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => false, 'required' => true, 'on' => 'update')), 'use_workflow' => array('boolean' => array('rule' => array('boolean'), 'message' => __d('net_commons', 'Invalid request.')))));
     return parent::beforeValidate($options);
 }
Ejemplo n.º 3
0
 /**
  * Called during validation operations, before validation. Please note that custom
  * validation rules can be defined in $validate.
  *
  * @param array $options Options passed from Model::save().
  * @return bool True if validate operation should continue, false to abort
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforevalidate
  * @see Model::save()
  */
 public function beforeValidate($options = array())
 {
     $this->validate = Hash::merge($this->validate, array('frame_key' => array('notBlank' => array('rule' => array('notBlank'), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => false, 'required' => true, 'on' => 'update')), 'display_type' => array('numeric' => array('rule' => array('numeric'), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => false, 'required' => true), 'inList' => array('rule' => array('inList', array(self::TYPE_DROPDOWN, self::TYPE_LIST_ONLY_TITLE, self::TYPE_LIST_WITH_DESCRIPTION)), 'message' => __d('net_commons', 'Invalid request.'))), 'open_new_tab' => array('boolean' => array('rule' => array('boolean'), 'message' => __d('net_commons', 'Invalid request.'))), 'display_click_count' => array('boolean' => array('rule' => array('boolean'), 'message' => __d('net_commons', 'Invalid request.'))), 'category_separator_line' => array('inList' => array('rule' => array('inList', array_keys(Hash::combine(self::$categorySeparators, '{n}.key', '{n}.key'))), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => true)), 'list_style' => array('inList' => array('rule' => array('inList', array_keys(Hash::combine(self::$listStyles, '{n}.key', '{n}.key'))), 'message' => __d('net_commons', 'Invalid request.'), 'allowEmpty' => true))));
     return parent::beforeValidate($options);
 }