backend - replace event controller with module
This commit is contained in:
@@ -8,7 +8,7 @@ use common\modules\event\EventModule;
|
||||
use common\modules\event\models\EventPermissions;
|
||||
use Yii;
|
||||
use common\models\Event;
|
||||
use backend\models\EventSearch;
|
||||
use common\modules\event\models\EventSearch;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use yii\web\Controller;
|
||||
use yii\web\HttpException;
|
||||
@@ -33,7 +33,7 @@ class EventController extends Controller
|
||||
|
||||
$module = EventModule::getInstance();
|
||||
$allowedActions = [ 'index','view', 'reserve-card','cancel-registration','delete-registration' ];
|
||||
if ( $module->mode == 'admin' ){
|
||||
if ( $module->mode == 'backend' ){
|
||||
$allowedActions[] = 'create';
|
||||
$allowedActions[] = 'update';
|
||||
$allowedActions[] = 'delete';
|
||||
|
||||
@@ -31,7 +31,7 @@ class EventPermissions
|
||||
public function __construct()
|
||||
{
|
||||
$moduleMode = EventModule::getInstance()->mode;
|
||||
if ( $moduleMode == 'admin'){
|
||||
if ( $moduleMode == 'backend'){
|
||||
$this->allowCreate = true;
|
||||
$this->allowDelete = true;
|
||||
$this->allowEdit = true;
|
||||
|
||||
@@ -46,6 +46,7 @@ $indexTableTemplateButtons[] = '{reserve-card}';
|
||||
$allow = true;
|
||||
if ( isset($item['allow'])){
|
||||
$allow = $item['allow'];
|
||||
unset($item['allow']);
|
||||
}
|
||||
if ( $allow ){
|
||||
$result[] = $item;
|
||||
|
||||
Reference in New Issue
Block a user