@@ -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 | { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | 'hiddenLabel' => \Yii::t('skeeks/cms', 'Hidden columns'), |
94 | 94 | ], |
95 | 95 | //'multiple' => true, |
96 | - 'on beforeRender' => function ($e) { |
|
96 | + 'on beforeRender' => function($e) { |
|
97 | 97 | /** |
98 | 98 | * @var $gridView GridView |
99 | 99 | */ |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | ['caption', 'string'], |
132 | 132 | ], |
133 | 133 | ], |
134 | - ], (array) $this->configBehaviorData), |
|
134 | + ], (array)$this->configBehaviorData), |
|
135 | 135 | ]); |
136 | 136 | } |
137 | 137 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | if ($result && in_array($label, array_values($result))) { |
179 | - $result[$code] = $label." ({$code})"; |
|
179 | + $result[$code] = $label . " ({$code})"; |
|
180 | 180 | } else { |
181 | 181 | $result[$code] = $label; |
182 | 182 | } |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $this->_autoColumns[(string)$name] = [ |
266 | 266 | 'attribute' => $name, |
267 | 267 | 'format' => 'raw', |
268 | - 'value' => function ($model, $key, $index) use ($name) { |
|
268 | + 'value' => function($model, $key, $index) use ($name) { |
|
269 | 269 | if (is_array($model->{$name})) { |
270 | 270 | return implode(",", $model->{$name}); |
271 | 271 | } else { |
@@ -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, |