示例#1
0
 /**
  * Updating the module configuration.
  * @return string|\yii\web\Response
  */
 public function actionSettings()
 {
     $model = new ConfigForm();
     if ($data = Yii::$app->request->post('ConfigForm')) {
         if (User::can(Rbac::PERM_CHANGE_SETTINGS)) {
             if ($model->update($data)) {
                 Log::info('Settings updated', null, __METHOD__);
                 $this->success(Yii::t('podium/flash', 'Settings have been updated.'));
                 return $this->refresh();
             } else {
                 $this->error(Yii::t('podium/flash', "One of the setting's values is too long (255 characters max)."));
             }
         } else {
             $this->error(Yii::t('podium/flash', 'You are not allowed to perform this action.'));
         }
     }
     return $this->render('settings', ['model' => $model]);
 }
示例#2
0
 /**
  * Updating the module configuration.
  * @return string|\yii\web\Response
  */
 public function actionSettings()
 {
     $model = new ConfigForm();
     if ($data = Yii::$app->request->post('ConfigForm')) {
         if ($model->update($data)) {
             Log::info('Settings updated', null, __METHOD__);
             $this->success('Settings have been updated.');
             return $this->refresh();
         } else {
             $this->error('One of the setting\'s value is too long (255 characters max).');
         }
     }
     return $this->render('settings', ['model' => $model]);
 }