| @@ 35-58 (lines=24) @@ | ||
| 32 | /** |
|
| 33 | * @inheritdoc |
|
| 34 | */ |
|
| 35 | public function behaviors() |
|
| 36 | { |
|
| 37 | return [ |
|
| 38 | 'access' => [ |
|
| 39 | 'class' => AccessControl::className(), |
|
| 40 | 'rules' => [ |
|
| 41 | [ |
|
| 42 | 'actions' => ['index', 'update', 'create', 'delete', 'create-menu-item', 'delete-menu-item'], |
|
| 43 | 'allow' => true, |
|
| 44 | 'roles' => ['administrator'], |
|
| 45 | ], |
|
| 46 | ], |
|
| 47 | ], |
|
| 48 | 'verbs' => [ |
|
| 49 | 'class' => VerbFilter::className(), |
|
| 50 | 'actions' => [ |
|
| 51 | 'delete' => ['post'], |
|
| 52 | 'update' => ['post'], |
|
| 53 | 'create-menu-item' => ['post'], |
|
| 54 | 'delete-menu-item' => ['post'], |
|
| 55 | ], |
|
| 56 | ], |
|
| 57 | ]; |
|
| 58 | } |
|
| 59 | ||
| 60 | /** |
|
| 61 | * Displays menu page consists of CRUD for Menu and MenuItem model. |
|
| @@ 42-73 (lines=32) @@ | ||
| 39 | /** |
|
| 40 | * @inheritdoc |
|
| 41 | */ |
|
| 42 | public function behaviors() |
|
| 43 | { |
|
| 44 | return [ |
|
| 45 | 'access' => [ |
|
| 46 | 'class' => AccessControl::className(), |
|
| 47 | 'rules' => [ |
|
| 48 | [ |
|
| 49 | 'actions' => [ |
|
| 50 | 'index', |
|
| 51 | 'create', |
|
| 52 | 'delete', |
|
| 53 | 'ajax-activate', |
|
| 54 | 'ajax-update', |
|
| 55 | 'ajax-delete', |
|
| 56 | 'ajax-save-order', |
|
| 57 | ], |
|
| 58 | 'allow' => true, |
|
| 59 | 'roles' => ['administrator'], |
|
| 60 | ], |
|
| 61 | ], |
|
| 62 | ], |
|
| 63 | 'verbs' => [ |
|
| 64 | 'class' => VerbFilter::className(), |
|
| 65 | 'actions' => [ |
|
| 66 | 'delete' => ['post'], |
|
| 67 | 'ajax-activate' => ['post'], |
|
| 68 | 'ajax-update' => ['post'], |
|
| 69 | 'ajax-delete' => ['post'], |
|
| 70 | ], |
|
| 71 | ], |
|
| 72 | ]; |
|
| 73 | } |
|
| 74 | ||
| 75 | /** |
|
| 76 | * Scan widget directory to get list of all available widgets and list all active widgets. |
|