Commit 3e6486def62086435043fdd28f1ab425c62b48f5
1 parent
46b1243b
-Gallery attached to core's pages
Showing
15 changed files
with
29 additions
and
19 deletions
Show diff stats
.gitignore
backend/views/layouts/main.php
@@ -6,11 +6,11 @@ | @@ -6,11 +6,11 @@ | ||
6 | */ | 6 | */ |
7 | 7 | ||
8 | use artbox\core\assets\ArtboxCoreAsset; | 8 | use artbox\core\assets\ArtboxCoreAsset; |
9 | + use artbox\core\components\imagemanager\components\ImageManagerGetPath; | ||
9 | use artbox\core\models\User; | 10 | use artbox\core\models\User; |
10 | use artbox\core\models\UserData; | 11 | use artbox\core\models\UserData; |
11 | use artbox\core\widgets\FeedbackWidget; | 12 | use artbox\core\widgets\FeedbackWidget; |
12 | use artbox\core\widgets\FlashWidget; | 13 | use artbox\core\widgets\FlashWidget; |
13 | - use noam148\imagemanager\components\ImageManagerGetPath; | ||
14 | use yii\bootstrap\Html; | 14 | use yii\bootstrap\Html; |
15 | use yii\web\View; | 15 | use yii\web\View; |
16 | use yii\widgets\Breadcrumbs; | 16 | use yii\widgets\Breadcrumbs; |
@@ -31,11 +31,15 @@ | @@ -31,11 +31,15 @@ | ||
31 | ], | 31 | ], |
32 | [ | 32 | [ |
33 | 'label' => \Yii::t('core', 'Static pages'), | 33 | 'label' => \Yii::t('core', 'Static pages'), |
34 | - 'url' => [ 'page/index' ], | 34 | + 'url' => '#', |
35 | 'icon' => 'file-text', | 35 | 'icon' => 'file-text', |
36 | - 'active' => function () { | ||
37 | - return \Yii::$app->controller->id === 'page'; | ||
38 | - }, | 36 | + 'items' => [ |
37 | + [ | ||
38 | + 'label' => \Yii::t('core', 'Static pages'), | ||
39 | + 'url' => [ '/page/index' ], | ||
40 | + 'icon' => 'file-text', | ||
41 | + ] | ||
42 | + ], | ||
39 | ], | 43 | ], |
40 | [ | 44 | [ |
41 | 'label' => \Yii::t('core', 'SEO'), | 45 | 'label' => \Yii::t('core', 'SEO'), |
@@ -44,17 +48,17 @@ | @@ -44,17 +48,17 @@ | ||
44 | 'items' => [ | 48 | 'items' => [ |
45 | [ | 49 | [ |
46 | 'label' => \Yii::t('core', 'Seo pages'), | 50 | 'label' => \Yii::t('core', 'Seo pages'), |
47 | - 'url' => [ 'alias/index' ], | 51 | + 'url' => [ '/alias/index' ], |
48 | 'icon' => 'file-text', | 52 | 'icon' => 'file-text', |
49 | ], | 53 | ], |
50 | [ | 54 | [ |
51 | 'label' => \Yii::t('core', 'Robots'), | 55 | 'label' => \Yii::t('core', 'Robots'), |
52 | - 'url' => [ 'settings/robots' ], | 56 | + 'url' => [ '/settings/robots' ], |
53 | 'icon' => 'android', | 57 | 'icon' => 'android', |
54 | ], | 58 | ], |
55 | [ | 59 | [ |
56 | 'label' => \Yii::t('core', 'Codes'), | 60 | 'label' => \Yii::t('core', 'Codes'), |
57 | - 'url' => [ 'settings/codes' ], | 61 | + 'url' => [ '/settings/codes' ], |
58 | 'icon' => 'code', | 62 | 'icon' => 'code', |
59 | ], | 63 | ], |
60 | [ | 64 | [ |
@@ -64,5 +68,10 @@ | @@ -64,5 +68,10 @@ | ||
64 | ], | 68 | ], |
65 | ], | 69 | ], |
66 | ], | 70 | ], |
71 | + [ | ||
72 | + 'label' => \Yii::t('core', 'Image manager'), | ||
73 | + 'url' => [ '/imagemanager' ], | ||
74 | + 'icon' => 'image', | ||
75 | + ], | ||
67 | ] | 76 | ] |
68 | ); | 77 | ); |
69 | \ No newline at end of file | 78 | \ No newline at end of file |
backend/views/settings/_main_tab.php
1 | <?php | 1 | <?php |
2 | + use artbox\core\components\imagemanager\components\ImageManagerInputWidget; | ||
2 | use common\models\Settings; | 3 | use common\models\Settings; |
3 | use yii\bootstrap\ActiveForm; | 4 | use yii\bootstrap\ActiveForm; |
4 | use yii\web\View; | 5 | use yii\web\View; |
@@ -12,7 +13,7 @@ | @@ -12,7 +13,7 @@ | ||
12 | ->textInput(); | 13 | ->textInput(); |
13 | echo $form->field($model, 'logo') | 14 | echo $form->field($model, 'logo') |
14 | ->widget( | 15 | ->widget( |
15 | - \noam148\imagemanager\components\ImageManagerInputWidget::className(), | 16 | + ImageManagerInputWidget::className(), |
16 | [ | 17 | [ |
17 | 'showPreview' => true, | 18 | 'showPreview' => true, |
18 | 'showDeletePickedImageConfirm' => false, | 19 | 'showDeletePickedImageConfirm' => false, |
common/config/.gitignore
common/config/main.php
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', | 5 | 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
6 | 'modules' => [ | 6 | 'modules' => [ |
7 | 'imagemanager' => [ | 7 | 'imagemanager' => [ |
8 | - 'class' => 'noam148\imagemanager\Module', | 8 | + 'class' => 'artbox\core\components\imagemanager\Module', |
9 | 'canUploadImage' => true, | 9 | 'canUploadImage' => true, |
10 | 'canRemoveImage' => function () { | 10 | 'canRemoveImage' => function () { |
11 | return true; | 11 | return true; |
@@ -45,9 +45,9 @@ | @@ -45,9 +45,9 @@ | ||
45 | 'class' => SeoComponent::className(), | 45 | 'class' => SeoComponent::className(), |
46 | ], | 46 | ], |
47 | 'imagemanager' => [ | 47 | 'imagemanager' => [ |
48 | - 'class' => 'noam148\imagemanager\components\ImageManagerGetPath', | ||
49 | - 'mediaPath' => dirname(dirname(__DIR__)) . '/common/images', | ||
50 | - 'cachePath' => 'assets/images', | 48 | + 'class' => 'artbox\core\components\imagemanager\components\ImageManagerGetPath', |
49 | + 'mediaPath' => dirname(dirname(__DIR__)) . '/storage', | ||
50 | + 'cachePath' => '../../storage/cache', | ||
51 | 'useFilename' => true, | 51 | 'useFilename' => true, |
52 | 'absoluteUrl' => false, | 52 | 'absoluteUrl' => false, |
53 | ], | 53 | ], |
common/models/Settings.php
@@ -18,7 +18,6 @@ | @@ -18,7 +18,6 @@ | ||
18 | "minimum-stability": "stable", | 18 | "minimum-stability": "stable", |
19 | "require": { | 19 | "require": { |
20 | "php": ">=7.0", | 20 | "php": ">=7.0", |
21 | - "artweb/artbox-core": "~0.0.1", | ||
22 | "yiisoft/yii2": "~2.0", | 21 | "yiisoft/yii2": "~2.0", |
23 | "yiisoft/yii2-bootstrap": "~2.0", | 22 | "yiisoft/yii2-bootstrap": "~2.0", |
24 | "yiisoft/yii2-swiftmailer": "~2.0", | 23 | "yiisoft/yii2-swiftmailer": "~2.0", |
frontend/views/layouts/main.php
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | use artbox\core\models\User; | 12 | use artbox\core\models\User; |
13 | use common\models\Settings; | 13 | use common\models\Settings; |
14 | use frontend\assets\AppAsset; | 14 | use frontend\assets\AppAsset; |
15 | - use noam148\imagemanager\models\ImageManager; | 15 | + use artbox\core\components\imagemanager\models\ImageManager; |
16 | use yii\bootstrap\ActiveForm; | 16 | use yii\bootstrap\ActiveForm; |
17 | use yii\bootstrap\Nav; | 17 | use yii\bootstrap\Nav; |
18 | use yii\bootstrap\Html; | 18 | use yii\bootstrap\Html; |
@@ -78,7 +78,7 @@ | @@ -78,7 +78,7 @@ | ||
78 | m.parentNode.insertBefore(a, m) | 78 | m.parentNode.insertBefore(a, m) |
79 | })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); | 79 | })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); |
80 | 80 | ||
81 | - ga('create', <?=$settings->ga_code?>, 'auto'); | 81 | + ga('create', '<?=$settings->ga_code?>', 'auto'); |
82 | ga('send', 'pageview'); | 82 | ga('send', 'pageview'); |
83 | 83 | ||
84 | </script> | 84 | </script> |