@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $showedInput = count($aditionalInputs) - 1; |
| 24 | 24 | $aditionValue = !empty($options['aditionalValue']) ? $options['aditionalValue'] : ''; |
| 25 | 25 | } |
| 26 | - $optionsHtml .= "<option data-aditionalInput='" . ( count($aditionalInputs) - 1) . "' value ='{$key}'{$selected}>{$value['text']}</option>"; |
|
| 26 | + $optionsHtml .= "<option data-aditionalInput='".(count($aditionalInputs) - 1)."' value ='{$key}'{$selected}>{$value['text']}</option>"; |
|
| 27 | 27 | } else { |
| 28 | 28 | $optionsHtml .= "<option value ='{$key}'{$selected}>{$value}</option>"; |
| 29 | 29 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | <?= $label !== false ? "<label>{$label}" : ''; ?> |
| 34 | 34 | <?php |
| 35 | 35 | if ($label !== false && !empty($options['createBtn'])) { |
| 36 | - echo ' (<a href="" onclick="' . $options['createBtn']['onclick'] . ';this.disabled=true;return false;">' . $options['createBtn']['text'] . '</a>)'; |
|
| 36 | + echo ' (<a href="" onclick="'.$options['createBtn']['onclick'].';this.disabled=true;return false;">'.$options['createBtn']['text'].'</a>)'; |
|
| 37 | 37 | } |
| 38 | 38 | ?> |
| 39 | 39 | <?= $label !== false ? "</label>" : ''; ?> |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | if ($key !== $showedInput) { |
| 48 | 48 | $input['options']['disabled'] = true; |
| 49 | - $input['options']['class'] = !empty($input['options']['class']) ? $input['options']['class'] . ' hidden' : 'hidden'; |
|
| 49 | + $input['options']['class'] = !empty($input['options']['class']) ? $input['options']['class'].' hidden' : 'hidden'; |
|
| 50 | 50 | } else { |
| 51 | 51 | $input['options']['value'] = empty($input['options']['value']) ? $aditionValue : $input['options']['value']; |
| 52 | 52 | } |
| 53 | 53 | if ($input['type'] == 'select') { |
| 54 | 54 | $input['options']['values'] = \Ui\ActiveForm::getOptionsList($input); |
| 55 | 55 | } |
| 56 | - $form->input($input['type'], empty($input['name']) ? $name . '[aditional]' : $input['name'], false, $input['options']); |
|
| 56 | + $form->input($input['type'], empty($input['name']) ? $name.'[aditional]' : $input['name'], false, $input['options']); |
|
| 57 | 57 | } |
| 58 | 58 | ?> |
| 59 | 59 | <?= empty($options['noContainer']) ? '</div>' : ''; ?> |
| 60 | 60 | \ No newline at end of file |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | echo $col['col']['label']; |
| 22 | 22 | if (!empty($col['col']['model'])) { |
| 23 | 23 | $modelName = $col['col']['model']; |
| 24 | - $onclick = 'inji.Ui.forms.popUp(\'' . addslashes($modelName) . '\',{},function(elem){' |
|
| 24 | + $onclick = 'inji.Ui.forms.popUp(\''.addslashes($modelName).'\',{},function(elem){' |
|
| 25 | 25 | . 'return function(data,modal){inji.Ui.forms.submitAjax($(elem).closest(\'form\')[0], {notSave: true});}}(this));return false;'; |
| 26 | - echo ' (<a href="" onclick="' . $onclick . ';this.disabled=true;return false;">Создать</a>)'; |
|
| 26 | + echo ' (<a href="" onclick="'.$onclick.';this.disabled=true;return false;">Создать</a>)'; |
|
| 27 | 27 | } |
| 28 | 28 | echo "</th>"; |
| 29 | 29 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | echo '<td>'; |
| 43 | 43 | $col['options']['noContainer'] = true; |
| 44 | 44 | $col['options']['value'] = $row[$colName]; |
| 45 | - $form->input($col['type'], $name . '[' . ($i) . '][' . $colName . ']', false, $col['options']); |
|
| 45 | + $form->input($col['type'], $name.'['.($i).']['.$colName.']', false, $col['options']); |
|
| 46 | 46 | echo '</td>'; |
| 47 | 47 | } |
| 48 | 48 | echo '<td class="actionTd"><a class="btn btn-danger btn-xs" onclick="inji.Ui.forms.delRowFromList(this);"><i class="glyphicon glyphicon-remove"></i></a></td>'; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->name = $this->managerOptions['name']; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $this->managerId = str_replace('\\', '_', 'dataManager_' . $this->modelName . '_' . $this->managerName . '_' . \Tools::randomString()); |
|
| 60 | + $this->managerId = str_replace('\\', '_', 'dataManager_'.$this->modelName.'_'.$this->managerName.'_'.\Tools::randomString()); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if (!empty($this->managerOptions['filters'])) { |
| 104 | 104 | $buttons[] = [ |
| 105 | 105 | 'text' => 'Фильтры', |
| 106 | - 'onclick' => ' var modal = $("#' . $this->managerId . '_filters"); |
|
| 106 | + 'onclick' => ' var modal = $("#'.$this->managerId.'_filters"); |
|
| 107 | 107 | modal.modal("show");', |
| 108 | 108 | ]; |
| 109 | 109 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $formParams['formName'] = 'simpleItem'; |
| 112 | 112 | $buttons[] = [ |
| 113 | 113 | 'text' => '<i class = "glyphicon glyphicon-send"></i> Быстрое создание', |
| 114 | - 'onclick' => 'inji.Ui.dataManagers.get(this).newItem("' . str_replace('\\', '\\\\', $modelName) . '",' . json_encode($formParams) . ');', |
|
| 114 | + 'onclick' => 'inji.Ui.dataManagers.get(this).newItem("'.str_replace('\\', '\\\\', $modelName).'",'.json_encode($formParams).');', |
|
| 115 | 115 | ]; |
| 116 | 116 | } |
| 117 | 117 | $formParams['formName'] = !empty($this->managerOptions['editForm']) ? $this->managerOptions['editForm'] : 'manager'; |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | $name = $modelName::$objectName; |
| 121 | 121 | } |
| 122 | 122 | $buttons[] = [ |
| 123 | - 'text' => 'Создать ' . $name, |
|
| 124 | - 'onclick' => 'inji.Ui.dataManagers.get(this).newItem("' . str_replace('\\', '\\\\', $modelName) . '",' . json_encode($formParams) . ');', |
|
| 123 | + 'text' => 'Создать '.$name, |
|
| 124 | + 'onclick' => 'inji.Ui.dataManagers.get(this).newItem("'.str_replace('\\', '\\\\', $modelName).'",'.json_encode($formParams).');', |
|
| 125 | 125 | ]; |
| 126 | 126 | |
| 127 | 127 | return $buttons; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | 'className' => $action |
| 151 | 151 | ]; |
| 152 | 152 | } |
| 153 | - $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\' . $return[$key]['className']) ? 'Ui\DataManager\Action\\' . $return[$key]['className'] : $return[$key]['className']; |
|
| 153 | + $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\'.$return[$key]['className']) ? 'Ui\DataManager\Action\\'.$return[$key]['className'] : $return[$key]['className']; |
|
| 154 | 154 | if (!class_exists($return[$key]['className']) || ($onlyGroupActions && !$return[$key]['className']::$groupAction)) { |
| 155 | 155 | unset($return[$key]); |
| 156 | 156 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | <?php |
| 182 | 182 | foreach ($actions as $action => $actionParams) { |
| 183 | 183 | if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) { |
| 184 | - echo "<li><a role='button' href ='#' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>"; |
|
| 184 | + echo "<li><a role='button' href ='#' onclick='inji.Ui.dataManagers.get(this).groupAction(\"".str_replace('\\', '\\\\', $action)."\");return false;'>{$actionParams['className']::$name}</a></li>"; |
|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | ?> |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | return []; |
| 232 | 232 | } |
| 233 | 233 | if (!$this->checkAccess()) { |
| 234 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"'); |
|
| 234 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"'); |
|
| 235 | 235 | return []; |
| 236 | 236 | } |
| 237 | 237 | $modelName = $this->modelName; |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $queryParams['start'] = $this->page * $this->limit - $this->limit; |
| 248 | 248 | } |
| 249 | 249 | if (!empty($params['categoryPath']) && $modelName::$categoryModel) { |
| 250 | - $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE']; |
|
| 250 | + $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE']; |
|
| 251 | 251 | } |
| 252 | 252 | if (!empty($params['appType'])) { |
| 253 | 253 | $queryParams['appType'] = $params['appType']; |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | if (!empty($params['filters'][$col]['max'])) { |
| 307 | 307 | if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) { |
| 308 | 308 | |
| 309 | - $date = $params['filters'][$col]['max'] . ' 23:59:59'; |
|
| 309 | + $date = $params['filters'][$col]['max'].' 23:59:59'; |
|
| 310 | 310 | } else { |
| 311 | 311 | $date = $params['filters'][$col]['max']; |
| 312 | 312 | } |
@@ -333,16 +333,16 @@ discard block |
||
| 333 | 333 | } |
| 334 | 334 | switch ($params['filters'][$col]['compareType']) { |
| 335 | 335 | case 'contains': |
| 336 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
| 336 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE']; |
|
| 337 | 337 | break; |
| 338 | 338 | case 'equals': |
| 339 | 339 | $queryParams['where'][] = [$col, $params['filters'][$col]['value']]; |
| 340 | 340 | break; |
| 341 | 341 | case 'starts_with': |
| 342 | - $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
| 342 | + $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE']; |
|
| 343 | 343 | break; |
| 344 | 344 | case 'ends_with': |
| 345 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE']; |
|
| 345 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE']; |
|
| 346 | 346 | break; |
| 347 | 347 | } |
| 348 | 348 | break; |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $item = $relation['relModel']::get([[$item->index(), $item->id], [$model->index(), $model->id]]); |
| 382 | 382 | } |
| 383 | 383 | $row = []; |
| 384 | - $row[] = '<input type ="checkbox" name = "pk[]" value =' . $item->pk() . '>'; |
|
| 384 | + $row[] = '<input type ="checkbox" name = "pk[]" value ='.$item->pk().'>'; |
|
| 385 | 385 | $row[] = $item->pk(); |
| 386 | 386 | foreach ($this->managerOptions['cols'] as $key => $colName) { |
| 387 | 387 | if (!empty($params['download'])) { |
@@ -426,16 +426,16 @@ discard block |
||
| 426 | 426 | $managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 427 | 427 | $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 428 | 428 | $count = $count ? $count : 'Нет'; |
| 429 | - return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>"; |
|
| 429 | + return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>"; |
|
| 430 | 430 | case 'many': |
| 431 | 431 | $managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 432 | 432 | $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 433 | 433 | $count = $count ? $count : 'Нет'; |
| 434 | - return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>"; |
|
| 434 | + return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>"; |
|
| 435 | 435 | default : |
| 436 | 436 | if ($item->{$modelName::$cols[$colName]['relation']}) { |
| 437 | 437 | if (\App::$cur->name == 'admin') { |
| 438 | - $href = "<a href ='/admin/" . str_replace('\\', '/view/', $relations[$modelName::$cols[$colName]['relation']]['model']) . "/" . $item->{$modelName::$cols[$colName]['relation']}->pk() . "'>"; |
|
| 438 | + $href = "<a href ='/admin/".str_replace('\\', '/view/', $relations[$modelName::$cols[$colName]['relation']]['model'])."/".$item->{$modelName::$cols[$colName]['relation']}->pk()."'>"; |
|
| 439 | 439 | if (!empty($modelName::$cols[$colName]['showCol'])) { |
| 440 | 440 | $href .= $item->{$modelName::$cols[$colName]['relation']}->{$modelName::$cols[$colName]['showCol']}; |
| 441 | 441 | } else { |
@@ -465,18 +465,18 @@ discard block |
||
| 465 | 465 | case 'many': |
| 466 | 466 | $managerParams = ['relation' => $modelName::$cols[$colName]['relation']]; |
| 467 | 467 | $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1])); |
| 468 | - return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>"; |
|
| 468 | + return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count} ".\Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов'])."</a>"; |
|
| 469 | 469 | default: |
| 470 | 470 | return $item->$colName; |
| 471 | 471 | } |
| 472 | 472 | } elseif (!empty($modelName::$cols[$colName]['type'])) { |
| 473 | - if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) { |
|
| 473 | + if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) { |
|
| 474 | 474 | $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager'; |
| 475 | - $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem)); |
|
| 476 | - return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($originalItem)) . "/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
| 475 | + $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem)); |
|
| 476 | + return "<a href ='/admin/".str_replace('\\', '/view/', get_class($originalItem))."/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
| 477 | 477 | } elseif (\App::$cur->name == 'admin' && $colName == 'name') { |
| 478 | - $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem)); |
|
| 479 | - return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($item)) . "/{$item->id}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
| 478 | + $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem)); |
|
| 479 | + return "<a href ='/admin/".str_replace('\\', '/view/', get_class($item))."/{$item->id}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>"; |
|
| 480 | 480 | } else { |
| 481 | 481 | return \Model::resloveTypeValue($item, $colName); |
| 482 | 482 | } |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | return []; |
| 510 | 510 | } |
| 511 | 511 | if (!$this->checkAccess()) { |
| 512 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"'); |
|
| 512 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"'); |
|
| 513 | 513 | return []; |
| 514 | 514 | } |
| 515 | 515 | if (!empty($params['limit'])) { |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | ]; |
| 524 | 524 | $modelName = $this->modelName; |
| 525 | 525 | if (!empty($params['categoryPath']) && $modelName::$categoryModel) { |
| 526 | - $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE']; |
|
| 526 | + $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE']; |
|
| 527 | 527 | } |
| 528 | 528 | if (!empty($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'])) { |
| 529 | 529 | foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) { |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | if (!empty($params['filters'][$col]['max'])) { |
| 578 | 578 | if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) { |
| 579 | 579 | |
| 580 | - $date = $params['filters'][$col]['max'] . ' 23:59:59'; |
|
| 580 | + $date = $params['filters'][$col]['max'].' 23:59:59'; |
|
| 581 | 581 | } else { |
| 582 | 582 | $date = $params['filters'][$col]['max']; |
| 583 | 583 | } |
@@ -604,16 +604,16 @@ discard block |
||
| 604 | 604 | } |
| 605 | 605 | switch ($params['filters'][$col]['compareType']) { |
| 606 | 606 | case 'contains': |
| 607 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
| 607 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE']; |
|
| 608 | 608 | break; |
| 609 | 609 | case 'equals': |
| 610 | 610 | $queryParams['where'][] = [$col, $params['filters'][$col]['value']]; |
| 611 | 611 | break; |
| 612 | 612 | case 'starts_with': |
| 613 | - $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE']; |
|
| 613 | + $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE']; |
|
| 614 | 614 | break; |
| 615 | 615 | case 'ends_with': |
| 616 | - $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE']; |
|
| 616 | + $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE']; |
|
| 617 | 617 | break; |
| 618 | 618 | } |
| 619 | 619 | break; |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $tableCols[] = !empty($colOptions['label']) ? $colOptions['label'] : $colName; |
| 647 | 647 | } |
| 648 | 648 | $tableCols[] = ''; |
| 649 | - $this->table->class .=' datamanagertable'; |
|
| 649 | + $this->table->class .= ' datamanagertable'; |
|
| 650 | 650 | $this->table->setCols($tableCols); |
| 651 | 651 | } |
| 652 | 652 | |
@@ -667,12 +667,12 @@ discard block |
||
| 667 | 667 | return false; |
| 668 | 668 | } |
| 669 | 669 | if (!$this->checkAccess()) { |
| 670 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"'); |
|
| 670 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"'); |
|
| 671 | 671 | return []; |
| 672 | 672 | } |
| 673 | 673 | $tree = new Tree(); |
| 674 | 674 | $tree->ul($this->managerOptions['categorys']['model'], 0, function($category) { |
| 675 | - $path = $category->tree_path . ($category->pk() ? $category->pk() . "/" : ''); |
|
| 675 | + $path = $category->tree_path.($category->pk() ? $category->pk()."/" : ''); |
|
| 676 | 676 | $cleanClassName = str_replace('\\', '\\\\', get_class($category)); |
| 677 | 677 | return "<a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-index='{$category->index()}' data-path ='{$path}' data-id='{$category->pk()}' data-model='{$this->managerOptions['categorys']['model']}'> {$category->name}</a> |
| 678 | 678 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $this->formName = $form; |
| 48 | 48 | $this->form = \App::$cur->ui->getModelForm($this->modelName, $form); |
| 49 | 49 | if (empty($this->form)) { |
| 50 | - throw new \Exception('empty form ' . $form); |
|
| 50 | + throw new \Exception('empty form '.$form); |
|
| 51 | 51 | } |
| 52 | 52 | $this->inputs = $this->getInputs(); |
| 53 | 53 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->model->_params[$modelName::index()] = 0; |
| 83 | 83 | } |
| 84 | 84 | $relOptions['model']::fixPrefix($relOptions['col']); |
| 85 | - $inputs[$col] = new ActiveForm(new $relOptions['model']([ $relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
| 85 | + $inputs[$col] = new ActiveForm(new $relOptions['model']([$relOptions['col'] => &$this->model->_params[$modelName::index()]]), $colPath[2]); |
|
| 86 | 86 | } |
| 87 | 87 | $inputs[$col]->parent = $this; |
| 88 | 88 | } elseif (!empty($modelName::$cols[$col])) { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | public function checkRequest($params = [], $ajax = false) { |
| 97 | 97 | if (!$this->checkAccess()) { |
| 98 | - $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->formName . '"'); |
|
| 98 | + $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->formName.'"'); |
|
| 99 | 99 | return []; |
| 100 | 100 | } |
| 101 | 101 | $successId = 0; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if (!empty($this->form['userGroupReadonly'][\Users\User::$cur->group_id]) && in_array($col, $this->form['userGroupReadonly'][\Users\User::$cur->group_id])) { |
| 127 | 127 | continue; |
| 128 | 128 | } |
| 129 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($param['type']); |
|
| 129 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($param['type']); |
|
| 130 | 130 | $input = new $inputClassName(); |
| 131 | 131 | $input->activeForm = $this; |
| 132 | 132 | $input->activeFormParams = $params; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if ($ajax) { |
| 172 | 172 | \Msg::show(); |
| 173 | 173 | } elseif (!empty($_GET['redirectUrl'])) { |
| 174 | - \Tools::redirect($_GET['redirectUrl'] . (!empty($_GET['dataManagerHash']) ? '#' . $_GET['dataManagerHash'] : '')); |
|
| 174 | + \Tools::redirect($_GET['redirectUrl'].(!empty($_GET['dataManagerHash']) ? '#'.$_GET['dataManagerHash'] : '')); |
|
| 175 | 175 | } |
| 176 | 176 | $successId = $this->model->pk(); |
| 177 | 177 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | public function draw($params = [], $ajax = false) { |
| 188 | 188 | if (!$this->checkAccess()) { |
| 189 | - $this->drawError('you not have access to "' . $this->modelName . '" form with name: "' . $this->formName . '"'); |
|
| 189 | + $this->drawError('you not have access to "'.$this->modelName.'" form with name: "'.$this->formName.'"'); |
|
| 190 | 190 | return []; |
| 191 | 191 | } |
| 192 | 192 | $form = new Form(!empty($this->form['formOptions']) ? $this->form['formOptions'] : []); |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (is_object($options)) { |
| 198 | 198 | $options->draw(); |
| 199 | 199 | } else { |
| 200 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($options['type']); |
|
| 200 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($options['type']); |
|
| 201 | 201 | $input = new $inputClassName(); |
| 202 | 202 | $input->form = $form; |
| 203 | 203 | $input->activeForm = $this; |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | foreach ($values as $key => $value) { |
| 275 | 275 | if (is_array($value) && !empty($value['input']) && empty($value['input']['noprefix'])) { |
| 276 | - $values[$key]['input']['name'] = $aditionalInputNamePrefix . "[{$value['input']['name']}]"; |
|
| 276 | + $values[$key]['input']['name'] = $aditionalInputNamePrefix."[{$value['input']['name']}]"; |
|
| 277 | 277 | } |
| 278 | 278 | } |
| 279 | 279 | return $values; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public function checkAccess() { |
| 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)) { |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | switch ($this->colParams['source']) { |
| 87 | 87 | case'options': |
| 88 | 88 | foreach ($this->colParams['options']['inputs'] as $colName => $col) { |
| 89 | - $inputClassName = '\Ui\ActiveForm\Input\\' . ucfirst($col['type']); |
|
| 89 | + $inputClassName = '\Ui\ActiveForm\Input\\'.ucfirst($col['type']); |
|
| 90 | 90 | $input = new $inputClassName(); |
| 91 | 91 | $input->form = $this->form; |
| 92 | 92 | $input->activeForm = $this->activeForm; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function colName() { |
| 85 | - return "{$this->activeForm->requestFormName}[{$this->activeForm->modelName}]".(stristr($this->colName, '[')?$this->colName:"[{$this->colName}]"); |
|
| 85 | + return "{$this->activeForm->requestFormName}[{$this->activeForm->modelName}]".(stristr($this->colName, '[') ? $this->colName : "[{$this->colName}]"); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function colLabel() { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function validate(&$request) { |
| 98 | 98 | if (empty($request[$this->colName]) && !empty($this->colParams['required'])) { |
| 99 | - throw new \Exception('Вы не заполнили: ' . $this->colLabel()); |
|
| 99 | + throw new \Exception('Вы не заполнили: '.$this->colLabel()); |
|
| 100 | 100 | } |
| 101 | 101 | if (!empty($this->colParams['validator'])) { |
| 102 | 102 | $modelName = $this->modelName; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'size' => $_FILES['ActiveForm_simpleItem']['size']['Ecommerce\Item']['image'], |
| 72 | 72 | 'error' => $_FILES['ActiveForm_simpleItem']['error']['Ecommerce\Item']['image'], |
| 73 | 73 | ], [ |
| 74 | - 'upload_code' => 'activeForm:' . 'Ecommerce\Item' . ':' . $item->pk(), |
|
| 74 | + 'upload_code' => 'activeForm:'.'Ecommerce\Item'.':'.$item->pk(), |
|
| 75 | 75 | 'accept_group' => 'image' |
| 76 | 76 | ]); |
| 77 | 77 | if ($file_id) { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | 'option' => ['type' => 'select', 'source' => 'model', 'model' => 'Ecommerce\Item\Offer\Option', 'label' => 'Свойство предложения'], |
| 169 | 169 | 'value' => ['type' => 'dynamicType', 'typeSource' => 'selfMethod', 'selfMethod' => 'realType', 'label' => 'Значение'], |
| 170 | 170 | ] |
| 171 | - ],'label'=>'Параметры предлоежния' |
|
| 171 | + ], 'label'=>'Параметры предлоежния' |
|
| 172 | 172 | ] |
| 173 | 173 | ], |
| 174 | 174 | 'map' => [ |
@@ -225,17 +225,17 @@ discard block |
||
| 225 | 225 | public function beforeSave() { |
| 226 | 226 | |
| 227 | 227 | if ($this->id) { |
| 228 | - $this->search_index = $this->name . ' '; |
|
| 228 | + $this->search_index = $this->name.' '; |
|
| 229 | 229 | if ($this->category) { |
| 230 | - $this->search_index .= $this->category->name . ' '; |
|
| 230 | + $this->search_index .= $this->category->name.' '; |
|
| 231 | 231 | } |
| 232 | 232 | if ($this->options) { |
| 233 | 233 | foreach ($this->options as $option) { |
| 234 | 234 | if ($option->item_option_searchable && $option->value) { |
| 235 | 235 | if ($option->item_option_type != 'select') { |
| 236 | - $this->search_index .= $option->value . ' '; |
|
| 236 | + $this->search_index .= $option->value.' '; |
|
| 237 | 237 | } elseif (!empty($option->option->items[$option->value])) { |
| 238 | - $option->option->items[$option->value]->value . ' '; |
|
| 238 | + $option->option->items[$option->value]->value.' '; |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | } |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | foreach ($offer->options as $option) { |
| 247 | 247 | if ($option->item_offer_option_searchable && $option->value) { |
| 248 | 248 | if ($option->item_offer_option_type != 'select') { |
| 249 | - $this->search_index .= $option->value . ' '; |
|
| 249 | + $this->search_index .= $option->value.' '; |
|
| 250 | 250 | } elseif (!empty($option->option->items[$option->value])) { |
| 251 | - $option->option->items[$option->value]->value . ' '; |
|
| 251 | + $option->option->items[$option->value]->value.' '; |
|
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | 'col' => 'item_id', |
| 272 | 272 | //'resultKey' => 'code', |
| 273 | 273 | 'resultKey' => 'item_option_id', |
| 274 | - 'join' => [Item\Option::table(), Item\Option::index() . ' = ' . Item\Param::colPrefix() . Item\Option::index()] |
|
| 274 | + 'join' => [Item\Option::table(), Item\Option::index().' = '.Item\Param::colPrefix().Item\Option::index()] |
|
| 275 | 275 | ], |
| 276 | 276 | 'offers' => [ |
| 277 | 277 | 'type' => 'many', |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $curPrice = $price; |
| 308 | 308 | } elseif ( |
| 309 | 309 | (!$price->type->roles && !$curPrice) || |
| 310 | - ($price->type->roles && !$curPrice && strpos($price->type->roles, "|" . \Users\User::$cur->role_id . "|") !== false) |
|
| 310 | + ($price->type->roles && !$curPrice && strpos($price->type->roles, "|".\Users\User::$cur->role_id."|") !== false) |
|
| 311 | 311 | ) { |
| 312 | 312 | $curPrice = $price; |
| 313 | 313 | } |
@@ -75,8 +75,8 @@ |
||
| 75 | 75 | unset($items[$key]); |
| 76 | 76 | unset($item); |
| 77 | 77 | } |
| 78 | - echo 'Происходит процесс индексации: проиндексировано ' . $i * $count; |
|
| 79 | - Tools::redirect('/admin/ecommerce/reSearchIndex/' . $i); |
|
| 78 | + echo 'Происходит процесс индексации: проиндексировано '.$i * $count; |
|
| 79 | + Tools::redirect('/admin/ecommerce/reSearchIndex/'.$i); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |