@@ -11,6 +11,11 @@ |
||
11 | 11 | { |
12 | 12 | function indexAction() |
13 | 13 | { |
14 | + |
|
15 | + /** |
|
16 | + * @param DOMDocument $xml |
|
17 | + * @param string $nodeName |
|
18 | + */ |
|
14 | 19 | function addToXml($xml, $parent, $nodeName, $text) |
15 | 20 | { |
16 | 21 | $node = $parent->appendChild($xml->createElement($nodeName)); |
@@ -2,23 +2,38 @@ |
||
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>Контактный email</label> |
13 | - <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) echo \App::$primary->config['site']['email']; ?>' /> |
|
19 | + <input class ="form-control" type = 'text' name = 'site_email' value = '<?php if (!empty(\App::$primary->config['site']['email'])) { |
|
20 | + echo \App::$primary->config['site']['email']; |
|
21 | +} |
|
22 | +?>' /> |
|
14 | 23 | </div> |
15 | 24 | <div class ="form-group"> |
16 | 25 | <label>Ключевые слова</label> |
17 | - <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) echo \App::$primary->config['site']['keywords']; ?>' /> |
|
26 | + <input class ="form-control" type = 'text' name = 'site_keywords' value = '<?php if (!empty(\App::$primary->config['site']['keywords'])) { |
|
27 | + echo \App::$primary->config['site']['keywords']; |
|
28 | +} |
|
29 | +?>' /> |
|
18 | 30 | </div> |
19 | 31 | <div class ="form-group"> |
20 | 32 | <label>Краткое описание сайта</label> |
21 | - <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) echo \App::$primary->config['site']['description']; ?>' /> |
|
33 | + <input class ="form-control" type = 'text' name = 'site_description' value = '<?php if (!empty(\App::$primary->config['site']['description'])) { |
|
34 | + echo \App::$primary->config['site']['description']; |
|
35 | +} |
|
36 | +?>' /> |
|
22 | 37 | </div> |
23 | 38 | <?php |
24 | 39 | $form = new Ui\Form(); |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <div class="ecommerce-sidebar-categorys"> |
2 | 2 | <?php |
3 | - if(empty($category)){ |
|
4 | - $category = []; |
|
5 | - } |
|
6 | - $tree = new Ui\Tree(); |
|
7 | - $tree->ul('\Ecommerce\Category', 0, function($categoryItem) use($category) { |
|
8 | - if ($category && $category->id == $categoryItem->id) { |
|
9 | - $class = 'active'; |
|
10 | - } else { |
|
11 | - $class = ''; |
|
12 | - } |
|
13 | - return [ |
|
14 | - 'class' => $class, |
|
15 | - 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
16 | - ]; |
|
17 | - }); |
|
18 | - ?> |
|
3 | + if(empty($category)){ |
|
4 | + $category = []; |
|
5 | + } |
|
6 | + $tree = new Ui\Tree(); |
|
7 | + $tree->ul('\Ecommerce\Category', 0, function($categoryItem) use($category) { |
|
8 | + if ($category && $category->id == $categoryItem->id) { |
|
9 | + $class = 'active'; |
|
10 | + } else { |
|
11 | + $class = ''; |
|
12 | + } |
|
13 | + return [ |
|
14 | + 'class' => $class, |
|
15 | + 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
16 | + ]; |
|
17 | + }); |
|
18 | + ?> |
|
19 | 19 | </div> |
20 | 20 | \ No newline at end of file |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <div class="ecommerce-sidebar-categorys"> |
2 | 2 | <?php |
3 | - if(empty($category)){ |
|
3 | + if (empty($category)) { |
|
4 | 4 | $category = []; |
5 | 5 | } |
6 | 6 | $tree = new Ui\Tree(); |
@@ -13,21 +13,21 @@ |
||
13 | 13 | <div class="ecommerce-best"> |
14 | 14 | <h2 class='caption'><span>Рекомендумые товары</span></h2> |
15 | 15 | <?php |
16 | - $bestItems = App::$cur->ecommerce->getItems(['where' => [['best', '1']], 'sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3]); |
|
17 | - if (count($bestItems) < 3) { |
|
18 | - $bestItems = array_merge($bestItems, App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3])); |
|
19 | - $bestItems = array_slice($bestItems, 0, 3); |
|
20 | - } |
|
21 | - $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
22 | - ?> |
|
16 | + $bestItems = App::$cur->ecommerce->getItems(['where' => [['best', '1']], 'sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3]); |
|
17 | + if (count($bestItems) < 3) { |
|
18 | + $bestItems = array_merge($bestItems, App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 3])); |
|
19 | + $bestItems = array_slice($bestItems, 0, 3); |
|
20 | + } |
|
21 | + $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
22 | + ?> |
|
23 | 23 | </div> |
24 | 24 | </div> |
25 | 25 | <?php |
26 | - $this->widget('Ecommerce\items/showOptions'); |
|
26 | + $this->widget('Ecommerce\items/showOptions'); |
|
27 | 27 | |
28 | - $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
|
29 | - $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
30 | - ?> |
|
28 | + $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
|
29 | + $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
30 | + ?> |
|
31 | 31 | <a class="ecommerce-showmore" href="/ecommerce/itemList">Показать больше товаров</a> |
32 | 32 | </div> |
33 | 33 | </div> |
@@ -17,20 +17,20 @@ |
||
17 | 17 | <h1><?= $item->name(); ?></h1> |
18 | 18 | <ul class="item-options"> |
19 | 19 | <?php |
20 | - foreach ($item->options as $param) { |
|
21 | - if (!$param->item_option_view || !$param->value) |
|
22 | - continue; |
|
23 | - if ($param->item_option_type == 'select') { |
|
24 | - if (empty($param->option->items[$param->value])) |
|
25 | - continue; |
|
26 | - $value = $param->option->items[$param->value]->value; |
|
27 | - } else { |
|
28 | - $value = $param->value; |
|
29 | - } |
|
30 | - $paramName = $param->item_option_name; |
|
31 | - echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
32 | - } |
|
33 | - ?> |
|
20 | + foreach ($item->options as $param) { |
|
21 | + if (!$param->item_option_view || !$param->value) |
|
22 | + continue; |
|
23 | + if ($param->item_option_type == 'select') { |
|
24 | + if (empty($param->option->items[$param->value])) |
|
25 | + continue; |
|
26 | + $value = $param->option->items[$param->value]->value; |
|
27 | + } else { |
|
28 | + $value = $param->value; |
|
29 | + } |
|
30 | + $paramName = $param->item_option_name; |
|
31 | + echo "<li>{$paramName}: {$value} {$param->item_option_postfix}</li>"; |
|
32 | + } |
|
33 | + ?> |
|
34 | 34 | </ul> |
35 | 35 | <div class="item-actions"> |
36 | 36 | <div class="item-price"> |
@@ -18,11 +18,13 @@ |
||
18 | 18 | <ul class="item-options"> |
19 | 19 | <?php |
20 | 20 | foreach ($item->options as $param) { |
21 | - if (!$param->item_option_view || !$param->value) |
|
22 | - continue; |
|
21 | + if (!$param->item_option_view || !$param->value) { |
|
22 | + continue; |
|
23 | + } |
|
23 | 24 | if ($param->item_option_type == 'select') { |
24 | - if (empty($param->option->items[$param->value])) |
|
25 | - continue; |
|
25 | + if (empty($param->option->items[$param->value])) { |
|
26 | + continue; |
|
27 | + } |
|
26 | 28 | $value = $param->option->items[$param->value]->value; |
27 | 29 | } else { |
28 | 30 | $value = $param->value; |