@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $this->formName = $form; |
49 | 49 | $this->form = \App::$cur->ui->getModelForm($this->modelName, $form); |
50 | 50 | if (empty($this->form)) { |
51 | - throw new \Exception('empty form ' . $form); |
|
51 | + throw new \Exception('empty form '.$form); |
|
52 | 52 | } |
53 | 53 | $this->inputs = $this->getInputs(); |
54 | 54 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->model->_params[$modelName::index()] = 0; |
85 | 85 | } |
86 | 86 | $relOptions['model']::fixPrefix($relOptions['col']); |
87 | - $inputs[$col] = new ActiveForm(new $relOptions['model']([ $relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
87 | + $inputs[$col] = new ActiveForm(new $relOptions['model']([$relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
88 | 88 | } |
89 | 89 | $inputs[$col]->parent = $this; |
90 | 90 | } elseif (!empty($modelName::$cols[$col])) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public function checkRequest($params = [], $ajax = false) |
99 | 99 | { |
100 | 100 | if (!$this->checkAccess()) { |
101 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->formName . '"'); |
|
101 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->formName.'"'); |
|
102 | 102 | return []; |
103 | 103 | } |
104 | 104 | $successId = 0; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | if (!empty($this->form['userGroupReadonly'][\Users\User::$cur->group_id]) && in_array($col, $this->form['userGroupReadonly'][\Users\User::$cur->group_id])) { |
123 | 123 | continue; |
124 | 124 | } |
125 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($param['type']); |
|
125 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($param['type']); |
|
126 | 126 | $input = new $inputClassName(); |
127 | 127 | $input->activeForm = $this; |
128 | 128 | $input->activeFormParams = $params; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if ($ajax) { |
168 | 168 | \Msg::show(); |
169 | 169 | } elseif (!empty($_GET['redirectUrl'])) { |
170 | - \Tools::redirect($_GET['redirectUrl'] . (!empty($_GET['dataManagerHash']) ? '#' . $_GET['dataManagerHash'] : '')); |
|
170 | + \Tools::redirect($_GET['redirectUrl'].(!empty($_GET['dataManagerHash']) ? '#'.$_GET['dataManagerHash'] : '')); |
|
171 | 171 | } |
172 | 172 | $successId = $this->model->pk(); |
173 | 173 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function draw($params = [], $ajax = false) |
183 | 183 | { |
184 | 184 | if (!$this->checkAccess()) { |
185 | - $this->drawError('you not have access to "' . $this->modelName . '" form with name: "' . $this->formName . '"'); |
|
185 | + $this->drawError('you not have access to "'.$this->modelName.'" form with name: "'.$this->formName.'"'); |
|
186 | 186 | return []; |
187 | 187 | } |
188 | 188 | $form = new Form(!empty($this->form['formOptions']) ? $this->form['formOptions'] : []); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | if (is_object($options)) { |
195 | 195 | $options->draw(); |
196 | 196 | } else { |
197 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($options['type']); |
|
197 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($options['type']); |
|
198 | 198 | $input = new $inputClassName(); |
199 | 199 | $input->form = $form; |
200 | 200 | $input->activeForm = $this; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | foreach ($values as $key => $value) { |
273 | 273 | if (is_array($value) && !empty($value['input']) && empty($value['input']['noprefix'])) { |
274 | - $values[$key]['input']['name'] = $aditionalInputNamePrefix . "[{$value['input']['name']}]"; |
|
274 | + $values[$key]['input']['name'] = $aditionalInputNamePrefix."[{$value['input']['name']}]"; |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | return $values; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | public function checkAccess() |
296 | 296 | { |
297 | 297 | if (empty($this->form)) { |
298 | - $this->drawError('"' . $this->modelName . '" form with name: "' . $this->formName . '" not found'); |
|
298 | + $this->drawError('"'.$this->modelName.'" form with name: "'.$this->formName.'" not found'); |
|
299 | 299 | return false; |
300 | 300 | } |
301 | 301 | if (\App::$cur->Access && !\App::$cur->Access->checkAccess($this)) { |
@@ -29,11 +29,11 @@ |
||
29 | 29 | <select class ='form-control' id = 'widgetChooser' onchange="selectChange(this);"> |
30 | 30 | <option value = ''>Выберите виджет</option> |
31 | 31 | <?php |
32 | - foreach ($widgets as $code => $options) { |
|
33 | - $name = is_string($options) ? $options : $options['name']; |
|
34 | - echo "<option value = '{$code}' data-filename='{$code}'>{$name}</option>"; |
|
35 | - } |
|
36 | - ?> |
|
32 | + foreach ($widgets as $code => $options) { |
|
33 | + $name = is_string($options) ? $options : $options['name']; |
|
34 | + echo "<option value = '{$code}' data-filename='{$code}'>{$name}</option>"; |
|
35 | + } |
|
36 | + ?> |
|
37 | 37 | </select> |
38 | 38 | <?php |
39 | 39 | foreach ($widgets as $code => $options) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | </select> |
38 | 38 | <?php |
39 | 39 | foreach ($widgets as $code => $options) { |
40 | - echo "<div id = 'params_" . str_replace('\\', '-', $code) . "' class = 'widgetParams' style='display:none;'>"; |
|
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 | 43 | } elseif (isset($options['params'])) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | if ($param['type'] == 'select') { |
49 | 49 | echo "<div class = 'form-group'> |
50 | 50 | <label>{$param['name']}</label> |
51 | - <select name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control' >"; |
|
51 | + <select name = 'params[".str_replace('\\', '-', $code)."][]' class = 'form-control' >"; |
|
52 | 52 | foreach ($param['model']::get_list() as $item) { |
53 | 53 | echo "<option value = '{$item->pk()}'>{$item->$param['showCol']}</option>"; |
54 | 54 | } |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | } elseif ($param['type'] == 'textarea') { |
58 | 58 | echo "<div class = 'form-group'> |
59 | 59 | <label>{$param['name']}</label> |
60 | - <textarea name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control'></textarea> |
|
60 | + <textarea name = 'params[".str_replace('\\', '-', $code)."][]' class = 'form-control'></textarea> |
|
61 | 61 | </div>"; |
62 | 62 | } else { |
63 | 63 | echo "<div class = 'form-group'> |
64 | 64 | <label>{$param['name']}</label> |
65 | - <input name = 'params[" . str_replace('\\', '-', $code) . "][]' class = 'form-control' /> |
|
65 | + <input name = 'params[".str_replace('\\', '-', $code)."][]' class = 'form-control' /> |
|
66 | 66 | </div>"; |
67 | 67 | } |
68 | 68 | } |