Exemple #1
0
 public function init()
 {
     parent::init();
     $this->defaultSoringSettings['update'] = "js:function(event, ui)\n        {\n            var data = \$(this).nestedSortable('toArray');\n            \$.post('{$this->sortUrl}',\n                {\n                    tree:\$.toJSON(data)\n                },\n                function(data)\n                {\n                    if (data.status == 'ok')\n                    {\n                        alert(3);\n                    }\n                },\n                'json'\n            );\n        }";
     $this->initVars();
     $this->registerScripts();
 }
 public function init()
 {
     if (Yii::app()->hasModule('poll')) {
         $this->_poll = Poll::model()->rand()->active()->find();
         $this->title = $this->_poll->title;
         parent::init();
     }
 }
 public function init()
 {
     if (isset($_POST['command']) && $_POST['command'] === 'logout') {
         Yii::app()->user->logout();
         $this->controller->redirect(Yii::app()->homeUrl);
     }
     $this->title = CHtml::encode(Yii::app()->user->name);
     parent::init();
 }
 public function init()
 {
     if (isset($_POST['command']) && $_POST['command'] === 'logout') {
         Yii::app()->user->logout();
         $this->controller->redirect(Yii::app()->homeUrl);
     }
     if (!Yii::app()->user->isGuest) {
         $this->title = CHtml::encode(Yii::app()->user->username);
     }
     parent::init();
     // displays the title
 }