Commit f3f451c2fbe52370ab3e78b4b44db41b0403e6f5

Authored by Yarik
1 parent 209452f4

Groups completed

backend/config/main.php
... ... @@ -17,16 +17,24 @@
17 17 'controllerNamespace' => 'backend\controllers',
18 18 'bootstrap' => [ 'log' ],
19 19 'controllerMap' => [
20   - 'profile' => 'artbox\core\controllers\ProfileController',
21   - 'page' => 'artbox\core\controllers\PageController',
22   - 'alias' => 'artbox\core\controllers\AliasController',
23   - 'seo' => 'artbox\core\controllers\SeoController',
24   - 'feedback' => 'artbox\core\controllers\FeedbackController',
25   - 'weblog-article' => 'artbox\weblog\controllers\ArticleController',
26   - 'category' => 'artbox\catalog\controllers\CategoryController',
27   - 'brand' => 'artbox\catalog\controllers\BrandController',
28   - 'product' => 'artbox\catalog\controllers\ProductController',
29   - 'variant' => 'artbox\catalog\controllers\VariantController',
  20 + 'profile' => 'artbox\core\controllers\ProfileController',
  21 + 'page' => 'artbox\core\controllers\PageController',
  22 + 'alias' => 'artbox\core\controllers\AliasController',
  23 + 'seo' => 'artbox\core\controllers\SeoController',
  24 + 'feedback' => 'artbox\core\controllers\FeedbackController',
  25 + 'weblog-article' => 'artbox\weblog\controllers\ArticleController',
  26 + 'category' => 'artbox\catalog\controllers\CategoryController',
  27 + 'brand' => 'artbox\catalog\controllers\BrandController',
  28 + 'product' => 'artbox\catalog\controllers\ProductController',
  29 + 'variant' => 'artbox\catalog\controllers\VariantController',
  30 + 'variant-option-group-complementary' => 'artbox\catalog\controllers\VariantOptionGroupComplController',
  31 + 'variant-option-group-exclusion' => 'artbox\catalog\controllers\VariantOptionGroupExclController',
  32 + 'product-option-group-complementary' => 'artbox\catalog\controllers\ProductOptionGroupComplController',
  33 + 'product-option-group-exclusion' => 'artbox\catalog\controllers\ProductOptionGroupExclController',
  34 + 'variant-option-complementary' => 'artbox\catalog\controllers\VariantOptionComplController',
  35 + 'variant-option-exclusion' => 'artbox\catalog\controllers\VariantOptionExclController',
  36 + 'product-option-complementary' => 'artbox\catalog\controllers\ProductOptionComplController',
  37 + 'product-option-exclusion' => 'artbox\catalog\controllers\ProductOptionExclController',
30 38 ],
31 39 'components' => [
32 40 'assetManager' => [
... ...
backend/views/layouts/main.php
... ... @@ -12,7 +12,6 @@
12 12 use artbox\core\widgets\FlashWidget;
13 13 use noam148\imagemanager\components\ImageManagerGetPath;
14 14 use yii\bootstrap\Html;
15   - use yii\web\UrlManager;
16 15 use yii\web\View;
17 16 use yii\widgets\Breadcrumbs;
18 17 use yiister\gentelella\widgets\Menu;
... ... @@ -114,86 +113,9 @@
114 113  
115 114 <div class="menu_section">
116 115 <?php
117   - $homeLink = [];
118   - /**
119   - * @var UrlManager $urlManagerFrontend
120   - */
121   - if ($urlManagerFrontend = \Yii::$app->get('urlManagerFrontend', false)) {
122   - $homeLink = [
123   - [
124   - 'label' => \Yii::t('core', 'My website'),
125   - 'url' => $urlManagerFrontend->createUrl([ 'site/index' ]),
126   - 'icon' => 'home',
127   - 'template' => '<a href="{url}" target="_blank">{icon}<span>{label}</span>{badge}</a>',
128   - 'options' => [
129   - 'class' => 'homepage_link',
130   - ],
131   - ],
132   - ];
133   - }
134   - $menuItems = array_merge(
135   - $homeLink,
136   - [
137   - [
138   - 'label' => \Yii::t('core', 'Main'),
139   - 'url' => [ '/site/index' ],
140   - 'icon' => ( \Yii::$app->controller->id === 'site' ) ? 'check' : 'undo',
141   - 'active' => function () {
142   - return \Yii::$app->controller->id === 'site';
143   - },
144   - ],
145   - [
146   - 'label' => \Yii::t('core', 'Static pages'),
147   - 'url' => [ 'page/index' ],
148   - 'icon' => 'file-text',
149   - 'active' => function () {
150   - return \Yii::$app->controller->id === 'page';
151   - },
152   - ],
153   - [
154   - 'label' => \Yii::t('core', 'SEO'),
155   - 'url' => '#',
156   - 'icon' => 'bolt',
157   - 'items' => [
158   - [
159   - 'label' => \Yii::t('core', 'Seo pages'),
160   - 'url' => [ 'alias/index' ],
161   - 'icon' => 'file-text',
162   - ],
163   - [
164   - 'label' => \Yii::t('core', 'Robots'),
165   - 'url' => [ 'settings/robots' ],
166   - 'icon' => 'android',
167   - ],
168   - [
169   - 'label' => \Yii::t('core', 'Codes'),
170   - 'url' => [ 'settings/codes' ],
171   - 'icon' => 'code',
172   - ],
173   - [
174   - 'label' => \Yii::t('core', 'Sitemap'),
175   - 'url' => [ '/sitemap/index' ],
176   - 'icon' => 'map-signs',
177   - ],
178   - ],
179   - ],
180   - [
181   - 'label' => \Yii::t('app', 'SEO'),
182   - 'url' => '#',
183   - 'icon' => 'bolt',
184   - 'items' => [
185   - [
186   - 'label' => \Yii::t('core', 'Category'),
187   - 'url' => [ 'category/index' ],
188   - 'icon' => 'file-text',
189   - ],
190   - ],
191   - ],
192   - ]
193   - );
194 116 echo Menu::widget(
195 117 [
196   - "items" => $menuItems,
  118 + "items" => require( 'menu_items.php' ),
197 119 ]
198 120 ); ?>
199 121 </div>
... ...
backend/views/layouts/menu_items.php 0 โ†’ 100644
  1 +<?php
  2 + use yii\web\UrlManager;
  3 +
  4 + $homeLink = [];
  5 + /**
  6 + * @var UrlManager $urlManagerFrontend
  7 + */
  8 + if ($urlManagerFrontend = \Yii::$app->get('urlManagerFrontend', false)) {
  9 + $homeLink = [
  10 + [
  11 + 'label' => \Yii::t('core', 'My website'),
  12 + 'url' => $urlManagerFrontend->createUrl([ 'site/index' ]),
  13 + 'icon' => 'home',
  14 + 'template' => '<a href="{url}" target="_blank">{icon}<span>{label}</span>{badge}</a>',
  15 + 'options' => [
  16 + 'class' => 'homepage_link',
  17 + ],
  18 + ],
  19 + ];
  20 + }
  21 + return array_merge(
  22 + $homeLink,
  23 + [
  24 + [
  25 + 'label' => \Yii::t('core', 'Main'),
  26 + 'url' => [ '/site/index' ],
  27 + 'icon' => ( \Yii::$app->controller->id === 'site' ) ? 'check' : 'undo',
  28 + 'active' => function () {
  29 + return \Yii::$app->controller->id === 'site';
  30 + },
  31 + ],
  32 + [
  33 + 'label' => \Yii::t('core', 'Static pages'),
  34 + 'url' => [ 'page/index' ],
  35 + 'icon' => 'file-text',
  36 + 'active' => function () {
  37 + return \Yii::$app->controller->id === 'page';
  38 + },
  39 + ],
  40 + [
  41 + 'label' => \Yii::t('core', 'SEO'),
  42 + 'url' => '#',
  43 + 'icon' => 'bolt',
  44 + 'items' => [
  45 + [
  46 + 'label' => \Yii::t('core', 'Seo pages'),
  47 + 'url' => [ 'alias/index' ],
  48 + 'icon' => 'file-text',
  49 + ],
  50 + [
  51 + 'label' => \Yii::t('core', 'Robots'),
  52 + 'url' => [ 'settings/robots' ],
  53 + 'icon' => 'android',
  54 + ],
  55 + [
  56 + 'label' => \Yii::t('core', 'Codes'),
  57 + 'url' => [ 'settings/codes' ],
  58 + 'icon' => 'code',
  59 + ],
  60 + [
  61 + 'label' => \Yii::t('core', 'Sitemap'),
  62 + 'url' => [ '/sitemap/index' ],
  63 + 'icon' => 'map-signs',
  64 + ],
  65 + ],
  66 + ],
  67 + [
  68 + 'label' => \Yii::t('app', 'SEO'),
  69 + 'url' => '#',
  70 + 'icon' => 'bolt',
  71 + 'items' => [
  72 + [
  73 + 'label' => \Yii::t('core', 'Category'),
  74 + 'url' => [ 'category/index' ],
  75 + 'icon' => 'file-text',
  76 + ],
  77 + ],
  78 + ],
  79 + [
  80 + 'label' => \Yii::t('app', 'Options'),
  81 + 'url' => '#',
  82 + 'icon' => 'filter',
  83 + 'items' => [
  84 + [
  85 + 'label' => \Yii::t('app', 'Options for products'),
  86 + 'url' => '#',
  87 + 'items' => [
  88 + [
  89 + 'label' => \Yii::t('app', 'Complementary'),
  90 + 'url' => [ 'product-option-group-complementary/index' ],
  91 + ],
  92 + [
  93 + 'label' => \Yii::t('app', 'Exclusion'),
  94 + 'url' => [ 'product-option-group-exclusion/index' ],
  95 + ],
  96 + ],
  97 + ],
  98 + [
  99 + 'label' => \Yii::t('app', 'Options for variants'),
  100 + 'url' => '#',
  101 + 'items' => [
  102 + [
  103 + 'label' => \Yii::t('app', 'Complementary'),
  104 + 'url' => [ 'variant-option-group-complementary/index' ],
  105 + ],
  106 + [
  107 + 'label' => \Yii::t('app', 'Exclusion'),
  108 + 'url' => [ 'variant-option-group-exclusion/index' ],
  109 + ],
  110 + ],
  111 + ],
  112 + ],
  113 + ],
  114 + ]
  115 + );
0 116 \ No newline at end of file
... ...