@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | \Yii::$app->cmsToolbar->initEnabled(); |
84 | 84 | if (\Yii::$app->cmsToolbar->editWidgets == Cms::BOOL_Y && \Yii::$app->cmsToolbar->enabled) { |
85 | - $id = 'sx-infoblock-'.$this->id; |
|
85 | + $id = 'sx-infoblock-' . $this->id; |
|
86 | 86 | |
87 | 87 | return Html::beginTag('div', |
88 | 88 | [ |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | |
127 | 127 | public function init() |
128 | 128 | { |
129 | - $this->_token = \Yii::t('skeeks/cms', 'Widget').': '.$this->id; |
|
130 | - \Yii::beginProfile("Cms Widget: ".$this->_token); |
|
129 | + $this->_token = \Yii::t('skeeks/cms', 'Widget') . ': ' . $this->id; |
|
130 | + \Yii::beginProfile("Cms Widget: " . $this->_token); |
|
131 | 131 | parent::init(); |
132 | - \Yii::endProfile("Cms Widget: ".$this->_token); |
|
132 | + \Yii::endProfile("Cms Widget: " . $this->_token); |
|
133 | 133 | } |
134 | 134 | /** |
135 | 135 | * @return string |
@@ -138,17 +138,17 @@ discard block |
||
138 | 138 | { |
139 | 139 | if (YII_ENV == 'prod') { |
140 | 140 | try { |
141 | - \Yii::beginProfile("Run: ".$this->_token); |
|
141 | + \Yii::beginProfile("Run: " . $this->_token); |
|
142 | 142 | $content = $this->_run(); |
143 | - \Yii::endProfile("Run: ".$this->_token); |
|
143 | + \Yii::endProfile("Run: " . $this->_token); |
|
144 | 144 | } catch (\Exception $e) { |
145 | 145 | $content = \Yii::t('skeeks/cms', 'Error widget {class}', |
146 | - ['class' => $this->className()])." (".$this->descriptor->name."): ".$e->getMessage(); |
|
146 | + ['class' => $this->className()]) . " (" . $this->descriptor->name . "): " . $e->getMessage(); |
|
147 | 147 | } |
148 | 148 | } else { |
149 | - \Yii::beginProfile("Run: ".$this->_token); |
|
149 | + \Yii::beginProfile("Run: " . $this->_token); |
|
150 | 150 | $content = $this->_run(); |
151 | - \Yii::endProfile("Run: ".$this->_token); |
|
151 | + \Yii::endProfile("Run: " . $this->_token); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | if ($this->_isBegin) { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $result = ""; |
178 | 178 | |
179 | 179 | if (\Yii::$app->cmsToolbar->editWidgets == Cms::BOOL_Y && \Yii::$app->cmsToolbar->enabled) { |
180 | - $id = 'sx-infoblock-'.$this->id; |
|
180 | + $id = 'sx-infoblock-' . $this->id; |
|
181 | 181 | |
182 | 182 | $this->view->registerJs(<<<JS |
183 | 183 | new sx.classes.toolbar.EditViewBlock({'id' : '{$id}'}); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | { |
187 | 187 | $this->_callAttributes = $this->attributes; |
188 | 188 | |
189 | - \Yii::beginProfile("Init: ".static::class); |
|
189 | + \Yii::beginProfile("Init: " . static::class); |
|
190 | 190 | |
191 | 191 | if (!\Yii::$app instanceof Application) { |
192 | 192 | if ($this->cmsSite === null && isset(\Yii::$app->currentSite) && \Yii::$app->currentSite->site) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $this->trigger(self::EVENT_INIT); |
204 | 204 | |
205 | - \Yii::endProfile("Init: ".static::class); |
|
205 | + \Yii::endProfile("Init: " . static::class); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $this->_oldAttributes = $this->toArray($this->safeAttributes()); |
218 | 218 | } catch (\Exception $e) { |
219 | 219 | \Yii::error(\Yii::t('skeeks/cms', '{cms} component error load defaul settings', |
220 | - ['cms' => 'Cms']).': '.$e->getMessage()); |
|
220 | + ['cms' => 'Cms']) . ': ' . $e->getMessage()); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | return $this; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | |
528 | 528 | if ($models = $this->getConfigFormModels()) { |
529 | 529 | foreach ($models as $key => $model) { |
530 | - $value[$key."Array"] = $model->attributes; |
|
530 | + $value[$key . "Array"] = $model->attributes; |
|
531 | 531 | } |
532 | 532 | } |
533 | 533 | |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | */ |
711 | 711 | public function getCallableId() |
712 | 712 | { |
713 | - return $this->settingsId.'-callable'; |
|
713 | + return $this->settingsId . '-callable'; |
|
714 | 714 | } |
715 | 715 | |
716 | 716 | /** |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | public function getSettingsId($autoGenerate = true) |
722 | 722 | { |
723 | 723 | if ($autoGenerate && $this->_settingsId === null) { |
724 | - $this->_settingsId = static::$autoSettingsIdPrefix.static::$counterSettings++; |
|
724 | + $this->_settingsId = static::$autoSettingsIdPrefix . static::$counterSettings++; |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | return $this->_settingsId; |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | if (isset($this->{$name})) { |
806 | 806 | $this->{$name} = $value; |
807 | 807 | } else { |
808 | - throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".'); |
|
808 | + throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
809 | 809 | } |
810 | 810 | } |
811 | 811 | |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) { |
856 | 856 | $this->_oldAttributes[$name] = $value; |
857 | 857 | } else { |
858 | - throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".'); |
|
858 | + throw new InvalidParamException(get_class($this) . ' has no attribute named "' . $name . '".'); |
|
859 | 859 | } |
860 | 860 | } |
861 | 861 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $extension = Imaging::getExtension($newFileSrc); |
44 | 44 | |
45 | 45 | if (!$extension) { |
46 | - throw new \yii\base\Exception("Extension not found: ".$newFileSrc); |
|
46 | + throw new \yii\base\Exception("Extension not found: " . $newFileSrc); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
@@ -53,31 +53,31 @@ discard block |
||
53 | 53 | |
54 | 54 | |
55 | 55 | $newFile = File::object($newFileSrc); |
56 | - $strposFilter = strpos($newFileSrc, "/".Imaging::THUMBNAIL_PREFIX); |
|
56 | + $strposFilter = strpos($newFileSrc, "/" . Imaging::THUMBNAIL_PREFIX); |
|
57 | 57 | if (!$strposFilter) { |
58 | - throw new NotFoundHttpException("This is not a filter thumbnail: ".$newFileSrc); |
|
58 | + throw new NotFoundHttpException("This is not a filter thumbnail: " . $newFileSrc); |
|
59 | 59 | } |
60 | 60 | |
61 | - $originalFileSrc = substr($newFileSrc, 0, $strposFilter).".".$newFile->getExtension(); |
|
61 | + $originalFileSrc = substr($newFileSrc, 0, $strposFilter) . "." . $newFile->getExtension(); |
|
62 | 62 | |
63 | 63 | //TODO: hardcode delete it in the future |
64 | 64 | $webRoot = \Yii::getAlias('@webroot'); |
65 | 65 | |
66 | - $originalFileRoot = $webRoot.DIRECTORY_SEPARATOR.$originalFileSrc; |
|
67 | - $newFileRoot = $webRoot.DIRECTORY_SEPARATOR.$newFileSrc; |
|
68 | - $newFileRootDefault = $webRoot.DIRECTORY_SEPARATOR.str_replace($newFile->getBaseName(), |
|
69 | - Imaging::DEFAULT_THUMBNAIL_FILENAME.".".$extension, $newFileSrc); |
|
66 | + $originalFileRoot = $webRoot . DIRECTORY_SEPARATOR . $originalFileSrc; |
|
67 | + $newFileRoot = $webRoot . DIRECTORY_SEPARATOR . $newFileSrc; |
|
68 | + $newFileRootDefault = $webRoot . DIRECTORY_SEPARATOR . str_replace($newFile->getBaseName(), |
|
69 | + Imaging::DEFAULT_THUMBNAIL_FILENAME . "." . $extension, $newFileSrc); |
|
70 | 70 | |
71 | 71 | $originalFile = new File($originalFileRoot); |
72 | 72 | |
73 | 73 | if (!$originalFile->isExist()) { |
74 | - throw new NotFoundHttpException("The original file is not found: ".$newFileSrc); |
|
74 | + throw new NotFoundHttpException("The original file is not found: " . $newFileSrc); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | //Проверено наличие оригинального файла, есть пути к оригиналу, и результирующему файлу. |
78 | 78 | //Отслось собрать фильтр, и проверить наличие параметров. А так же проверить разрешены ли эти параметры, для этого в строке есть захэшированный ключь |
79 | 79 | |
80 | - $filterSting = substr($newFileSrc, ($strposFilter + strlen(DIRECTORY_SEPARATOR.Imaging::THUMBNAIL_PREFIX)), |
|
80 | + $filterSting = substr($newFileSrc, ($strposFilter + strlen(DIRECTORY_SEPARATOR . Imaging::THUMBNAIL_PREFIX)), |
|
81 | 81 | strlen($newFileSrc)); |
82 | 82 | $filterCode = explode("/", $filterSting); |
83 | 83 | $filterCode = $filterCode[0]; //Код фильтра |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | if ($params = \Yii::$app->request->get()) { |
87 | 87 | $pramsCheckArray = explode(DIRECTORY_SEPARATOR, $filterSting); |
88 | 88 | if (count($pramsCheckArray) < 3) { |
89 | - throw new \yii\base\Exception("the control line not found: ".$newFileSrc); |
|
89 | + throw new \yii\base\Exception("the control line not found: " . $newFileSrc); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $string = $imaging->getParamsCheckString($params); |
93 | 93 | if ($pramsCheckArray[1] != $string) { |
94 | - throw new \yii\base\Exception("Parameters invalid: ".$newFileSrc); |
|
94 | + throw new \yii\base\Exception("Parameters invalid: " . $newFileSrc); |
|
95 | 95 | } |
96 | 96 | } |
97 | 97 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | |
101 | 101 | if (!class_exists($filterClass)) { |
102 | - throw new \ErrorException("Filter class is not created: ".$newFileSrc); |
|
102 | + throw new \ErrorException("Filter class is not created: " . $newFileSrc); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | $filter = new $filterClass((array)$params); |
109 | 109 | if (!is_subclass_of($filter, Filter::className())) { |
110 | - throw new NotFoundHttpException("No child filter class: ".$newFileSrc); |
|
110 | + throw new NotFoundHttpException("No child filter class: " . $newFileSrc); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | try { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | - $url = \Yii::$app->request->getUrl().($params ? |
|
131 | + $url = \Yii::$app->request->getUrl() . ($params ? |
|
132 | 132 | ""//"?" . http_build_query($params) . '&sx-refresh' |
133 | 133 | : '?sx-refresh'); |
134 | 134 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | $hidden = $widget->items; |
15 | 15 | $visible = []; |
16 | -$values = (array) $widget->model->{$widget->attribute}; |
|
16 | +$values = (array)$widget->model->{$widget->attribute}; |
|
17 | 17 | |
18 | 18 | foreach ($values as $value) |
19 | 19 | { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $this->options['multiple'] = true; |
79 | 79 | |
80 | - $items = (array) $this->model->{$this->attribute}; |
|
80 | + $items = (array)$this->model->{$this->attribute}; |
|
81 | 81 | $selectedItems = []; |
82 | 82 | if ($items) { |
83 | 83 | foreach ($items as $value) |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
89 | - $element = Html::activeListBox($this->model, $this->attribute, (array) $selectedItems, $this->options); |
|
89 | + $element = Html::activeListBox($this->model, $this->attribute, (array)$selectedItems, $this->options); |
|
90 | 90 | |
91 | 91 | echo $this->render('dual-select', [ |
92 | 92 | 'element' => $element, |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $clusterFileSrc = $clusterFileName; |
58 | 58 | |
59 | 59 | if ($localPath) { |
60 | - $clusterFileSrc = $localPath.DIRECTORY_SEPARATOR.$clusterFileSrc; |
|
60 | + $clusterFileSrc = $localPath . DIRECTORY_SEPARATOR . $clusterFileSrc; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | try { |
64 | - $dir = new Dir($dir.DIRECTORY_SEPARATOR.$localPath); |
|
64 | + $dir = new Dir($dir . DIRECTORY_SEPARATOR . $localPath); |
|
65 | 65 | $resultFile = $dir->newFile($clusterFileName); |
66 | 66 | $tmpFile->move($resultFile); |
67 | 67 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if ($this->publicBaseUrlIsAbsolute) { |
120 | 120 | return $this->getPublicSrc($clusterFileUniqSrc); |
121 | 121 | } else { |
122 | - return \Yii::$app->urlManager->hostInfo.$this->getPublicSrc($clusterFileUniqSrc); |
|
122 | + return \Yii::$app->urlManager->hostInfo . $this->getPublicSrc($clusterFileUniqSrc); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $this->options['multiple'] = true; |
63 | 63 | |
64 | - $items = (array) $this->model->{$this->attribute}; |
|
64 | + $items = (array)$this->model->{$this->attribute}; |
|
65 | 65 | $selectedItems = []; |
66 | 66 | if ($items) { |
67 | 67 | foreach ($items as $value) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - $element = Html::activeListBox($this->model, $this->attribute, (array) $selectedItems, $this->options); |
|
73 | + $element = Html::activeListBox($this->model, $this->attribute, (array)$selectedItems, $this->options); |
|
74 | 74 | |
75 | 75 | echo $this->render('sort-select', [ |
76 | 76 | 'element' => $element, |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $hidden = $widget->items; |
15 | 15 | $visible = []; |
16 | -$values = (array) $widget->model->{$widget->attribute}; |
|
16 | +$values = (array)$widget->model->{$widget->attribute}; |
|
17 | 17 | |
18 | 18 | |
19 | 19 | \yii\jui\Sortable::widget(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | 'size' => 1 |
48 | 48 | ]); ?> |
49 | 49 | </div> |
50 | - <? $counter ++; ?> |
|
50 | + <? $counter++; ?> |
|
51 | 51 | <? endforeach; ?> |
52 | 52 | </div> |
53 | 53 | <?= \yii\helpers\Html::endTag('div'); ?> |
@@ -92,7 +92,7 @@ |
||
92 | 92 | ], |
93 | 93 | |
94 | 94 | "grid" => [ |
95 | - 'on init' => function (Event $e) { |
|
95 | + 'on init' => function(Event $e) { |
|
96 | 96 | /** |
97 | 97 | * @var $dataProvider ActiveDataProvider |
98 | 98 | * @var $query ActiveQuery |