@@ -91,7 +91,8 @@ discard block |
||
| 91 | 91 | ] |
| 92 | 92 | ); |
| 93 | 93 | ?> |
| 94 | - <?php else : ?> |
|
| 94 | + <?php else { |
|
| 95 | + : ?> |
|
| 95 | 96 | <? |
| 96 | 97 | echo $form->field($element->relatedPropertiesModel, $property->code)->widget( |
| 97 | 98 | \skeeks\cms\backend\widgets\SelectModelDialogContentElementWidget::class, |
@@ -100,18 +101,25 @@ discard block |
||
| 100 | 101 | 'multiple' => true |
| 101 | 102 | ] |
| 102 | 103 | ); |
| 104 | +} |
|
| 103 | 105 | ?> |
| 104 | 106 | <?php endif; ?> |
| 105 | - <?php else : ?> |
|
| 106 | - <?= $property->renderActiveForm($form); ?> |
|
| 107 | + <?php else { |
|
| 108 | + : ?> |
|
| 109 | + <?= $property->renderActiveForm($form); |
|
| 110 | +} |
|
| 111 | +?> |
|
| 107 | 112 | <?php endif; ?> |
| 108 | 113 | </div> |
| 109 | 114 | <?php endforeach; ?> |
| 110 | 115 | <?= $form->buttonsStandart($model, ['save']); ?> |
| 111 | 116 | <?php $form::end(); ?> |
| 112 | - <?php else : ?> |
|
| 117 | + <?php else { |
|
| 118 | + : ?> |
|
| 113 | 119 | Not found properties |
| 114 | - <?php endif; ?> |
|
| 120 | + <?php endif; |
|
| 121 | +} |
|
| 122 | +?> |
|
| 115 | 123 | <?php endif; ?> |
| 116 | 124 | </div> |
| 117 | 125 | |
@@ -6,8 +6,11 @@ |
||
| 6 | 6 | <?= $form->fieldSet(\Yii::t('skeeks/cms', 'Sections')); ?> |
| 7 | 7 | <?php if ($contentModel->root_tree_id) : ?> |
| 8 | 8 | <?php $rootTreeModels = \skeeks\cms\models\CmsTree::findAll($contentModel->root_tree_id); ?> |
| 9 | -<?php else : ?> |
|
| 10 | - <?php $rootTreeModels = \skeeks\cms\models\CmsTree::findRoots()->joinWith('cmsSiteRelation')->orderBy([\skeeks\cms\models\CmsSite::tableName() . ".priority" => SORT_ASC])->all(); ?> |
|
| 9 | +<?php else { |
|
| 10 | + : ?> |
|
| 11 | + <?php $rootTreeModels = \skeeks\cms\models\CmsTree::findRoots()->joinWith('cmsSiteRelation')->orderBy([\skeeks\cms\models\CmsSite::tableName() . ".priority" => SORT_ASC])->all(); |
|
| 12 | +} |
|
| 13 | +?> |
|
| 11 | 14 | <?php endif; ?> |
| 12 | 15 | |
| 13 | 16 | <?php /* if ($contentModel->is_allow_change_tree == \skeeks\cms\components\Cms::BOOL_Y) : */ ?><!-- |
@@ -10,7 +10,8 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | <?php if ($form_id = \Yii::$app->request->get('property_id')) : ?> |
| 12 | 12 | <?= $form->field($model, 'property_id')->hiddenInput(['value' => $form_id])->label(false); ?> |
| 13 | -<?php else: ?> |
|
| 13 | +<?php else { |
|
| 14 | + : ?> |
|
| 14 | 15 | <?= $form->field($model, 'property_id')->widget( |
| 15 | 16 | \skeeks\widget\chosen\Chosen::className(), [ |
| 16 | 17 | 'items' => \yii\helpers\ArrayHelper::map( |
@@ -19,6 +20,7 @@ discard block |
||
| 19 | 20 | "name" |
| 20 | 21 | ), |
| 21 | 22 | ]); |
| 23 | +} |
|
| 22 | 24 | ?> |
| 23 | 25 | <?php endif; ?> |
| 24 | 26 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | [ |
| 45 | 45 | 'label' => \Yii::t('skeeks/cms', 'Property'), |
| 46 | 46 | 'attribute' => 'p.name', |
| 47 | - 'value' => function (\skeeks\cms\models\CmsTreeTypePropertyEnum $cmsContentPropertyEnum) { |
|
| 47 | + 'value' => function(\skeeks\cms\models\CmsTreeTypePropertyEnum $cmsContentPropertyEnum) { |
|
| 48 | 48 | return $cmsContentPropertyEnum->property->name; |
| 49 | 49 | } |
| 50 | 50 | ], |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | 'priority', |
| 75 | 75 | [ |
| 76 | 76 | 'label' => \Yii::t('skeeks/cms', 'Sections'), |
| 77 | - 'value' => function (\skeeks\cms\models\CmsTreeTypeProperty $cmsContentProperty) { |
|
| 77 | + 'value' => function(\skeeks\cms\models\CmsTreeTypeProperty $cmsContentProperty) { |
|
| 78 | 78 | $contents = \yii\helpers\ArrayHelper::map($cmsContentProperty->cmsTreeTypes, 'id', 'name'); |
| 79 | 79 | return implode(', ', $contents); |
| 80 | 80 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | [ |
| 36 | 36 | 'class' => \yii\grid\DataColumn::className(), |
| 37 | 37 | 'label' => \Yii::t('skeeks/cms', 'Number of sections'), |
| 38 | - 'value' => function (\skeeks\cms\models\CmsTreeType $cmsTreeType) { |
|
| 38 | + 'value' => function(\skeeks\cms\models\CmsTreeType $cmsTreeType) { |
|
| 39 | 39 | return $cmsTreeType->getCmsTrees()->count(); |
| 40 | 40 | } |
| 41 | 41 | ], |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | public $priority = 100; |
| 31 | 31 | |
| 32 | 32 | public $publicBaseUrl; // http://c1.s.skeeks.com/uploads/ |
| 33 | - public $rootBasePath; // /var/www/sites/test.ru/frontend/web/uploads/ |
|
| 33 | + public $rootBasePath; // /var/www/sites/test.ru/frontend/web/uploads/ |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @var integer the level of sub-directories to store uploaded files. Defaults to 1. |
@@ -246,7 +246,7 @@ |
||
| 246 | 246 | |
| 247 | 247 | if (!$pathInfo) //главная страница |
| 248 | 248 | { |
| 249 | - $treeNode = Tree::getDb()->cache(function ($db) { |
|
| 249 | + $treeNode = Tree::getDb()->cache(function($db) { |
|
| 250 | 250 | return Tree::find()->where([ |
| 251 | 251 | "cms_site_id" => \Yii::$app->cms->site->id, |
| 252 | 252 | "level" => 0, |
@@ -244,13 +244,15 @@ |
||
| 244 | 244 | ]); |
| 245 | 245 | |
| 246 | 246 | |
| 247 | - if (!$pathInfo) //главная страница |
|
| 247 | + if (!$pathInfo) { |
|
| 248 | + //главная страница |
|
| 248 | 249 | { |
| 249 | 250 | $treeNode = Tree::getDb()->cache(function ($db) { |
| 250 | 251 | return Tree::find()->where([ |
| 251 | 252 | "cms_site_id" => \Yii::$app->cms->site->id, |
| 252 | 253 | "level" => 0, |
| 253 | 254 | ])->one(); |
| 255 | + } |
|
| 254 | 256 | }, null, $dependency); |
| 255 | 257 | |
| 256 | 258 | } else //второстепенная страница |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $this->noImageUrl = CmsAsset::getAssetUrl('img/image-not-found.jpg'); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - \Yii::$app->view->on(View::EVENT_BEGIN_PAGE, function (Event $e) { |
|
| 253 | + \Yii::$app->view->on(View::EVENT_BEGIN_PAGE, function(Event $e) { |
|
| 254 | 254 | if (!\Yii::$app->request->isAjax && !\Yii::$app->request->isPjax) { |
| 255 | 255 | \Yii::$app->response->getHeaders()->setDefault('X-Powered-CMS', |
| 256 | 256 | $this->descriptor->name . " {$this->descriptor->homepage}"); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | }); |
| 277 | 277 | |
| 278 | - \Yii::$app->user->on(\yii\web\User::EVENT_AFTER_LOGIN, function (UserEvent $e) { |
|
| 278 | + \Yii::$app->user->on(\yii\web\User::EVENT_AFTER_LOGIN, function(UserEvent $e) { |
|
| 279 | 279 | $e->identity->logged_at = \Yii::$app->formatter->asTimestamp(time()); |
| 280 | 280 | $e->identity->save(false); |
| 281 | 281 | |