@@ -28,7 +28,8 @@ discard block |
||
28 | 28 | if (!$user_id) { |
29 | 29 | $error = true; |
30 | 30 | $user = null; |
31 | - } else { |
|
31 | + } |
|
32 | + else { |
|
32 | 33 | $user = Users\User::get($user_id); |
33 | 34 | } |
34 | 35 | } |
@@ -107,16 +108,19 @@ discard block |
||
107 | 108 | $category_id = (int) $_GET['inCatalog']; |
108 | 109 | } |
109 | 110 | $search = $_GET['search']; |
110 | - } else { |
|
111 | + } |
|
112 | + else { |
|
111 | 113 | $search = ''; |
112 | 114 | } |
113 | 115 | |
114 | 116 | //sort |
115 | 117 | if (!empty($_GET['sort'])) { |
116 | 118 | $sort = $_GET['sort']; |
117 | - } elseif (!empty($this->ecommerce->config['defaultSort'])) { |
|
119 | + } |
|
120 | + elseif (!empty($this->ecommerce->config['defaultSort'])) { |
|
118 | 121 | $sort = $this->ecommerce->config['defaultSort']; |
119 | - } else { |
|
122 | + } |
|
123 | + else { |
|
120 | 124 | $sort = ['name' => 'asc']; |
121 | 125 | } |
122 | 126 | |
@@ -131,10 +135,12 @@ discard block |
||
131 | 135 | } |
132 | 136 | if ($category) { |
133 | 137 | $category_id = $category->id; |
134 | - } else { |
|
138 | + } |
|
139 | + else { |
|
135 | 140 | $category_id = 0; |
136 | 141 | } |
137 | - } else { |
|
142 | + } |
|
143 | + else { |
|
138 | 144 | $category_id = 0; |
139 | 145 | } |
140 | 146 | $active = $category_id; |
@@ -153,7 +159,8 @@ discard block |
||
153 | 159 | if (!$category || !$category->name) { |
154 | 160 | $bread[] = array('text' => 'Каталог'); |
155 | 161 | $this->view->setTitle('Каталог'); |
156 | - } else { |
|
162 | + } |
|
163 | + else { |
|
157 | 164 | $bread[] = array('text' => 'Каталог', 'href' => '/ecommerce'); |
158 | 165 | $categoryIds = array_values(array_filter(explode('/', $category->tree_path))); |
159 | 166 | foreach ($categoryIds as $id) { |
@@ -177,7 +184,8 @@ discard block |
||
177 | 184 | //params |
178 | 185 | if (empty(App::$cur->ecommerce->config['filtersInLast'])) { |
179 | 186 | $options = \Ecommerce\Item\Option::getList(['where' => ['item_option_searchable', 1], 'order' => ['weight', 'asc']]); |
180 | - } else { |
|
187 | + } |
|
188 | + else { |
|
181 | 189 | $params = $this->ecommerce->getItemsParams([ |
182 | 190 | 'parent' => $category_id, |
183 | 191 | 'search' => trim($search), |
@@ -189,7 +197,8 @@ discard block |
||
189 | 197 | } |
190 | 198 | if ($ids) { |
191 | 199 | $options = \Ecommerce\Item\Option::getList(['where' => ['id', $ids, 'IN'], 'order' => ['weight', 'asc']]); |
192 | - } else { |
|
200 | + } |
|
201 | + else { |
|
193 | 202 | $options = []; |
194 | 203 | } |
195 | 204 | } |
@@ -198,7 +207,8 @@ discard block |
||
198 | 207 | //child categorys |
199 | 208 | if ($category) { |
200 | 209 | $categorys = $category->catalogs; |
201 | - } else { |
|
210 | + } |
|
211 | + else { |
|
202 | 212 | $categorys = \Ecommerce\Category::getList(['where' => ['parent_id', 0]]); |
203 | 213 | } |
204 | 214 |
@@ -2,27 +2,45 @@ |
||
2 | 2 | <form action = '' method = 'POST' enctype="multipart/form-data"> |
3 | 3 | <div class ="form-group"> |
4 | 4 | <label>Название сайта</label> |
5 | - <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) echo \App::$primary->config['site']['name']; ?>' /> |
|
5 | + <input class ="form-control" type = 'text' name = 'site_name' value = '<?php if (!empty(\App::$primary->config['site']['name'])) { |
|
6 | + echo \App::$primary->config['site']['name']; |
|
7 | +} |
|
8 | +?>' /> |
|
6 | 9 | </div> |
7 | 10 | <div class ="form-group"> |
8 | 11 | <label>Название компании</label> |
9 | - <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) echo \App::$primary->config['site']['company_name']; ?>' /> |
|
12 | + <input class ="form-control" type = 'text' name = 'company_name' value = '<?php if (!empty(\App::$primary->config['site']['company_name'])) { |
|
13 | + echo \App::$primary->config['site']['company_name']; |
|
14 | +} |
|
15 | +?>' /> |
|
10 | 16 | </div> |
11 | 17 | <div class ="form-group"> |
12 | 18 | <label>Основной домен</label> |
13 | - <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) echo \App::$primary->config['site']['domain']; ?>' /> |
|
19 | + <input class ="form-control" type = 'text' name = 'site_domain' value = '<?php if (!empty(\App::$primary->config['site']['domain'])) { |
|
20 | + echo \App::$primary->config['site']['domain']; |
|
21 | +} |
|
22 | +?>' /> |
|
14 | 23 | </div> |
15 | 24 | <div class ="form-group"> |
16 | 25 | <label>Контактный email</label> |
17 | - <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' /> |
|
26 | + <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) { |
|
27 | + echo \App::$primary->config['site']['email']; |
|
28 | +} |
|
29 | +?>' /> |
|
18 | 30 | </div> |
19 | 31 | <div class ="form-group"> |
20 | 32 | <label>Ключевые слова</label> |
21 | - <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' /> |
|
33 | + <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) { |
|
34 | + echo \App::$primary->config['site']['keywords']; |
|
35 | +} |
|
36 | +?>' /> |
|
22 | 37 | </div> |
23 | 38 | <div class ="form-group"> |
24 | 39 | <label>Краткое описание сайта</label> |
25 | - <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' /> |
|
40 | + <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) { |
|
41 | + echo \App::$primary->config['site']['description']; |
|
42 | +} |
|
43 | +?>' /> |
|
26 | 44 | </div> |
27 | 45 | <?php |
28 | 46 | $form = new Ui\Form(); |
@@ -2,15 +2,15 @@ |
||
2 | 2 | <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', ' . \Users\User::$cur->name() : ''; ?></h4> |
3 | 3 | <div class = "row"> |
4 | 4 | <?php |
5 | - $rowSum = 0; |
|
6 | - foreach ($sections as $section) { |
|
7 | - if (empty($section['widget'])) { |
|
8 | - continue; |
|
9 | - } |
|
5 | + $rowSum = 0; |
|
6 | + foreach ($sections as $section) { |
|
7 | + if (empty($section['widget'])) { |
|
8 | + continue; |
|
9 | + } |
|
10 | 10 | |
11 | - $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
|
12 | - $rowSum+=$widgetSize; |
|
13 | - ?> |
|
11 | + $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
|
12 | + $rowSum+=$widgetSize; |
|
13 | + ?> |
|
14 | 14 | <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div> |
15 | 15 | <?php |
16 | 16 | if ($rowSum >= 3) { |
@@ -9,7 +9,7 @@ |
||
9 | 9 | } |
10 | 10 | |
11 | 11 | $widgetSize = !empty($section['size']) ? $section['size'] : 1; |
12 | - $rowSum+=$widgetSize; |
|
12 | + $rowSum += $widgetSize; |
|
13 | 13 | ?> |
14 | 14 | <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div> |
15 | 15 | <?php |
@@ -40,7 +40,8 @@ discard block |
||
40 | 40 | echo "<div id = 'params_" . str_replace('\\', '-', $code) . "' class = 'widgetParams' style='display:none;'>"; |
41 | 41 | if (isset($options['params']) && !is_array($options['params'])) { |
42 | 42 | $options['params'](); |
43 | - } elseif (isset($options['params'])) { |
|
43 | + } |
|
44 | + elseif (isset($options['params'])) { |
|
44 | 45 | $params = $options['params']; |
45 | 46 | if ($params) { |
46 | 47 | echo "<h3>Параметры</h3>"; |
@@ -54,12 +55,14 @@ discard block |
||
54 | 55 | } |
55 | 56 | echo "</select> |
56 | 57 | </div>"; |
57 | - } elseif ($param['type'] == 'textarea') { |
|
58 | + } |
|
59 | + elseif ($param['type'] == 'textarea') { |
|
58 | 60 | echo "<div class = 'form-group'> |
59 | 61 | <label>{$param['name']}</label> |
60 | 62 | <textarea name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control'></textarea> |
61 | 63 | </div>"; |
62 | - } else { |
|
64 | + } |
|
65 | + else { |
|
63 | 66 | echo "<div class = 'form-group'> |
64 | 67 | <label>{$param['name']}</label> |
65 | 68 | <input name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control' /> |
@@ -34,16 +34,19 @@ discard block |
||
34 | 34 | $params = json_decode($widget->widget_params, true); |
35 | 35 | if ($params) { |
36 | 36 | foreach ($params as $param) { |
37 | - if (!isset($widgetCode[$i])) |
|
38 | - break; |
|
37 | + if (!isset($widgetCode[$i])) { |
|
38 | + break; |
|
39 | + } |
|
39 | 40 | if ($param['type'] == 'select') { |
40 | 41 | $item = $param['model']::get($widgetCode[$i++]); |
41 | 42 | if ($item) { |
42 | 43 | $text .= $param['name'] . ': ' . $item->$param['showCol'] . "\n"; |
43 | - } else { |
|
44 | + } |
|
45 | + else { |
|
44 | 46 | $text .= $widgetCode[$i - 1]; |
45 | 47 | } |
46 | - } else { |
|
48 | + } |
|
49 | + else { |
|
47 | 50 | $value = $widgetCode[$i++]; |
48 | 51 | if (mb_strlen($value, 'utf-8') > 50) { |
49 | 52 | $value = mb_substr($value, 0, 50) . '...'; |
@@ -52,18 +55,21 @@ discard block |
||
52 | 55 | } |
53 | 56 | } |
54 | 57 | } |
55 | - } else { |
|
58 | + } |
|
59 | + else { |
|
56 | 60 | unset($widgetCode[0]); |
57 | 61 | foreach ($widgetCode as $item) { |
58 | 62 | $text .= $item . "\n"; |
59 | 63 | } |
60 | 64 | } |
61 | - } else { |
|
65 | + } |
|
66 | + else { |
|
62 | 67 | foreach ($widgetCode as $item) { |
63 | 68 | $text .= $item . "\n"; |
64 | 69 | } |
65 | 70 | } |
66 | - } else { |
|
71 | + } |
|
72 | + else { |
|
67 | 73 | $text = 'text not defined'; |
68 | 74 | } |
69 | 75 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $root->setAttribute("xmlns", "http://www.sitemaps.org/schemas/sitemap/0.9"); |
38 | 38 | $root = $xml->appendChild($root); |
39 | 39 | |
40 | - $addToXml = function ($xml, $parent, $nodeName, $text) { |
|
40 | + $addToXml = function($xml, $parent, $nodeName, $text) { |
|
41 | 41 | $node = $parent->appendChild($xml->createElement($nodeName)); |
42 | 42 | $node->appendChild($xml->createTextNode($text)); |
43 | 43 | return $node; |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <h1>Установка модулей</h1> |
2 | 2 | <form> |
3 | 3 | <?php |
4 | - $config = Config::app(App::$primary ? App::$primary : App::$cur); |
|
5 | - $modules = array_flip(Module::getInstalled(App::$cur)); |
|
6 | - $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
|
7 | - foreach ($systemModules as $module) { |
|
8 | - $info = Module::getInfo($module); |
|
9 | - if (!$info || isset($modules[$module])) |
|
10 | - continue; |
|
11 | - ?> |
|
4 | + $config = Config::app(App::$primary ? App::$primary : App::$cur); |
|
5 | + $modules = array_flip(Module::getInstalled(App::$cur)); |
|
6 | + $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
|
7 | + foreach ($systemModules as $module) { |
|
8 | + $info = Module::getInfo($module); |
|
9 | + if (!$info || isset($modules[$module])) |
|
10 | + continue; |
|
11 | + ?> |
|
12 | 12 | <div class ="form-group"> |
13 | 13 | <div class="checkbox"> |
14 | 14 | <label> |
@@ -6,8 +6,9 @@ |
||
6 | 6 | $systemModules = array_slice(scandir(INJI_SYSTEM_DIR . '/modules'), 2); |
7 | 7 | foreach ($systemModules as $module) { |
8 | 8 | $info = Module::getInfo($module); |
9 | - if (!$info || isset($modules[$module])) |
|
10 | - continue; |
|
9 | + if (!$info || isset($modules[$module])) { |
|
10 | + continue; |
|
11 | + } |
|
11 | 12 | ?> |
12 | 13 | <div class ="form-group"> |
13 | 14 | <div class="checkbox"> |
@@ -19,7 +19,8 @@ discard block |
||
19 | 19 | if (is_numeric($objectType)) { |
20 | 20 | $mapPath->object_id = $objectType; |
21 | 21 | $mapPath->type = 'object'; |
22 | - } else { |
|
22 | + } |
|
23 | + else { |
|
23 | 24 | if ($objectType == 'object') { |
24 | 25 | $object = new Migrations\Migration\Object(); |
25 | 26 | $object->model = !empty($_POST['typeOptions'][$pathId]) ? $_POST['typeOptions'][$pathId] : ''; |
@@ -28,7 +29,8 @@ discard block |
||
28 | 29 | $object->save(); |
29 | 30 | $mapPath->type = 'object'; |
30 | 31 | $mapPath->object_id = $object->id; |
31 | - } else { |
|
32 | + } |
|
33 | + else { |
|
32 | 34 | $mapPath->type = $objectType; |
33 | 35 | } |
34 | 36 | } |
@@ -48,7 +50,8 @@ discard block |
||
48 | 50 | $object->save(); |
49 | 51 | $param->type = 'object'; |
50 | 52 | $param->value = $object->id; |
51 | - } else { |
|
53 | + } |
|
54 | + else { |
|
52 | 55 | $param->type = $type; |
53 | 56 | $param->value = !empty($_POST['paramOptions'][$paramId]) ? $_POST['paramOptions'][$paramId] : ''; |
54 | 57 | } |
@@ -28,7 +28,8 @@ discard block |
||
28 | 28 | $ids[] = $id; |
29 | 29 | } |
30 | 30 | } |
31 | - } else { |
|
31 | + } |
|
32 | + else { |
|
32 | 33 | $id = $this->parseData($this->data, $preset); |
33 | 34 | if ($id) { |
34 | 35 | $ids[] = $id; |
@@ -56,10 +57,12 @@ discard block |
||
56 | 57 | $parser->parentModel = $model; |
57 | 58 | $parser->walker = $this->walker; |
58 | 59 | $parser->parse(); |
59 | - } else { |
|
60 | + } |
|
61 | + else { |
|
60 | 62 | if ($param->type == 'custom') { |
61 | 63 | $parserName = $param->value; |
62 | - } else { |
|
64 | + } |
|
65 | + else { |
|
63 | 66 | $parserName = '\Migrations\Parser\Object\\' . ucfirst($param->type); |
64 | 67 | } |
65 | 68 | $parser = new $parserName; |
@@ -105,7 +108,8 @@ discard block |
||
105 | 108 | if ($param->type == 'item_key') { |
106 | 109 | $keyCol = $param->code; |
107 | 110 | break; |
108 | - } elseif (!empty($options['unique'])) { |
|
111 | + } |
|
112 | + elseif (!empty($options['unique'])) { |
|
109 | 113 | $uniques[$param->code] = $param; |
110 | 114 | } |
111 | 115 | } |
@@ -114,7 +118,8 @@ discard block |
||
114 | 118 | if ($objectId) { |
115 | 119 | $modelName = $this->object->model; |
116 | 120 | $model = $modelName::get($objectId->object_id); |
117 | - } else { |
|
121 | + } |
|
122 | + else { |
|
118 | 123 | $model = new $this->object->model; |
119 | 124 | $model->save(['empty' => true]); |
120 | 125 | $objectId = new \Migrations\Id(); |
@@ -125,7 +130,8 @@ discard block |
||
125 | 130 | \App::$cur->migrations->ids['objectIds'][$this->object->model][$model->id] = $objectId; |
126 | 131 | \App::$cur->migrations->ids['parseIds'][$this->object->model][(string) $data[$keyCol]] = $objectId; |
127 | 132 | } |
128 | - } elseif ($uniques) { |
|
133 | + } |
|
134 | + elseif ($uniques) { |
|
129 | 135 | $where = []; |
130 | 136 | foreach ($uniques as $code => $param) { |
131 | 137 | if (!isset($data[$code])) { |
@@ -168,7 +174,8 @@ discard block |
||
168 | 174 | if (!empty($relation['type']) && $relation['type'] == 'many') { |
169 | 175 | $where[] = [$relation['col'], $this->parentModel->pk()]; |
170 | 176 | } |
171 | - } elseif ($this->parentObject) { |
|
177 | + } |
|
178 | + elseif ($this->parentObject) { |
|
172 | 179 | $modelName = $this->parentObject->object->model; |
173 | 180 | $where[] = [$modelName::index(), $this->parentModel->pk()]; |
174 | 181 | } |