| @@ 79-89 (lines=11) @@ | ||
| 76 | FloatingPanel::EVENT_BEFORE_RENDER, |
|
| 77 | function($event) { |
|
| 78 | if (in_array(\Yii::$app->requestedRoute, ['/page/page/show', '/page/page/list'])) |
|
| 79 | if (isset($_GET['id'])) { |
|
| 80 | $page = app\modules\page\models\Page::findById($_GET['id']); |
|
| 81 | $event->items[] = [ |
|
| 82 | 'label' => Icon::show('pencil') . ' ' . Yii::t('app', 'Edit page'), |
|
| 83 | 'url' => [ |
|
| 84 | '/page/backend/edit', |
|
| 85 | 'id' => $page->id, |
|
| 86 | 'parent_id' =>$page->parent_id, |
|
| 87 | ], |
|
| 88 | ]; |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ); |
|
| 92 | } |
|
| @@ 265-278 (lines=14) @@ | ||
| 262 | } |
|
| 263 | ||
| 264 | } |
|
| 265 | } else { |
|
| 266 | // no properties selected - go to category edit page |
|
| 267 | if (isset($_GET['last_category_id'])) { |
|
| 268 | $cat = app\modules\shop\models\Category::findById($_GET['last_category_id']); |
|
| 269 | $event->items[] = [ |
|
| 270 | 'label' => Icon::show('pencil') . ' ' . Yii::t('app', 'Edit category'), |
|
| 271 | 'url' => [ |
|
| 272 | '/shop/backend-category/edit', |
|
| 273 | 'id' => $cat->id, |
|
| 274 | 'parent_id' => $cat->parent_id, |
|
| 275 | ], |
|
| 276 | ]; |
|
| 277 | } |
|
| 278 | } |
|
| 279 | break; |
|
| 280 | case 'shop/product/show': |
|
| 281 | if (isset($_GET['model_id'])) { |
|