Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function beforeAction($action)
 {
     if (in_array($action->id, ['get-attributes', 'get-categories'])) {
         $this->enableCsrfValidation = false;
     }
     return parent::beforeAction($action);
 }
 public function actions()
 {
     if ($this->widgets === NULL) {
         $this->widgets = ['yeesoft\\comment\\widgets\\dashboard\\Comments', ['class' => 'yeesoft\\widgets\\dashboard\\Info', 'position' => 'right'], ['class' => 'yeesoft\\media\\widgets\\dashboard\\Media', 'position' => 'right'], 'yeesoft\\post\\widgets\\dashboard\\Posts', 'yeesoft\\user\\widgets\\dashboard\\Users'];
     }
     return ArrayHelper::merge(parent::actions(), ['index' => ['class' => 'yeesoft\\web\\DashboardAction', 'widgets' => $this->widgets]]);
 }
 protected function getRedirectPage($action, $model = null)
 {
     switch ($action) {
         case 'update':
             return ['update', 'id' => $model->id];
             break;
         default:
             return parent::getRedirectPage($action, $model);
     }
 }
 protected function getRedirectPage($action, $model = null)
 {
     switch ($action) {
         case 'update':
             return ['update', 'id' => $model->id];
             break;
         case 'create':
             return ['update', 'id' => $model->id];
             break;
         case 'delete':
             return ['/translation/default/index'];
             break;
         default:
             return parent::getRedirectPage($action, $model);
     }
 }
 protected function getRedirectPage($action, $model = null)
 {
     if (!User::hasPermission('editPosts') && $action == 'create') {
         return ['view', 'id' => $model->id];
     }
     switch ($action) {
         case 'update':
             return ['update', 'id' => $model->id];
             break;
         case 'create':
             return ['update', 'id' => $model->id];
             break;
         default:
             return parent::getRedirectPage($action, $model);
     }
 }
Esempio n. 6
0
 protected function getRedirectPage($action, $model = null)
 {
     switch ($action) {
         case 'delete':
             $searchClass = $this->modelSearchClass;
             $formName = StringHelper::basename($searchClass::className());
             return ['/menu/default/index', "{$formName}[menu_id]" => $model->menu_id];
             break;
         case 'update':
             return ['update', 'id' => $model->id];
             break;
         case 'create':
             return ['update', 'id' => $model->id];
             break;
         default:
             return parent::getRedirectPage($action, $model);
     }
 }
 public function beforeAction($action)
 {
     return parent::beforeAction($action);
 }