Пример #1
0
 function __construct($id = false, $table = NULL, $ds = NULL)
 {
     if (in_array('Search', App::objects('plugin'))) {
         $this->actsAs[] = 'Search.Searchable';
     }
     if (in_array('Comment', App::objects('plugin'))) {
         $this->actsAs[] = 'Comment.Commented';
     }
     App::import('Lib', 'Blog.BlogConfig');
     $this->multimedia['multimedia']['fields']['format'] = BlogConfig::load('cropFormats');
     parent::__construct($id, $table, $ds);
 }
Пример #2
0
 function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->validate = array('title' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter the title of your post', true))), 'body' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter your post', true))), 'category_id' => array('comparison' => array('rule' => array('comparison', '>', 0), 'message' => __('Please select a category', true))));
 }