Example #1
0
 public function init()
 {
     if ($this->maxNews === null) {
         $this->maxNews = 3;
     }
     parent::init();
 }
Example #2
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     //get comments module
     $commentsModule = Yii::app()->getModule('comments');
     //get model config for comments module
     $this->_config = $commentsModule->getModelConfig();
     if (count($this->_config) > 0) {
         $this->registeredOnly = isset($this->_config['registeredOnly']) ? $this->_config['registeredOnly'] : $this->registeredOnly;
         $this->useCaptcha = isset($this->_config['useCaptcha']) ? $this->_config['useCaptcha'] : $this->useCaptcha;
         $this->postCommentAction = isset($this->_config['postCommentAction']) ? $this->_config['postCommentAction'] : $this->postCommentAction;
     }
     $this->registerScripts();
 }
 public function __construct($owner = null)
 {
     parent::__construct($owner);
     $events = array(ViewController::EVENT_ON_POST_FORM => 'onPostForm');
     foreach ($events as $event => $handlerMethod) {
         $owner->attachEventHandler($event, array($this, $handlerMethod));
     }
 }
Example #4
0
 public function init()
 {
     parent::init();
     self::$interval = (int) Yii::app()->getModule('banners')->postLoadInterval;
 }