@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | <h3>Уровни начислений</h3> |
13 | 13 | <ul> |
14 | 14 | <?php |
15 | - foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) { |
|
16 | - ?> |
|
15 | + foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) { |
|
16 | + ?> |
|
17 | 17 | |
18 | 18 | <li><?= !$level->level ? 'Личный' : $level->level; ?>. <?= $types[$level->type]['viewer']($level); ?></li> |
19 | 19 | <?php |
20 | - } |
|
21 | - ?> |
|
20 | + } |
|
21 | + ?> |
|
22 | 22 | |
23 | 23 | </ul> |
24 | 24 | </div> |
@@ -34,20 +34,20 @@ discard block |
||
34 | 34 | <h4 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h4> |
35 | 35 | <ul> |
36 | 36 | <?php |
37 | - foreach ($condition->items as $item) { |
|
38 | - $itemComplete = $item->checkComplete(); |
|
39 | - switch ($item->type) { |
|
40 | - case 'event': |
|
37 | + foreach ($condition->items as $item) { |
|
38 | + $itemComplete = $item->checkComplete(); |
|
39 | + switch ($item->type) { |
|
40 | + case 'event': |
|
41 | 41 | $name = \Events\Event::get($item->value, 'event')->name(); |
42 | - break; |
|
43 | - } |
|
44 | - ?> |
|
42 | + break; |
|
43 | + } |
|
44 | + ?> |
|
45 | 45 | <li> |
46 | 46 | <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount(); ?></b>/<?= $item->count; ?> <br /> |
47 | 47 | </li> |
48 | 48 | <?php |
49 | - } |
|
50 | - ?> |
|
49 | + } |
|
50 | + ?> |
|
51 | 51 | </ul> |
52 | 52 | <?php |
53 | 53 | } |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <h3>Мои кошельки</h3> |
2 | 2 | <div class="row"> |
3 | 3 | <?php |
4 | - $blocked = App::$cur->money->getUserBlocks(); |
|
5 | - $wallets = App::$cur->money->getUserWallets(); |
|
6 | - $rates = Money\Currency\ExchangeRate::getList(); |
|
7 | - foreach ($wallets as $wallet) { |
|
8 | - ?> |
|
4 | + $blocked = App::$cur->money->getUserBlocks(); |
|
5 | + $wallets = App::$cur->money->getUserWallets(); |
|
6 | + $rates = Money\Currency\ExchangeRate::getList(); |
|
7 | + foreach ($wallets as $wallet) { |
|
8 | + ?> |
|
9 | 9 | <div class="col-sm-4"> |
10 | 10 | <h4><?= $wallet->currency->name(); ?></h4> |
11 | 11 | <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br /> |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | ?> |
31 | 31 | </div> |
32 | 32 | <?php |
33 | - } |
|
34 | - ?> |
|
33 | + } |
|
34 | + ?> |
|
35 | 35 | </div> |
36 | 36 | <?php |
37 | 37 | $transfers = Money\Transfer::getList(['where' => [ |
@@ -27,19 +27,19 @@ |
||
27 | 27 | ?> |
28 | 28 | <div class="item <?= !$i ? 'active' : ''; ?>"> |
29 | 29 | <?php |
30 | - if ($item->link) { |
|
31 | - echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; |
|
32 | - } |
|
33 | - ?> |
|
30 | + if ($item->link) { |
|
31 | + echo "<a href = '{$item->link}' style = 'display:inline-block;'>"; |
|
32 | + } |
|
33 | + ?> |
|
34 | 34 | <img src="<?= Statics::file($item->image->path); ?>" alt="<?= $item->name; ?>"> |
35 | 35 | <div class="carousel-caption"> |
36 | 36 | <?= $item->description; ?> |
37 | 37 | </div> |
38 | 38 | <?php |
39 | - if ($item->link) { |
|
40 | - echo "</a>"; |
|
41 | - } |
|
42 | - ?> |
|
39 | + if ($item->link) { |
|
40 | + echo "</a>"; |
|
41 | + } |
|
42 | + ?> |
|
43 | 43 | </div> |
44 | 44 | <?php |
45 | 45 | $i++; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $type = substr($path, 0, strpos($path, '/')); |
53 | 53 | switch ($type) { |
54 | 54 | case 'libs': |
55 | - return App::$cur->Libs->getPath(array_slice(explode('/', $path),2)); |
|
55 | + return App::$cur->Libs->getPath(array_slice(explode('/', $path), 2)); |
|
56 | 56 | break; |
57 | 57 | case 'templates': |
58 | 58 | $path = substr($path, strpos($path, '/') + 1); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | $fileName = $fileinfo['filename'] . '.' . $fileinfo['extension']; |
190 | 190 | if (App::$cur->db->connect) { |
191 | - $fileObj = Files\File::get([ 'path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']); |
|
191 | + $fileObj = Files\File::get(['path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']); |
|
192 | 192 | if ($fileObj) { |
193 | 193 | $fileName = $fileObj->original_name; |
194 | 194 | } |
@@ -112,10 +112,11 @@ discard block |
||
112 | 112 | |
113 | 113 | $sizes = explode('x', $_GET['resize']); |
114 | 114 | $sizes[0] = intval($sizes[0]); |
115 | - if (isset($sizes[1])) |
|
116 | - $sizes[1] = intval($sizes[1]); |
|
117 | - else |
|
118 | - $sizes[1] = 0; |
|
115 | + if (isset($sizes[1])) { |
|
116 | + $sizes[1] = intval($sizes[1]); |
|
117 | + } else { |
|
118 | + $sizes[1] = 0; |
|
119 | + } |
|
119 | 120 | |
120 | 121 | if (!$sizes[0] || !$sizes[1]) { |
121 | 122 | header('HTTP/1.1 404 Not Found'); |
@@ -127,15 +128,16 @@ discard block |
||
127 | 128 | $dir = App::$primary->path; |
128 | 129 | |
129 | 130 | if (!empty($_GET['resize_crop'])) { |
130 | - if (in_array($_GET['resize_crop'], array('q', 'c'))) |
|
131 | - $crop = $_GET['resize_crop']; |
|
132 | - else |
|
133 | - $crop = 'c'; |
|
131 | + if (in_array($_GET['resize_crop'], array('q', 'c'))) { |
|
132 | + $crop = $_GET['resize_crop']; |
|
133 | + } else { |
|
134 | + $crop = 'c'; |
|
135 | + } |
|
136 | + } elseif (!empty($_GET['resize_quadro'])) { |
|
137 | + $crop = 'q'; |
|
138 | + } else { |
|
139 | + $crop = ''; |
|
134 | 140 | } |
135 | - elseif (!empty($_GET['resize_quadro'])) |
|
136 | - $crop = 'q'; |
|
137 | - else |
|
138 | - $crop = ''; |
|
139 | 141 | $pos = 'center'; |
140 | 142 | if (!empty($_GET['resize_pos']) && in_array($_GET['resize_pos'], array('top', 'center'))) { |
141 | 143 | $pos = $_GET['resize_pos']; |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Text blocks module |
|
4 | - * |
|
5 | - * @author Alexey Krupskiy <[email protected]> |
|
6 | - * @link http://inji.ru/ |
|
7 | - * @copyright 2015 Alexey Krupskiy |
|
8 | - * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
9 | - */ |
|
3 | + * Text blocks module |
|
4 | + * |
|
5 | + * @author Alexey Krupskiy <[email protected]> |
|
6 | + * @link http://inji.ru/ |
|
7 | + * @copyright 2015 Alexey Krupskiy |
|
8 | + * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE |
|
9 | + */ |
|
10 | 10 | class TextBlocks extends Module |
11 | 11 | { |
12 | 12 | function init() |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | ]]); |
59 | 59 | ?>)</h3> |
60 | 60 | <?php |
61 | - foreach (\Dashboard\Comment::getList([ 'where' => [ |
|
62 | - ['item_id', $item->id], |
|
63 | - ['model', $modelName], |
|
64 | - ], 'order' => ['date', 'desc']]) as $comment) { |
|
65 | - ?> |
|
61 | + foreach (\Dashboard\Comment::getList([ 'where' => [ |
|
62 | + ['item_id', $item->id], |
|
63 | + ['model', $modelName], |
|
64 | + ], 'order' => ['date', 'desc']]) as $comment) { |
|
65 | + ?> |
|
66 | 66 | <div class="row"> |
67 | 67 | <div class="col-sm-3" style="max-width: 300px;"> |
68 | 68 | <a href='/admin/Users/view/User/<?= $comment->user->pk(); ?>'><?= $comment->user->name(); ?></a><br /> |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | </div> |
74 | 74 | </div> |
75 | 75 | <?php |
76 | - } |
|
77 | - ?> |
|
76 | + } |
|
77 | + ?> |
|
78 | 78 | </div> |
79 | 79 | <div> |
80 | 80 | <?php |
81 | - $form = new \Ui\Form(); |
|
82 | - $form->begin(); |
|
83 | - $form->input('textarea', 'comment', 'Комментарий'); |
|
84 | - $form->end(); |
|
85 | - ?> |
|
81 | + $form = new \Ui\Form(); |
|
82 | + $form->begin(); |
|
83 | + $form->input('textarea', 'comment', 'Комментарий'); |
|
84 | + $form->end(); |
|
85 | + ?> |
|
86 | 86 | </div> |
@@ -58,7 +58,7 @@ |
||
58 | 58 | ]]); |
59 | 59 | ?>)</h3> |
60 | 60 | <?php |
61 | - foreach (\Dashboard\Comment::getList([ 'where' => [ |
|
61 | + foreach (\Dashboard\Comment::getList(['where' => [ |
|
62 | 62 | ['item_id', $item->id], |
63 | 63 | ['model', $modelName], |
64 | 64 | ], 'order' => ['date', 'desc']]) as $comment) { |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $this->model->_params[$modelName::index()] = 0; |
74 | 74 | } |
75 | 75 | $relOptions['model']::fixPrefix($relOptions['col']); |
76 | - $inputs[$col] = new ActiveForm(new $relOptions['model']([ $relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
76 | + $inputs[$col] = new ActiveForm(new $relOptions['model']([$relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
77 | 77 | } |
78 | 78 | $inputs[$col]->parent = $this; |
79 | 79 | } elseif (!empty($modelName::$cols[$col])) { |
@@ -608,22 +608,22 @@ |
||
608 | 608 | ?> |
609 | 609 | <ul class="nav nav-list-categorys" data-col='tree_path'> |
610 | 610 | <?php |
611 | - $categoryModel = $this->managerOptions['categorys']['model']; |
|
612 | - $order = []; |
|
613 | - if (!empty($this->managerOptions['sortMode'])) { |
|
614 | - $order[] = ['weight', 'asc']; |
|
615 | - } |
|
616 | - $categorys = $categoryModel::getList(['order' => $order]); |
|
617 | - echo "<li> |
|
611 | + $categoryModel = $this->managerOptions['categorys']['model']; |
|
612 | + $order = []; |
|
613 | + if (!empty($this->managerOptions['sortMode'])) { |
|
614 | + $order[] = ['weight', 'asc']; |
|
615 | + } |
|
616 | + $categorys = $categoryModel::getList(['order' => $order]); |
|
617 | + echo "<li> |
|
618 | 618 | <label class='nav-header'> |
619 | 619 | <a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-path ='/'>/</a> |
620 | 620 | </label> |
621 | 621 | </li>"; |
622 | - foreach ($categorys as $category) { |
|
623 | - if ($category->parent_id == 0) |
|
624 | - $this->showCategory($categorys, $category); |
|
625 | - } |
|
626 | - ?> |
|
622 | + foreach ($categorys as $category) { |
|
623 | + if ($category->parent_id == 0) |
|
624 | + $this->showCategory($categorys, $category); |
|
625 | + } |
|
626 | + ?> |
|
627 | 627 | </ul> |
628 | 628 | <?php |
629 | 629 | } |
@@ -397,7 +397,7 @@ |
||
397 | 397 | return $item->$colName; |
398 | 398 | } |
399 | 399 | } elseif (!empty($modelName::$cols[$colName]['type'])) { |
400 | - if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) { |
|
400 | + if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) { |
|
401 | 401 | $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager'; |
402 | 402 | $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem)); |
403 | 403 | return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($originalItem)) . "/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
@@ -620,8 +620,9 @@ |
||
620 | 620 | </label> |
621 | 621 | </li>"; |
622 | 622 | foreach ($categorys as $category) { |
623 | - if ($category->parent_id == 0) |
|
624 | - $this->showCategory($categorys, $category); |
|
623 | + if ($category->parent_id == 0) { |
|
624 | + $this->showCategory($categorys, $category); |
|
625 | + } |
|
625 | 626 | } |
626 | 627 | ?> |
627 | 628 | </ul> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * Construct new data manager |
29 | 29 | * |
30 | 30 | * @param string $modelName |
31 | - * @param string|array $dataManager |
|
31 | + * @param string $dataManager |
|
32 | 32 | * @throws Exception |
33 | 33 | */ |
34 | 34 | public function __construct($modelName, $dataManager = 'manager') |
@@ -330,6 +330,9 @@ discard block |
||
330 | 330 | return $rows; |
331 | 331 | } |
332 | 332 | |
333 | + /** |
|
334 | + * @param DataManager $dataManager |
|
335 | + */ |
|
333 | 336 | public static function drawCol($item, $colName, $params = [], $dataManager = null, $originalCol = '', $originalItem = null) |
334 | 337 | { |
335 | 338 | $modelName = get_class($item); |
@@ -34,10 +34,11 @@ |
||
34 | 34 | $this->params['page'] = 1; |
35 | 35 | if (!empty($this->data['page'])) { |
36 | 36 | $this->params['page'] = (int) $this->data['page']; |
37 | - if ($this->params['page'] <= 0) |
|
38 | - $this->params['page'] = 1; |
|
39 | - elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) |
|
40 | - $this->params['page'] = ceil($this->options['count'] / $this->params['limit']); |
|
37 | + if ($this->params['page'] <= 0) { |
|
38 | + $this->params['page'] = 1; |
|
39 | + } elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) { |
|
40 | + $this->params['page'] = ceil($this->options['count'] / $this->params['limit']); |
|
41 | + } |
|
41 | 42 | } |
42 | 43 | |
43 | 44 | $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit']; |