@@ -76,8 +76,11 @@ discard block |
||
76 | 76 | <?php $model->content_id = $content_id; ?> |
77 | 77 | <?= $form->field($model, 'content_id')->hiddenInput(['value' => $content_id])->label(false); ?> |
78 | 78 | <?php endif; ?> |
79 | - <?php else : ?> |
|
80 | - <?php $contentModel = $model->cmsContent; ?> |
|
79 | + <?php else { |
|
80 | + : ?> |
|
81 | + <?php $contentModel = $model->cmsContent; |
|
82 | +} |
|
83 | +?> |
|
81 | 84 | <?php endif; ?> |
82 | 85 | |
83 | 86 | <?php if ($contentModel && $contentModel->parentContent) : ?> |
@@ -162,7 +165,8 @@ discard block |
||
162 | 165 | ], |
163 | 166 | 'body' => \Yii::t('skeeks/cms', 'Management will be available after saving') |
164 | 167 | ]); ?> |
165 | - <?php else: ?> |
|
168 | + <?php else { |
|
169 | + : ?> |
|
166 | 170 | <?= \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget([ |
167 | 171 | 'label' => $childContent->name, |
168 | 172 | 'namespace' => md5($model->className() . $childContent->id), |
@@ -183,7 +187,9 @@ discard block |
||
183 | 187 | 'gridViewOptions' => [ |
184 | 188 | 'columns' => (array)\skeeks\cms\controllers\AdminCmsContentElementController::getColumns($childContent) |
185 | 189 | ], |
186 | - ]); ?> |
|
190 | + ]); |
|
191 | +} |
|
192 | +?> |
|
187 | 193 | |
188 | 194 | <?php endif; ?> |
189 | 195 |
@@ -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) : */ ?><!-- |
@@ -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 //второстепенная страница |
@@ -23,8 +23,11 @@ |
||
23 | 23 | <a href="<?= $widget->getOpenCloseLink($model); ?>" class="btn btn-sm btn-default"> |
24 | 24 | <span class="glyphicon glyphicon-minus" title="<?= \Yii::t('skeeks/cms', "Minimize"); ?>"></span> |
25 | 25 | </a> |
26 | - <?php else : ?> |
|
27 | - <a href="<?= $widget->getOpenCloseLink($model); ?>" class="btn btn-sm btn-default"> |
|
26 | + <?php else { |
|
27 | + : ?> |
|
28 | + <a href="<?= $widget->getOpenCloseLink($model); |
|
29 | +} |
|
30 | +?>" class="btn btn-sm btn-default"> |
|
28 | 31 | <span class="glyphicon glyphicon-plus" title="<?= \Yii::t('skeeks/cms', "Restore"); ?>"></span> |
29 | 32 | </a> |
30 | 33 | <?php endif; ?> |
@@ -16,13 +16,16 @@ |
||
16 | 16 | <?php if ($widget->modelAttributeSaveType) : ?> |
17 | 17 | <?= \yii\helpers\Html::activeRadioList($widget->model, $widget->modelAttributeSaveType, |
18 | 18 | \skeeks\cms\widgets\formInputs\comboText\ComboTextInputWidget::editors()) ?> |
19 | - <?php else : ?> |
|
19 | + <?php else { |
|
20 | + : ?> |
|
20 | 21 | <?= \yii\helpers\Html::radioList( |
21 | 22 | $widget->id . '-radio', |
22 | 23 | $widget->defaultEditor, |
23 | 24 | \skeeks\cms\widgets\formInputs\comboText\ComboTextInputWidget::editors() |
24 | 25 | ) ?> |
25 | - <?php endif; ?> |
|
26 | + <?php endif; |
|
27 | +} |
|
28 | +?> |
|
26 | 29 | </div> |
27 | 30 | <div class="sx-controll"> |
28 | 31 | <?= $textarea; ?> |
@@ -99,8 +99,11 @@ discard block |
||
99 | 99 | <img src="<?= \Yii::$app->imaging->getImagingUrl($imageFile->src, |
100 | 100 | new \skeeks\cms\components\imaging\filters\Thumbnail()); ?>"/> |
101 | 101 | </a> |
102 | - <?php else : ?> |
|
103 | - <?= $imageFile->name ? $imageFile->name : $imageFile->original_name; ?> |
|
102 | + <?php else { |
|
103 | + : ?> |
|
104 | + <?= $imageFile->name ? $imageFile->name : $imageFile->original_name; |
|
105 | +} |
|
106 | +?> |
|
104 | 107 | <?php endif; ?> |
105 | 108 | |
106 | 109 | <div class="sx-controlls"> |
@@ -122,8 +125,11 @@ discard block |
||
122 | 125 | } |
123 | 126 | ?> |
124 | 127 | </div> |
125 | - <?php else : ?> |
|
126 | - <?= $widget->renderItem($imageFile); ?> |
|
128 | + <?php else { |
|
129 | + : ?> |
|
130 | + <?= $widget->renderItem($imageFile); |
|
131 | +} |
|
132 | +?> |
|
127 | 133 | <?php endif; ?> |
128 | 134 | </div> |
129 | 135 | <?php endif; ?> |
@@ -107,8 +107,11 @@ |
||
107 | 107 | ]); |
108 | 108 | ?> |
109 | 109 | </div> |
110 | - <?php else : ?> |
|
111 | - <?= $widget->renderItem($imageFile); ?> |
|
110 | + <?php else { |
|
111 | + : ?> |
|
112 | + <?= $widget->renderItem($imageFile); |
|
113 | +} |
|
114 | +?> |
|
112 | 115 | <?php endif; ?> |
113 | 116 | |
114 | 117 | </div> |
@@ -139,13 +139,14 @@ |
||
139 | 139 | ['code'], |
140 | 140 | function ($attribute) { |
141 | 141 | if (!preg_match('/^[a-zA-Z]{1}[a-zA-Z0-9]{1,255}$/', |
142 | - $this->$attribute)) |
|
143 | - //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute)) |
|
142 | + $this->$attribute)) { |
|
143 | + //if(!preg_match('/(^|.*\])([\w\.]+)(\[.*|$)/', $this->$attribute)) |
|
144 | 144 | { |
145 | 145 | $this->addError($attribute, \Yii::t('skeeks/cms', |
146 | 146 | 'Use only letters of the alphabet in lower or upper case and numbers, the first character of the letter (Example {code})', |
147 | 147 | ['code' => 'code1'])); |
148 | 148 | } |
149 | + } |
|
149 | 150 | } |
150 | 151 | ], |
151 | 152 |