Commit 8846484c5e6c3ef0b21791d12f592a231e137555
Merge remote-tracking branch 'origin/master'
Showing
18 changed files
with
416 additions
and
60 deletions
Show diff stats
backend/config/main.php
1 | <?php | 1 | <?php |
2 | + use artbox\core\components\SeoUrlManager; | ||
2 | use artbox\core\models\Page; | 3 | use artbox\core\models\Page; |
3 | use common\components\Sitemap; | 4 | use common\components\Sitemap; |
4 | - use yii\web\UrlManager; | ||
5 | 5 | ||
6 | $params = array_merge( | 6 | $params = array_merge( |
7 | require( __DIR__ . '/../../common/config/params.php' ), | 7 | require( __DIR__ . '/../../common/config/params.php' ), |
@@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
97 | 'rules' => [], | 97 | 'rules' => [], |
98 | ], | 98 | ], |
99 | 'urlManagerFrontend' => [ | 99 | 'urlManagerFrontend' => [ |
100 | - 'class' => UrlManager::className(), | 100 | + 'class' => SeoUrlManager::className(), |
101 | 'baseUrl' => '/', | 101 | 'baseUrl' => '/', |
102 | 'enablePrettyUrl' => true, | 102 | 'enablePrettyUrl' => true, |
103 | 'showScriptName' => false, | 103 | 'showScriptName' => false, |
@@ -111,7 +111,7 @@ | @@ -111,7 +111,7 @@ | ||
111 | 'conditions' => [ | 111 | 'conditions' => [ |
112 | [ 'in_menu' => 1 ], | 112 | [ 'in_menu' => 1 ], |
113 | ], | 113 | ], |
114 | - 'url' => 'site/page', | 114 | + 'url' => 'page/view', |
115 | ], | 115 | ], |
116 | ], | 116 | ], |
117 | ], | 117 | ], |
backend/controllers/SitemapController.php
@@ -156,6 +156,7 @@ | @@ -156,6 +156,7 @@ | ||
156 | if (isset( $old_entity_models[ $entity_model->entity ] )) { | 156 | if (isset( $old_entity_models[ $entity_model->entity ] )) { |
157 | $entity_model->status = $old_entity_models[ $entity_model->entity ]->status; | 157 | $entity_model->status = $old_entity_models[ $entity_model->entity ]->status; |
158 | $entity_model->priority = $old_entity_models[ $entity_model->entity ]->priority; | 158 | $entity_model->priority = $old_entity_models[ $entity_model->entity ]->priority; |
159 | + $entity_model->frequency = $old_entity_models[ $entity_model->entity ]->frequency; | ||
159 | } | 160 | } |
160 | } | 161 | } |
161 | // ***** <<< End | 162 | // ***** <<< End |
@@ -190,7 +191,7 @@ | @@ -190,7 +191,7 @@ | ||
190 | "[$count]url", | 191 | "[$count]url", |
191 | [ | 192 | [ |
192 | 'options' => [ | 193 | 'options' => [ |
193 | - 'class' => 'form-group col-xs-8 col-sm-9', | 194 | + 'class' => 'form-group col-xs-5 col-sm-6', |
194 | ], | 195 | ], |
195 | ] | 196 | ] |
196 | ) | 197 | ) |
@@ -198,6 +199,27 @@ | @@ -198,6 +199,27 @@ | ||
198 | ->render(); | 199 | ->render(); |
199 | $content .= $form->field( | 200 | $content .= $form->field( |
200 | $model, | 201 | $model, |
202 | + "[$count]frequency", | ||
203 | + [ | ||
204 | + 'options' => [ | ||
205 | + 'class' => 'form-group col-xs-3 col-sm-3', | ||
206 | + ], | ||
207 | + ] | ||
208 | + ) | ||
209 | + ->dropDownList( | ||
210 | + [ | ||
211 | + 'always' => 'always', | ||
212 | + 'hourly' => 'hourly', | ||
213 | + 'daily' => 'daily', | ||
214 | + 'weekly' => 'weekly', | ||
215 | + 'monthly' => 'monthly', | ||
216 | + 'yearly' => 'yearly', | ||
217 | + 'never' => 'never', | ||
218 | + ] | ||
219 | + ) | ||
220 | + ->render(); | ||
221 | + $content .= $form->field( | ||
222 | + $model, | ||
201 | "[$count]priority", | 223 | "[$count]priority", |
202 | [ | 224 | [ |
203 | 'options' => [ | 225 | 'options' => [ |
1 | +<?php | ||
2 | + use common\models\Settings; | ||
3 | + use yii\bootstrap\ActiveForm; | ||
4 | + use yii\web\View; | ||
5 | + | ||
6 | + /** | ||
7 | + * @var View $this | ||
8 | + * @var Settings $model | ||
9 | + * @var ActiveForm $form | ||
10 | + */ | ||
11 | + echo $form->field($model, 'analytics_key') | ||
12 | + ->textInput(); | ||
0 | \ No newline at end of file | 13 | \ No newline at end of file |
1 | +<?php | ||
2 | + use common\models\Settings; | ||
3 | + use yii\bootstrap\ActiveForm; | ||
4 | + use yii\web\View; | ||
5 | + | ||
6 | + /** | ||
7 | + * @var View $this | ||
8 | + * @var Settings $model | ||
9 | + * @var ActiveForm $form | ||
10 | + */ | ||
11 | + echo $form->field($model, 'phone') | ||
12 | + ->textInput() | ||
13 | + ->hint(\Yii::t('core', 'Contact phone for website')); | ||
14 | + echo $form->field($model, 'phone2') | ||
15 | + ->textInput() | ||
16 | + ->hint(\Yii::t('core', 'Contact phone for website')); | ||
17 | + echo $form->field($model, 'email') | ||
18 | + ->textInput() | ||
19 | + ->hint(\Yii::t('core', 'Contact email for website')); | ||
20 | + echo $form->field($model, 'skype') | ||
21 | + ->textInput(); | ||
22 | + echo $form->field($model, 'house') | ||
23 | + ->textInput(); | ||
24 | + echo $form->field($model, 'street') | ||
25 | + ->textInput(); | ||
26 | + echo $form->field($model, 'office') | ||
27 | + ->textInput(); | ||
28 | + echo $form->field($model, 'city') | ||
29 | + ->textInput(); | ||
30 | + echo $form->field($model, 'lat') | ||
31 | + ->textInput(); | ||
32 | + echo $form->field($model, 'lon') | ||
33 | + ->textInput(); | ||
34 | + | ||
0 | \ No newline at end of file | 35 | \ No newline at end of file |
1 | +<?php | ||
2 | + use common\models\Settings; | ||
3 | + use yii\bootstrap\ActiveForm; | ||
4 | + use yii\web\View; | ||
5 | + | ||
6 | + /** | ||
7 | + * @var View $this | ||
8 | + * @var Settings $model | ||
9 | + * @var ActiveForm $form | ||
10 | + */ | ||
11 | + echo $form->field($model, 'name') | ||
12 | + ->textInput(); | ||
13 | + echo $form->field($model, 'logo') | ||
14 | + ->widget( | ||
15 | + \noam148\imagemanager\components\ImageManagerInputWidget::className(), | ||
16 | + [ | ||
17 | + 'showPreview' => true, | ||
18 | + 'showDeletePickedImageConfirm' => false, | ||
19 | + ] | ||
20 | + ); | ||
21 | + echo $form->field($model, 'about') | ||
22 | + ->textarea(); | ||
0 | \ No newline at end of file | 23 | \ No newline at end of file |
1 | +<?php | ||
2 | + use common\models\Settings; | ||
3 | + use yii\bootstrap\ActiveForm; | ||
4 | + use yii\web\View; | ||
5 | + | ||
6 | + /** | ||
7 | + * @var View $this | ||
8 | + * @var Settings $model | ||
9 | + * @var ActiveForm $form | ||
10 | + */ | ||
11 | + echo $form->field($model, 'facebook') | ||
12 | + ->textInput(); | ||
13 | + echo $form->field($model, 'vk') | ||
14 | + ->textInput(); | ||
15 | + echo $form->field($model, 'google') | ||
16 | + ->textInput(); | ||
17 | + echo $form->field($model, 'twitter') | ||
18 | + ->textInput(); | ||
19 | + echo $form->field($model, 'ok') | ||
20 | + ->textInput(); | ||
0 | \ No newline at end of file | 21 | \ No newline at end of file |
backend/views/settings/settings.php
@@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
8 | use artbox\gentelella\widgets\XPanel; | 8 | use artbox\gentelella\widgets\XPanel; |
9 | use yii\bootstrap\ActiveForm; | 9 | use yii\bootstrap\ActiveForm; |
10 | use yii\bootstrap\Html; | 10 | use yii\bootstrap\Html; |
11 | + use yii\bootstrap\Tabs; | ||
11 | use yii\web\View; | 12 | use yii\web\View; |
12 | 13 | ||
13 | $this->title = 'Settings'; | 14 | $this->title = 'Settings'; |
@@ -26,19 +27,57 @@ | @@ -26,19 +27,57 @@ | ||
26 | 27 | ||
27 | <?php | 28 | <?php |
28 | $form = ActiveForm::begin(); | 29 | $form = ActiveForm::begin(); |
29 | - | ||
30 | - echo $form->field($model, 'id') | ||
31 | - ->textInput(); | ||
32 | - | ||
33 | - echo $form->field($model, 'name') | ||
34 | - ->textInput(); | ||
35 | - | ||
36 | - echo $form->field($model, 'description') | ||
37 | - ->textInput(); | ||
38 | 30 | ||
39 | - echo $form->field($model, 'analytics_key') | ||
40 | - ->textInput(); | ||
41 | - | 31 | + echo Tabs::widget( |
32 | + [ | ||
33 | + 'options' => [ | ||
34 | + 'class' => 'bar_tabs', | ||
35 | + ], | ||
36 | + 'items' => [ | ||
37 | + [ | ||
38 | + 'label' => \Yii::t('core', 'Main'), | ||
39 | + 'content' => $this->render( | ||
40 | + '_main_tab', | ||
41 | + [ | ||
42 | + 'model' => $model, | ||
43 | + 'form' => $form, | ||
44 | + ] | ||
45 | + ), | ||
46 | + ], | ||
47 | + [ | ||
48 | + 'label' => \Yii::t('core', 'Contact'), | ||
49 | + 'content' => $this->render( | ||
50 | + '_contact_tab', | ||
51 | + [ | ||
52 | + 'model' => $model, | ||
53 | + 'form' => $form, | ||
54 | + ] | ||
55 | + ), | ||
56 | + ], | ||
57 | + [ | ||
58 | + 'label' => \Yii::t('core', 'Social'), | ||
59 | + 'content' => $this->render( | ||
60 | + '_social_tab', | ||
61 | + [ | ||
62 | + 'model' => $model, | ||
63 | + 'form' => $form, | ||
64 | + ] | ||
65 | + ), | ||
66 | + ], | ||
67 | + [ | ||
68 | + 'label' => \Yii::t('core', 'Codes'), | ||
69 | + 'content' => $this->render( | ||
70 | + '_codes_tab', | ||
71 | + [ | ||
72 | + 'model' => $model, | ||
73 | + 'form' => $form, | ||
74 | + ] | ||
75 | + ), | ||
76 | + ], | ||
77 | + ], | ||
78 | + ] | ||
79 | + ); | ||
80 | + | ||
42 | echo Html::submitButton( | 81 | echo Html::submitButton( |
43 | 'Save', | 82 | 'Save', |
44 | [ | 83 | [ |
backend/views/sitemap/index.php
1 | <?php | 1 | <?php |
2 | use artbox\gentelella\widgets\XPanel; | 2 | use artbox\gentelella\widgets\XPanel; |
3 | + use common\components\Sitemap; | ||
3 | use yii\bootstrap\Html; | 4 | use yii\bootstrap\Html; |
4 | use yii\web\View; | 5 | use yii\web\View; |
5 | 6 | ||
@@ -8,6 +9,10 @@ | @@ -8,6 +9,10 @@ | ||
8 | */ | 9 | */ |
9 | $this->title = \Yii::t('core', 'Sitemap'); | 10 | $this->title = \Yii::t('core', 'Sitemap'); |
10 | $this->params[ 'breadcrumbs' ][] = $this->title; | 11 | $this->params[ 'breadcrumbs' ][] = $this->title; |
12 | + /** | ||
13 | + * @var Sitemap $sitemap | ||
14 | + */ | ||
15 | + $sitemap = \Yii::$app->get('sitemap'); | ||
11 | ?> | 16 | ?> |
12 | <div class="sitemap-main"> | 17 | <div class="sitemap-main"> |
13 | <?php | 18 | <?php |
@@ -63,12 +68,32 @@ | @@ -63,12 +68,32 @@ | ||
63 | [ 'generate' ], | 68 | [ 'generate' ], |
64 | [ | 69 | [ |
65 | 'class' => 'btn btn-app ajax', | 70 | 'class' => 'btn btn-app ajax', |
71 | + 'data' => [ | ||
72 | + 'need-reload' => !$sitemap->checkFileExist(), | ||
73 | + ], | ||
66 | ] | 74 | ] |
67 | ); | 75 | ); |
68 | ?> | 76 | ?> |
69 | </div> | 77 | </div> |
70 | </div> | 78 | </div> |
71 | <?php | 79 | <?php |
80 | + if ($sitemap->checkFileExist()) { | ||
81 | + echo Html::tag( | ||
82 | + 'div', | ||
83 | + Html::a( | ||
84 | + \Yii::t('core', 'View generated sitemap.xml'), | ||
85 | + $sitemap->getUrl(), | ||
86 | + [ | ||
87 | + 'target' => '_blank', | ||
88 | + ] | ||
89 | + ), | ||
90 | + [ | ||
91 | + 'class' => 'row text-right', | ||
92 | + ] | ||
93 | + ); | ||
94 | + } | ||
95 | + ?> | ||
96 | + <?php | ||
72 | $xPanel::end(); | 97 | $xPanel::end(); |
73 | ?> | 98 | ?> |
74 | </div> | 99 | </div> |
backend/views/sitemap/update.php
@@ -36,12 +36,31 @@ | @@ -36,12 +36,31 @@ | ||
36 | "[$index]url", | 36 | "[$index]url", |
37 | [ | 37 | [ |
38 | 'options' => [ | 38 | 'options' => [ |
39 | - 'class' => 'form-group col-xs-8 col-sm-9', | 39 | + 'class' => 'form-group col-xs-5 col-sm-6', |
40 | ], | 40 | ], |
41 | ] | 41 | ] |
42 | ) | 42 | ) |
43 | ->textInput() . $form->field( | 43 | ->textInput() . $form->field( |
44 | $model, | 44 | $model, |
45 | + "[$index]frequency", | ||
46 | + [ | ||
47 | + 'options' => [ | ||
48 | + 'class' => 'form-group col-xs-3 col-sm-3', | ||
49 | + ], | ||
50 | + ] | ||
51 | + ) | ||
52 | + ->dropDownList( | ||
53 | + [ | ||
54 | + 'always' => 'always', | ||
55 | + 'hourly' => 'hourly', | ||
56 | + 'daily' => 'daily', | ||
57 | + 'weekly' => 'weekly', | ||
58 | + 'monthly' => 'monthly', | ||
59 | + 'yearly' => 'yearly', | ||
60 | + 'never' => 'never', | ||
61 | + ] | ||
62 | + ) . $form->field( | ||
63 | + $model, | ||
45 | "[$index]priority", | 64 | "[$index]priority", |
46 | [ | 65 | [ |
47 | 'options' => [ | 66 | 'options' => [ |
@@ -49,7 +68,7 @@ | @@ -49,7 +68,7 @@ | ||
49 | ], | 68 | ], |
50 | ] | 69 | ] |
51 | ) | 70 | ) |
52 | - ->textInput() . Html::icon( | 71 | + ->textInput() . Html::icon( |
53 | 'minus', | 72 | 'minus', |
54 | [ | 73 | [ |
55 | 'class' => 'col-xs-1 field-group-remove', | 74 | 'class' => 'col-xs-1 field-group-remove', |
@@ -85,7 +104,7 @@ | @@ -85,7 +104,7 @@ | ||
85 | <?php | 104 | <?php |
86 | foreach ($entity_models as $index => $entity_model) { | 105 | foreach ($entity_models as $index => $entity_model) { |
87 | ?> | 106 | ?> |
88 | - <div class="form-group col-xs-9 col-sm-10"> | 107 | + <div class="form-group col-xs-6 col-sm-8"> |
89 | <?php | 108 | <?php |
90 | echo Html::tag( | 109 | echo Html::tag( |
91 | 'div', | 110 | 'div', |
@@ -118,6 +137,23 @@ | @@ -118,6 +137,23 @@ | ||
118 | </div> | 137 | </div> |
119 | <div class="form-group col-xs-3 col-sm-2"> | 138 | <div class="form-group col-xs-3 col-sm-2"> |
120 | <?php | 139 | <?php |
140 | + echo $form->field($entity_model, "[$index]frequency") | ||
141 | + ->label(false) | ||
142 | + ->dropDownList( | ||
143 | + [ | ||
144 | + 'always' => 'always', | ||
145 | + 'hourly' => 'hourly', | ||
146 | + 'daily' => 'daily', | ||
147 | + 'weekly' => 'weekly', | ||
148 | + 'monthly' => 'monthly', | ||
149 | + 'yearly' => 'yearly', | ||
150 | + 'never' => 'never', | ||
151 | + ] | ||
152 | + ); | ||
153 | + ?> | ||
154 | + </div> | ||
155 | + <div class="form-group col-xs-3 col-sm-2"> | ||
156 | + <?php | ||
121 | echo $form->field($entity_model, "[$index]priority") | 157 | echo $form->field($entity_model, "[$index]priority") |
122 | ->label(false) | 158 | ->label(false) |
123 | ->input( | 159 | ->input( |
common/components/Sitemap.php
@@ -6,14 +6,38 @@ | @@ -6,14 +6,38 @@ | ||
6 | use yii\base\Object; | 6 | use yii\base\Object; |
7 | use yii\db\ActiveRecord; | 7 | use yii\db\ActiveRecord; |
8 | use yii\helpers\Html; | 8 | use yii\helpers\Html; |
9 | - use yii\helpers\Url; | 9 | + use yii\web\UrlManager; |
10 | 10 | ||
11 | class Sitemap extends Object | 11 | class Sitemap extends Object |
12 | { | 12 | { |
13 | public $entities = []; | 13 | public $entities = []; |
14 | public $path = '@frontend/web/sitemap.xml'; | 14 | public $path = '@frontend/web/sitemap.xml'; |
15 | + public $url = 'sitemap.xml'; | ||
15 | 16 | ||
16 | /** | 17 | /** |
18 | + * Get absolute url to sitemap.xml | ||
19 | + * | ||
20 | + * @return string | ||
21 | + */ | ||
22 | + public function getUrl(): string | ||
23 | + { | ||
24 | + /** | ||
25 | + * @var UrlManager $urlManager | ||
26 | + */ | ||
27 | + $urlManager = \Yii::$app->get('urlManagerFrontend'); | ||
28 | + return $urlManager->createAbsoluteUrl('/' . $this->url); | ||
29 | + } | ||
30 | + | ||
31 | + /** | ||
32 | + * Check whether sitemap.xml exist | ||
33 | + * | ||
34 | + * @return bool | ||
35 | + */ | ||
36 | + public function checkFileExist(): bool | ||
37 | + { | ||
38 | + return file_exists(\Yii::getAlias($this->path)); | ||
39 | + } | ||
40 | + /** | ||
17 | * Generate sitemap XML in $path | 41 | * Generate sitemap XML in $path |
18 | * | 42 | * |
19 | * @return bool | 43 | * @return bool |
@@ -47,6 +71,10 @@ | @@ -47,6 +71,10 @@ | ||
47 | */ | 71 | */ |
48 | public function generateOneShot(): string | 72 | public function generateOneShot(): string |
49 | { | 73 | { |
74 | + /** | ||
75 | + * @var UrlManager $urlManager | ||
76 | + */ | ||
77 | + $urlManager = \Yii::$app->get('urlManagerFrontend'); | ||
50 | $content = '<?xml version="1.0" encoding="UTF-8"?>'; | 78 | $content = '<?xml version="1.0" encoding="UTF-8"?>'; |
51 | $content .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; | 79 | $content .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; |
52 | /** | 80 | /** |
@@ -60,7 +88,7 @@ | @@ -60,7 +88,7 @@ | ||
60 | 'url', | 88 | 'url', |
61 | Html::tag('loc', $item->url) . Html::tag('lastmod', date('Y-m-d')) . Html::tag( | 89 | Html::tag('loc', $item->url) . Html::tag('lastmod', date('Y-m-d')) . Html::tag( |
62 | 'changefreq', | 90 | 'changefreq', |
63 | - 'monthly' | 91 | + $item->frequency |
64 | ) . Html::tag('priority', $item->priority) | 92 | ) . Html::tag('priority', $item->priority) |
65 | ); | 93 | ); |
66 | } | 94 | } |
@@ -100,16 +128,15 @@ | @@ -100,16 +128,15 @@ | ||
100 | 'url', | 128 | 'url', |
101 | Html::tag( | 129 | Html::tag( |
102 | 'loc', | 130 | 'loc', |
103 | - Url::to( | 131 | + $urlManager->createAbsoluteUrl( |
104 | [ | 132 | [ |
105 | $entity[ 'url' ], | 133 | $entity[ 'url' ], |
106 | 'id' => $record->getAttribute('id'), | 134 | 'id' => $record->getAttribute('id'), |
107 | - ], | ||
108 | - true | 135 | + ] |
109 | ) | 136 | ) |
110 | ) . Html::tag('lastmod', date('Y-m-d')) . Html::tag( | 137 | ) . Html::tag('lastmod', date('Y-m-d')) . Html::tag( |
111 | 'changefreq', | 138 | 'changefreq', |
112 | - 'monthly' | 139 | + $model->frequency |
113 | ) . Html::tag('priority', $model->priority) | 140 | ) . Html::tag('priority', $model->priority) |
114 | ); | 141 | ); |
115 | } | 142 | } |
common/config/SitemapDynamic.php
@@ -2,9 +2,10 @@ | @@ -2,9 +2,10 @@ | ||
2 | 2 | ||
3 | return [ | 3 | return [ |
4 | 1 => [ | 4 | 1 => [ |
5 | - 'entity' => 'artbox\\core\\models\\Page', | ||
6 | - 'status' => '1', | ||
7 | - 'priority' => '0.6', | ||
8 | - 'id' => 1, | 5 | + 'entity' => 'artbox\\core\\models\\Page', |
6 | + 'status' => '1', | ||
7 | + 'frequency' => 'hourly', | ||
8 | + 'priority' => '0.7', | ||
9 | + 'id' => 1, | ||
9 | ], | 10 | ], |
10 | ]; | 11 | ]; |
11 | \ No newline at end of file | 12 | \ No newline at end of file |
common/config/SitemapStatic.php
@@ -2,8 +2,15 @@ | @@ -2,8 +2,15 @@ | ||
2 | 2 | ||
3 | return [ | 3 | return [ |
4 | 1 => [ | 4 | 1 => [ |
5 | - 'url' => 'http://www.artbox.dev/', | ||
6 | - 'priority' => '1', | ||
7 | - 'id' => 1, | 5 | + 'url' => 'http://www.artbox.dev/', |
6 | + 'frequency' => 'monthly', | ||
7 | + 'priority' => '1', | ||
8 | + 'id' => 1, | ||
9 | + ], | ||
10 | + 2 => [ | ||
11 | + 'url' => 'http://www.artbox.dev/site/contacts', | ||
12 | + 'frequency' => 'monthly', | ||
13 | + 'priority' => '0.7', | ||
14 | + 'id' => 2, | ||
8 | ], | 15 | ], |
9 | ]; | 16 | ]; |
10 | \ No newline at end of file | 17 | \ No newline at end of file |
common/config/settings.php
@@ -2,17 +2,32 @@ | @@ -2,17 +2,32 @@ | ||
2 | 2 | ||
3 | return [ | 3 | return [ |
4 | 1 => [ | 4 | 1 => [ |
5 | - 'id' => '1', | ||
6 | - 'name' => 'Admin321', | ||
7 | - 'description' => 'Site administrator', | 5 | + 'phone' => '+38 (044) 593-73-76', |
6 | + 'phone2' => '+38 (098) 468-07-64', | ||
7 | + 'skype' => 'artwebstudio', | ||
8 | + 'email' => 'artweb.ua@gmail.com', | ||
9 | + 'house' => '1-М', | ||
10 | + 'street' => 'пр. М. Бажана', | ||
11 | + 'office' => '25', | ||
12 | + 'city' => 'Киев', | ||
13 | + 'country' => '', | ||
14 | + 'lat' => '50.409382', | ||
15 | + 'lon' => '30.646391', | ||
16 | + 'facebook' => 'https://www.facebook.com/ArtWeb.ua/', | ||
17 | + 'vk' => 'https://vk.com/artwebua', | ||
18 | + 'ok' => 'https://ok.ru/artwebua', | ||
19 | + 'google' => 'https://plus.google.com/+ArtwebUaAgency', | ||
20 | + 'twitter' => 'https://twitter.com/ArtWeb_ua', | ||
21 | + 'name' => 'Artweb', | ||
22 | + 'logo' => '2', | ||
23 | + 'about' => 'Строим бизнес в онлайне', | ||
8 | 'analytics_key' => '119240817', | 24 | 'analytics_key' => '119240817', |
9 | 'robots' => 'User-agent: Google | 25 | 'robots' => 'User-agent: Google |
10 | Disallow: | 26 | Disallow: |
11 | - | ||
12 | -User-agent: * | ||
13 | -Disallow: /', | ||
14 | - 'ga_code' => 'TEst', | ||
15 | - 'ya_code' => 'TEst 2', | ||
16 | - 'tag_manager' => 'TEst 3', | 27 | +', |
28 | + 'ga_code' => '796967', | ||
29 | + 'ya_code' => '08908908', | ||
30 | + 'tag_manager' => '', | ||
31 | + 'id' => 1, | ||
17 | ], | 32 | ], |
18 | ]; | 33 | ]; |
19 | \ No newline at end of file | 34 | \ No newline at end of file |
common/models/Settings.php
1 | <?php | 1 | <?php |
2 | namespace common\models; | 2 | namespace common\models; |
3 | - | 3 | + |
4 | + use noam148\imagemanager\models\ImageManager; | ||
4 | use yii2tech\filedb\ActiveRecord; | 5 | use yii2tech\filedb\ActiveRecord; |
5 | use Yii; | 6 | use Yii; |
6 | 7 | ||
@@ -8,14 +9,30 @@ | @@ -8,14 +9,30 @@ | ||
8 | * Class Settings | 9 | * Class Settings |
9 | * | 10 | * |
10 | * @package artbox\core\models | 11 | * @package artbox\core\models |
11 | - * @property string $name | ||
12 | - * @property string $id | ||
13 | - * @property string $description | ||
14 | * @property string $analytics_key | 12 | * @property string $analytics_key |
15 | * @property string $robots | 13 | * @property string $robots |
16 | * @property string $ga_code | 14 | * @property string $ga_code |
17 | * @property string $ya_code | 15 | * @property string $ya_code |
18 | * @property string $tag_manager | 16 | * @property string $tag_manager |
17 | + * @property string $phone | ||
18 | + * @property string $phone2 | ||
19 | + * @property string $skype | ||
20 | + * @property string $email | ||
21 | + * @property string $house | ||
22 | + * @property string $street | ||
23 | + * @property string $office | ||
24 | + * @property string $city | ||
25 | + * @property string $country | ||
26 | + * @property float $lat | ||
27 | + * @property float $lon | ||
28 | + * @property string $facebook | ||
29 | + * @property string $vk | ||
30 | + * @property string $ok | ||
31 | + * @property string $google | ||
32 | + * @property string $twitter | ||
33 | + * @property string name | ||
34 | + * @property int $logo | ||
35 | + * @property string $about | ||
19 | */ | 36 | */ |
20 | class Settings extends ActiveRecord | 37 | class Settings extends ActiveRecord |
21 | { | 38 | { |
@@ -50,17 +67,70 @@ | @@ -50,17 +67,70 @@ | ||
50 | return [ | 67 | return [ |
51 | [ | 68 | [ |
52 | [ | 69 | [ |
53 | - 'name', | ||
54 | - 'description', | ||
55 | - 'id', | ||
56 | 'analytics_key', | 70 | 'analytics_key', |
57 | 'robots', | 71 | 'robots', |
58 | 'ga_code', | 72 | 'ga_code', |
59 | 'ya_code', | 73 | 'ya_code', |
60 | 'tag_manager', | 74 | 'tag_manager', |
75 | + 'phone', | ||
76 | + 'phone2', | ||
77 | + 'skype', | ||
78 | + 'email', | ||
79 | + 'house', | ||
80 | + 'street', | ||
81 | + 'office', | ||
82 | + 'city', | ||
83 | + 'country', | ||
84 | + 'facebook', | ||
85 | + 'vk', | ||
86 | + 'google', | ||
87 | + 'twitter', | ||
88 | + 'name', | ||
89 | + 'about', | ||
90 | + 'ok', | ||
61 | ], | 91 | ], |
62 | 'string', | 92 | 'string', |
63 | ], | 93 | ], |
94 | + [ | ||
95 | + [ | ||
96 | + 'lat', | ||
97 | + 'lon', | ||
98 | + ], | ||
99 | + 'double', | ||
100 | + ], | ||
101 | + [ | ||
102 | + [ | ||
103 | + 'email', | ||
104 | + ], | ||
105 | + 'email', | ||
106 | + ], | ||
107 | + [ | ||
108 | + [ | ||
109 | + 'logo', | ||
110 | + ], | ||
111 | + 'integer', | ||
112 | + ], | ||
113 | + [ | ||
114 | + [ | ||
115 | + 'logo', | ||
116 | + ], | ||
117 | + 'exist', | ||
118 | + 'targetClass' => ImageManager::className(), | ||
119 | + 'targetAttribute' => 'id', | ||
120 | + ], | ||
121 | + [ | ||
122 | + [ | ||
123 | + 'logo', | ||
124 | + ], | ||
125 | + 'filter', | ||
126 | + 'filter' => function ($value) { | ||
127 | + if (empty( $value )) { | ||
128 | + return null; | ||
129 | + } else { | ||
130 | + return $value; | ||
131 | + } | ||
132 | + }, | ||
133 | + ], | ||
64 | ]; | 134 | ]; |
65 | } | 135 | } |
66 | 136 | ||
@@ -78,14 +148,30 @@ | @@ -78,14 +148,30 @@ | ||
78 | public function attributeLabels() | 148 | public function attributeLabels() |
79 | { | 149 | { |
80 | return [ | 150 | return [ |
81 | - 'id' => Yii::t('core', 'ID'), | ||
82 | - 'name' => Yii::t('core', 'Name'), | ||
83 | - 'description' => Yii::t('core', 'Description'), | ||
84 | 'analytics_key' => Yii::t('core', 'Google Analytics Key'), | 151 | 'analytics_key' => Yii::t('core', 'Google Analytics Key'), |
85 | 'robots' => Yii::t('core', 'Robots'), | 152 | 'robots' => Yii::t('core', 'Robots'), |
86 | 'ga_code' => Yii::t('core', 'Google analytics code'), | 153 | 'ga_code' => Yii::t('core', 'Google analytics code'), |
87 | 'ya_code' => Yii::t('core', 'Yandex metrics code'), | 154 | 'ya_code' => Yii::t('core', 'Yandex metrics code'), |
88 | 'tag_manager' => Yii::t('core', 'Tag Manager code'), | 155 | 'tag_manager' => Yii::t('core', 'Tag Manager code'), |
156 | + 'phone' => Yii::t('core', 'Phone'), | ||
157 | + 'phone2' => Yii::t('core', 'Additional phone'), | ||
158 | + 'skype' => Yii::t('core', 'Skype'), | ||
159 | + 'name' => Yii::t('core', 'Company name'), | ||
160 | + 'email' => Yii::t('core', 'Email'), | ||
161 | + 'house' => Yii::t('core', 'House'), | ||
162 | + 'street' => Yii::t('core', 'Street'), | ||
163 | + 'office' => Yii::t('core', 'Office'), | ||
164 | + 'city' => Yii::t('core', 'City'), | ||
165 | + 'country' => Yii::t('core', 'Country'), | ||
166 | + 'lat' => Yii::t('core', 'Latitude'), | ||
167 | + 'lon' => Yii::t('core', 'Longitude'), | ||
168 | + 'facebook' => Yii::t('core', 'Facebook'), | ||
169 | + 'vk' => Yii::t('core', 'VK'), | ||
170 | + 'google' => Yii::t('core', 'Google'), | ||
171 | + 'twitter' => Yii::t('core', 'Twitter'), | ||
172 | + 'logo' => Yii::t('core', 'Company logo'), | ||
173 | + 'about' => Yii::t('core', 'About us'), | ||
174 | + 'ok' => Yii::t('core', 'Odnoklassniki'), | ||
89 | ]; | 175 | ]; |
90 | } | 176 | } |
91 | 177 |
common/models/SitemapDynamic.php
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | * @property string $entity | 12 | * @property string $entity |
13 | * @property bool $status | 13 | * @property bool $status |
14 | * @property float $priority | 14 | * @property float $priority |
15 | + * @property string $frequency | ||
15 | */ | 16 | */ |
16 | class SitemapDynamic extends ActiveRecord | 17 | class SitemapDynamic extends ActiveRecord |
17 | { | 18 | { |
@@ -37,6 +38,7 @@ | @@ -37,6 +38,7 @@ | ||
37 | 'entity', | 38 | 'entity', |
38 | 'status', | 39 | 'status', |
39 | 'priority', | 40 | 'priority', |
41 | + 'frequency', | ||
40 | ]; | 42 | ]; |
41 | } | 43 | } |
42 | 44 | ||
@@ -59,6 +61,7 @@ | @@ -59,6 +61,7 @@ | ||
59 | 'entity', | 61 | 'entity', |
60 | 'status', | 62 | 'status', |
61 | 'priority', | 63 | 'priority', |
64 | + 'frequency', | ||
62 | ], | 65 | ], |
63 | 'required', | 66 | 'required', |
64 | ], | 67 | ], |
@@ -71,6 +74,7 @@ | @@ -71,6 +74,7 @@ | ||
71 | [ | 74 | [ |
72 | [ | 75 | [ |
73 | 'entity', | 76 | 'entity', |
77 | + 'frequency', | ||
74 | ], | 78 | ], |
75 | 'string', | 79 | 'string', |
76 | ], | 80 | ], |
@@ -91,10 +95,11 @@ | @@ -91,10 +95,11 @@ | ||
91 | public function attributeLabels() | 95 | public function attributeLabels() |
92 | { | 96 | { |
93 | return [ | 97 | return [ |
94 | - 'id' => Yii::t('core', 'ID'), | ||
95 | - 'entity' => Yii::t('core', 'Model'), | ||
96 | - 'status' => Yii::t('core', 'Status'), | ||
97 | - 'priority' => Yii::t('core', 'Priority'), | 98 | + 'id' => Yii::t('core', 'ID'), |
99 | + 'entity' => Yii::t('core', 'Model'), | ||
100 | + 'status' => Yii::t('core', 'Status'), | ||
101 | + 'priority' => Yii::t('core', 'Priority'), | ||
102 | + 'frequency' => Yii::t('core', 'Frequency'), | ||
98 | ]; | 103 | ]; |
99 | } | 104 | } |
100 | 105 |
common/models/SitemapStatic.php
@@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
11 | * @property int $id | 11 | * @property int $id |
12 | * @property string $url | 12 | * @property string $url |
13 | * @property float $priority | 13 | * @property float $priority |
14 | + * @property string $frequency | ||
14 | */ | 15 | */ |
15 | class SitemapStatic extends ActiveRecord | 16 | class SitemapStatic extends ActiveRecord |
16 | { | 17 | { |
@@ -31,6 +32,7 @@ | @@ -31,6 +32,7 @@ | ||
31 | 'id', | 32 | 'id', |
32 | 'url', | 33 | 'url', |
33 | 'priority', | 34 | 'priority', |
35 | + 'frequency', | ||
34 | ]; | 36 | ]; |
35 | } | 37 | } |
36 | 38 | ||
@@ -66,6 +68,7 @@ | @@ -66,6 +68,7 @@ | ||
66 | [ | 68 | [ |
67 | [ | 69 | [ |
68 | 'url', | 70 | 'url', |
71 | + 'frequency', | ||
69 | ], | 72 | ], |
70 | 'string', | 73 | 'string', |
71 | ], | 74 | ], |
@@ -78,9 +81,10 @@ | @@ -78,9 +81,10 @@ | ||
78 | public function attributeLabels() | 81 | public function attributeLabels() |
79 | { | 82 | { |
80 | return [ | 83 | return [ |
81 | - 'id' => Yii::t('core', 'ID'), | ||
82 | - 'url' => Yii::t('core', 'Url'), | ||
83 | - 'priority' => Yii::t('core', 'Priority'), | 84 | + 'id' => Yii::t('core', 'ID'), |
85 | + 'url' => Yii::t('core', 'Url'), | ||
86 | + 'priority' => Yii::t('core', 'Priority'), | ||
87 | + 'frequency' => Yii::t('core', 'Frequency'), | ||
84 | ]; | 88 | ]; |
85 | } | 89 | } |
86 | 90 |
composer.lock
@@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | - "hash": "36eb0ae581bcd3b79ac784abbb046108", | ||
8 | - "content-hash": "51847bf92742211dfa7159261b54c33b", | 7 | + "hash": "c2e977cd213cebff0ae0575975d20974", |
8 | + "content-hash": "ca665ed7c0e1bd63947fab086b435a30", | ||
9 | "packages": [ | 9 | "packages": [ |
10 | { | 10 | { |
11 | "name": "2amigos/yii2-tinymce-widget", | 11 | "name": "2amigos/yii2-tinymce-widget", |
1 | +<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>http://www.artbox.dev/</loc><lastmod>2017-03-30</lastmod><changefreq>monthly</changefreq><priority>1</priority></url><url><loc>http://www.artbox.dev/site/contacts</loc><lastmod>2017-03-30</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url><url><loc>http://www.artbox.dev/en/text-en</loc><lastmod>2017-03-30</lastmod><changefreq>hourly</changefreq><priority>0.7</priority></url></urlset> | ||
0 | \ No newline at end of file | 2 | \ No newline at end of file |