Skip to content

Commit

Permalink
удалил экшн activate из BackController за ненадобностью
Browse files Browse the repository at this point in the history
  • Loading branch information
chemezov committed Mar 16, 2015
1 parent ececc49 commit 43fcab4
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions protected/modules/yupe/components/controllers/BackController.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,34 +170,6 @@ public function actionMultiaction()
}
}

/**
* @throws \CHttpException
*/
public function actionActivate()
{
$status = (int)Yii::app()->getRequest()->getQuery('status');
$id = (int)Yii::app()->getRequest()->getQuery('id');
$modelClass = Yii::app()->getRequest()->getQuery('model');
$statusField = Yii::app()->getRequest()->getQuery('statusField');

if (!isset($modelClass, $id, $status, $statusField)) {
throw new CHttpException(404, Yii::t('YupeModule.yupe', 'Page was not found!'));
}

$model = new $modelClass();
$model = $model->resetScope()->findByPk($id);
if (!$model) {
throw new CHttpException(404, Yii::t('YupeModule.yupe', 'Page was not found!'));
}

$model->$statusField = $status;
$model->update([$statusField]);

if (!Yii::app()->getRequest()->getIsAjaxRequest()) {
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : ['index']);
}
}

/**
* @throws \CHttpException
*/
Expand Down

0 comments on commit 43fcab4

Please sign in to comment.