@@ -23,7 +23,8 @@ |
||
23 | 23 | $value = $value !== null ? $value : ($object ? $object->$col : ''); |
24 | 24 | if ($parse) { |
25 | 25 | \App::$cur->view->parseSource($value); |
26 | - } else { |
|
26 | + } |
|
27 | + else { |
|
27 | 28 | $str .= $value; |
28 | 29 | } |
29 | 30 |
@@ -46,7 +46,8 @@ discard block |
||
46 | 46 | foreach ($relModels as $model) { |
47 | 47 | if (empty($rels[$model->{$relation['model']::index()}])) { |
48 | 48 | $model->delete(); |
49 | - } else { |
|
49 | + } |
|
50 | + else { |
|
50 | 51 | unset($rels[$model->{$relation['model']::index()}]); |
51 | 52 | } |
52 | 53 | } |
@@ -78,7 +79,8 @@ discard block |
||
78 | 79 | foreach ($relModels as $model) { |
79 | 80 | if (empty($rels[$model->pk()])) { |
80 | 81 | $model->delete(); |
81 | - } else { |
|
82 | + } |
|
83 | + else { |
|
82 | 84 | $model->setParams($rels[$model->pk()]); |
83 | 85 | $model->save(); |
84 | 86 | } |
@@ -17,15 +17,15 @@ |
||
17 | 17 | if (!empty($request[$this->colName]['pass']) && !empty($request[$this->colName]['pass'])) { |
18 | 18 | if (empty($request[$this->colName]['pass'])) { |
19 | 19 | \Msg::add('Вы не ввели пароль в первое поле', 'danger'); |
20 | - return FALSE; |
|
20 | + return false; |
|
21 | 21 | } |
22 | 22 | if (empty($request[$this->colName]['repeat'])) { |
23 | 23 | \Msg::add('Вы не ввели пароль во второе поле', 'danger'); |
24 | - return FALSE; |
|
24 | + return false; |
|
25 | 25 | } |
26 | 26 | if ($request[$this->colName]['pass'] != $request[$this->colName]['repeat']) { |
27 | 27 | \Msg::add('Введенные пароли не совпадают', 'danger'); |
28 | - return FALSE; |
|
28 | + return false; |
|
29 | 29 | } |
30 | 30 | $this->activeForm->model->{$this->colName} = \App::$cur->users->hashpass($request[$this->colName]['pass']); |
31 | 31 | } |
@@ -17,7 +17,8 @@ |
||
17 | 17 | $colName = empty($this->colParams['col']) ? $this->colName : $this->colParams['col']; |
18 | 18 | if (isset($request[$this->colName])) { |
19 | 19 | $this->activeForm->model->{$colName} = json_encode($request[$this->colName]); |
20 | - } else { |
|
20 | + } |
|
21 | + else { |
|
21 | 22 | $this->activeForm->model->{$colName} = 0; |
22 | 23 | $this->activeForm->model->{$colName} = ''; |
23 | 24 | } |
@@ -43,7 +43,8 @@ |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | $inputOptions['values'] = $item->{$relationName}(['forSelect' => true]); |
46 | - } else { |
|
46 | + } |
|
47 | + else { |
|
47 | 48 | $inputOptions['values'] = $this->activeForm->model->{$type['relation']}(['forSelect' => true]); |
48 | 49 | } |
49 | 50 | } |
@@ -45,7 +45,8 @@ discard block |
||
45 | 45 | $colName = empty($this->colParams['col']) ? $this->colName : $this->colParams['col']; |
46 | 46 | if (isset($request[$this->colName])) { |
47 | 47 | $this->activeForm->model->{$colName} = $request[$this->colName]; |
48 | - } else { |
|
48 | + } |
|
49 | + else { |
|
49 | 50 | $this->activeForm->model->{$colName} = 0; |
50 | 51 | $this->activeForm->model->{$colName} = ''; |
51 | 52 | } |
@@ -70,7 +71,8 @@ discard block |
||
70 | 71 | $value = ''; |
71 | 72 | if (!empty($preset['value'])) { |
72 | 73 | $value = $preset['value']; |
73 | - } elseif (!empty($preset['userCol'])) { |
|
74 | + } |
|
75 | + elseif (!empty($preset['userCol'])) { |
|
74 | 76 | if (strpos($preset['userCol'], ':')) { |
75 | 77 | $rel = substr($preset['userCol'], 0, strpos($preset['userCol'], ':')); |
76 | 78 | $param = substr($preset['userCol'], strpos($preset['userCol'], ':') + 1); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | $count += count($items); |
32 | 32 | foreach ($items as $objectChild) { |
33 | - $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc, $order); |
|
33 | + $count += static::showLi($objectChild, 1, $maxDeep, $hrefFunc, $order); |
|
34 | 34 | } |
35 | 35 | ?> |
36 | 36 | </ul> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | echo \Html::el('li', $attributes, $item, true); |
62 | 62 | echo '<ul>'; |
63 | 63 | } |
64 | - $count+=static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc, $order); |
|
64 | + $count += static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc, $order); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | if ($isset) { |
@@ -24,7 +24,8 @@ discard block |
||
24 | 24 | <?php |
25 | 25 | if (is_string($objectRoot)) { |
26 | 26 | $items = $objectRoot::getList(['where' => ['parent_id', 0]]); |
27 | - } else { |
|
27 | + } |
|
28 | + else { |
|
28 | 29 | $class = get_class($objectRoot); |
29 | 30 | $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()], 'order' => $order]); |
30 | 31 | } |
@@ -66,7 +67,8 @@ discard block |
||
66 | 67 | } |
67 | 68 | if ($isset) { |
68 | 69 | echo '</ul></li>'; |
69 | - } else { |
|
70 | + } |
|
71 | + else { |
|
70 | 72 | echo \Html::el('li', $attributes, $item); |
71 | 73 | } |
72 | 74 | return $count; |
@@ -30,7 +30,8 @@ discard block |
||
30 | 30 | foreach ($data as $key => $item) { |
31 | 31 | if (is_array($item)) { |
32 | 32 | $this->genUserDataTree($item, $treeKey ? $treeKey . "[{$key}]" : $key); |
33 | - } else { |
|
33 | + } |
|
34 | + else { |
|
34 | 35 | $this->userDataTree[$treeKey ? $treeKey . "[{$key}]" : $key] = $item; |
35 | 36 | } |
36 | 37 | } |
@@ -58,7 +59,8 @@ discard block |
||
58 | 59 | $params['form'] = $this; |
59 | 60 | if (empty($params['options']['class'])) { |
60 | 61 | $params['options']['class'] = 'htmleditor'; |
61 | - } else { |
|
62 | + } |
|
63 | + else { |
|
62 | 64 | $params['options']['class'] .= ' htmleditor'; |
63 | 65 | } |
64 | 66 | \App::$cur->view->widget('Ui\\' . $this->options['widgetsDir'] . '/textarea', $params); |
@@ -30,15 +30,18 @@ |
||
30 | 30 | $this->params['page'] = 0; |
31 | 31 | $this->params['pages'] = 0; |
32 | 32 | $this->params['start'] = 0; |
33 | - } else { |
|
33 | + } |
|
34 | + else { |
|
34 | 35 | $this->params['pages'] = ceil($this->options['count'] / $this->params['limit']); |
35 | 36 | $this->params['page'] = 1; |
36 | 37 | if (!empty($this->data['page'])) { |
37 | 38 | $this->params['page'] = (int) $this->data['page']; |
38 | - if ($this->params['page'] <= 0) |
|
39 | - $this->params['page'] = 1; |
|
40 | - elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) |
|
41 | - $this->params['page'] = ceil($this->options['count'] / $this->params['limit']); |
|
39 | + if ($this->params['page'] <= 0) { |
|
40 | + $this->params['page'] = 1; |
|
41 | + } |
|
42 | + elseif ($this->params['page'] > ceil($this->options['count'] / $this->params['limit'])) { |
|
43 | + $this->params['page'] = ceil($this->options['count'] / $this->params['limit']); |
|
44 | + } |
|
42 | 45 | } |
43 | 46 | |
44 | 47 | $this->params['start'] = $this->params['page'] * $this->params['limit'] - $this->params['limit']; |