@@ -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)); |
@@ -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; |
@@ -1,14 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Item name |
|
4 | - * |
|
5 | - * Info |
|
6 | - * |
|
7 | - * @author Alexey Krupskiy <[email protected]> |
|
8 | - * @link http://inji.ru/ |
|
9 | - * @copyright 2016 Alexey Krupskiy |
|
10 | - * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
11 | - */ |
|
3 | + * Item name |
|
4 | + * |
|
5 | + * Info |
|
6 | + * |
|
7 | + * @author Alexey Krupskiy <[email protected]> |
|
8 | + * @link http://inji.ru/ |
|
9 | + * @copyright 2016 Alexey Krupskiy |
|
10 | + * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | namespace Money; |
14 | 14 |
@@ -24,8 +24,8 @@ |
||
24 | 24 | 'label' => ['type' => 'text'], |
25 | 25 | 'type' => ['type' => 'text'], |
26 | 26 | 'required' => ['type' => 'bool'], |
27 | - 'form_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'form'], |
|
28 | - 'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
27 | + 'form_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'form'], |
|
28 | + 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
29 | 29 | 'input_params' => ['type' => 'textarea'], |
30 | 30 | 'weight' => ['type' => 'number'] |
31 | 31 | ]; |
@@ -24,10 +24,10 @@ |
||
24 | 24 | public static $cols = [ |
25 | 25 | 'name' => ['type' => 'text'], |
26 | 26 | 'description' => ['type' => 'html'], |
27 | - 'user_id' => [ 'type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
27 | + 'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'], |
|
28 | 28 | 'date_create' => ['type' => 'dateTime'], |
29 | 29 | //Менеджеры |
30 | - 'inputs' => [ 'type' => 'dataManager', 'relation' => 'inputs'], |
|
30 | + 'inputs' => ['type' => 'dataManager', 'relation' => 'inputs'], |
|
31 | 31 | ]; |
32 | 32 | public static $dataManagers = [ |
33 | 33 | 'manager' => [ |
@@ -2,17 +2,17 @@ |
||
2 | 2 | <div class="table-responsive"> |
3 | 3 | <table class="table table-bordered table-condensed table-striped table-hover"> |
4 | 4 | <?php |
5 | - $i = 0; |
|
6 | - foreach ($items as $item) { |
|
7 | - ?> |
|
5 | + $i = 0; |
|
6 | + foreach ($items as $item) { |
|
7 | + ?> |
|
8 | 8 | <tr> |
9 | 9 | <?php $this->widget('Ecommerce\items/item-tablerow', ['item' => $item]); ?> |
10 | 10 | </tr> |
11 | 11 | <?php |
12 | - if (!( ++$i % 3)) { |
|
13 | - echo '</div><div class="row">'; |
|
14 | - } |
|
15 | - } |
|
16 | - ?> |
|
12 | + if (!( ++$i % 3)) { |
|
13 | + echo '</div><div class="row">'; |
|
14 | + } |
|
15 | + } |
|
16 | + ?> |
|
17 | 17 | </table></div> |
18 | 18 | </div> |
19 | 19 | \ No newline at end of file |
@@ -1,21 +1,21 @@ |
||
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 | - 'attributes' => [ |
|
15 | - 'class' => $class, |
|
16 | - ], |
|
17 | - 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
18 | - ]; |
|
19 | - }); |
|
20 | - ?> |
|
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 | + 'attributes' => [ |
|
15 | + 'class' => $class, |
|
16 | + ], |
|
17 | + 'text' => "<a {$class} href = '/ecommerce/itemList/{$categoryItem->id}'>{$categoryItem->name}</a>" |
|
18 | + ]; |
|
19 | + }); |
|
20 | + ?> |
|
21 | 21 | </div> |
22 | 22 | \ No newline at end of file |
@@ -13,23 +13,23 @@ |
||
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 | - $this->widget('Ecommerce\items/table', ['items'=>$bestItems,'hide'=>true]); |
|
23 | - ?> |
|
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 | + $this->widget('Ecommerce\items/table', ['items'=>$bestItems,'hide'=>true]); |
|
23 | + ?> |
|
24 | 24 | </div> |
25 | 25 | </div> |
26 | 26 | <?php |
27 | - $this->widget('Ecommerce\items/showOptions'); |
|
27 | + $this->widget('Ecommerce\items/showOptions'); |
|
28 | 28 | |
29 | - $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
|
30 | - $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
31 | - $this->widget('Ecommerce\items/table', ['items'=>$bestItems,'hide'=>true]); |
|
32 | - ?> |
|
29 | + $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
|
30 | + $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
|
31 | + $this->widget('Ecommerce\items/table', ['items'=>$bestItems,'hide'=>true]); |
|
32 | + ?> |
|
33 | 33 | <a class="ecommerce-showmore" href="/ecommerce/itemList">Показать больше товаров</a> |
34 | 34 | </div> |
35 | 35 | </div> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $bestItems = array_slice($bestItems, 0, 3); |
20 | 20 | } |
21 | 21 | $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
22 | - $this->widget('Ecommerce\items/table', ['items'=>$bestItems,'hide'=>true]); |
|
22 | + $this->widget('Ecommerce\items/table', ['items'=>$bestItems, 'hide'=>true]); |
|
23 | 23 | ?> |
24 | 24 | </div> |
25 | 25 | </div> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $bestItems = App::$cur->ecommerce->getItems(['sort' => ['sales' => 'desc'], 'start' => 0, 'count' => 6]); |
30 | 30 | $this->widget('Ecommerce\items/icons', ['items' => $bestItems]); |
31 | - $this->widget('Ecommerce\items/table', ['items'=>$bestItems,'hide'=>true]); |
|
31 | + $this->widget('Ecommerce\items/table', ['items'=>$bestItems, 'hide'=>true]); |
|
32 | 32 | ?> |
33 | 33 | <a class="ecommerce-showmore" href="/ecommerce/itemList">Показать больше товаров</a> |
34 | 34 | </div> |
@@ -10,10 +10,10 @@ discard block |
||
10 | 10 | <div class="form-group"> |
11 | 11 | <label>Регистрация через соц.сети</label><br /> |
12 | 12 | <?php |
13 | - foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { |
|
14 | - echo "<a href = '/users/social/auth/{$social->code}'>{$social->name()}</a> "; |
|
15 | - } |
|
16 | - ?> |
|
13 | + foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { |
|
14 | + echo "<a href = '/users/social/auth/{$social->code}'>{$social->name()}</a> "; |
|
15 | + } |
|
16 | + ?> |
|
17 | 17 | </div> |
18 | 18 | <?php |
19 | 19 | } |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | <?php $form->input('date', 'user_birthday', 'Дата рождения'); ?> |
30 | 30 | <?php $form->input('text', 'user_city', 'Город'); ?> |
31 | 31 | <?php |
32 | - if (!empty(App::$cur->users->config['invites'])) { |
|
33 | - ?> |
|
32 | + if (!empty(App::$cur->users->config['invites'])) { |
|
33 | + ?> |
|
34 | 34 | <div class ='form-group'> |
35 | 35 | <label><?= !empty(App::$cur->users->config['invitesName']) ? App::$cur->users->config['invitesName'] : 'Код приглашения'; ?></label> |
36 | 36 | <input type ='text' name ='invite_code' class ='form-control' value ="<?= (isset($_POST['invite_code']) ? $_POST['invite_code'] : ((!empty($_COOKIE['invite_code']) ? $_COOKIE['invite_code'] : ((!empty($_GET['invite_code']) ? $_GET['invite_code'] : ''))))); ?>" /> |
37 | 37 | </div> |
38 | 38 | <?php |
39 | - } |
|
40 | - ?> |
|
39 | + } |
|
40 | + ?> |
|
41 | 41 | </div> |
42 | 42 | <div class="col-sm-6"> |
43 | 43 | <div class ='form-group'> |