public function init()
 {
     parent::init();
     if (!$this->tree_model instanceof ActiveRecord) {
         throw new CException('Needs param tree_model instanceof ActiveRecord!');
     }
 }
Example #2
0
 /**
  * Registers the JS and CSS Files
  *
  * @return void
  */
 protected function registerScripts()
 {
     parent::registerCoreScripts();
     $cs = Yii::app()->getClientScript();
     $cs->registerCssFile($this->assets . '/ui.multiselect.css');
     $cs->registerScriptFile($this->assets . '/ui.multiselect.js', CClientScript::POS_END);
     $parameters = CJavaScript::encode(array('sortable' => $this->sortable, 'searchable' => $this->searchable, 'height' => $this->height, 'onchange' => $this->onchange));
     $cs->registerScript('EMultiSelect', '$("#' . $this->id . '").multiselect(' . $parameters . ');', CClientScript::POS_READY);
 }
Example #3
0
 public function init()
 {
     $class = 'application.components.activeRecordBehaviors.MetaTagBehavior';
     $behaviors = $this->model->behaviors();
     $classes = ArrayHelper::extract($behaviors, 'class');
     if (!in_array($class, $classes)) {
         throw new CException("Модель должна иметь поведение: {$class}");
     }
     parent::init();
 }
Example #4
0
 public function init()
 {
     parent::init();
     if (!$this->model instanceof ActiveRecord) {
         throw new CException(t('Needs param model instanceof ActiveRecord!'));
     }
     if (!$this->attribute) {
         throw new CException(t('Needs param attribute!'));
     }
     if (!is_array($this->items)) {
         throw new CException(t('Needs param items typeof Array!'));
     }
 }
Example #5
0
 public function init()
 {
     parent::init();
     $behaviorAttached = false;
     foreach ($this->model->behaviors() as $id => $data) {
         if ($this->model->asa($id) instanceof FileManagerBehavior) {
             $behaviorAttached = true;
             break;
         }
     }
     if (!$behaviorAttached) {
         throw new CException('Требуется подключение behavior FileManagerBehavior в моделе!');
     }
     $this->initVars();
     $this->registerScripts();
 }
Example #6
0
 public function init()
 {
     parent::init();
     $this->registerScripts();
 }