@@ -41,8 +41,8 @@ |
||
| 41 | 41 | <div class ='row'> |
| 42 | 42 | <div class="col-sm-6"> |
| 43 | 43 | <?php |
| 44 | - if (!empty(App::$cur->users->config['invites'])) { |
|
| 45 | - ?> |
|
| 44 | + if (!empty(App::$cur->users->config['invites'])) { |
|
| 45 | + ?> |
|
| 46 | 46 | <div class ='form-group'> |
| 47 | 47 | <label><?= !empty(App::$cur->users->config['invitesName']) ? App::$cur->users->config['invitesName'] : 'Код приглашения'; ?></label> |
| 48 | 48 | <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'] : ''))))); ?>" /> |
@@ -5,15 +5,15 @@ |
||
| 5 | 5 | <h3>Вход</h3> |
| 6 | 6 | <div class="form-group"> |
| 7 | 7 | <?php |
| 8 | - $socials = Users\Social::getList(['where' => ['active', 1]]); |
|
| 9 | - if ($socials) { |
|
| 10 | - echo 'Войти через: '; |
|
| 11 | - foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { |
|
| 12 | - $text = $social->image ? '<img src ="' . Statics::file($social->image->path) . '">' : $social->name(); |
|
| 13 | - echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> "; |
|
| 14 | - } |
|
| 15 | - } |
|
| 16 | - ?> |
|
| 8 | + $socials = Users\Social::getList(['where' => ['active', 1]]); |
|
| 9 | + if ($socials) { |
|
| 10 | + echo 'Войти через: '; |
|
| 11 | + foreach (Users\Social::getList(['where' => ['active', 1]]) as $social) { |
|
| 12 | + $text = $social->image ? '<img src ="' . Statics::file($social->image->path) . '">' : $social->name(); |
|
| 13 | + echo "<a href = '/users/social/auth/{$social->code}'>{$text}</a> "; |
|
| 14 | + } |
|
| 15 | + } |
|
| 16 | + ?> |
|
| 17 | 17 | </div> |
| 18 | 18 | <form action = '' method = 'POST' > |
| 19 | 19 | <div class ='row'> |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | ?> |
| 36 | 36 | <div> |
| 37 | 37 | <h3>Комментарии (<?= |
| 38 | - \Dashboard\Comment::getCount(['where' => [ |
|
| 39 | - ['item_id', $item->id], |
|
| 40 | - ['model', $modelName], |
|
| 41 | - ]]); |
|
| 42 | - ?>)</h3> |
|
| 38 | + \Dashboard\Comment::getCount(['where' => [ |
|
| 39 | + ['item_id', $item->id], |
|
| 40 | + ['model', $modelName], |
|
| 41 | + ]]); |
|
| 42 | + ?>)</h3> |
|
| 43 | 43 | <?php |
| 44 | 44 | foreach (\Dashboard\Comment::getList([ 'where' => [ |
| 45 | 45 | ['item_id', $item->id], |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | </div> |
| 62 | 62 | <div> |
| 63 | 63 | <?php |
| 64 | - $form = new \Ui\Form(); |
|
| 65 | - $form->begin('Оставить комментарий'); |
|
| 66 | - $form->input('textarea', 'comment', 'Комментарий'); |
|
| 67 | - $form->end(); |
|
| 68 | - ?> |
|
| 64 | + $form = new \Ui\Form(); |
|
| 65 | + $form->begin('Оставить комментарий'); |
|
| 66 | + $form->input('textarea', 'comment', 'Комментарий'); |
|
| 67 | + $form->end(); |
|
| 68 | + ?> |
|
| 69 | 69 | </div> |
| 70 | 70 | <div> |
| 71 | 71 | <h1>Хронология</h1> |
@@ -16,61 +16,61 @@ |
||
| 16 | 16 | <thead> |
| 17 | 17 | <tr> |
| 18 | 18 | <?php |
| 19 | - foreach ($options['cols'] as $colName => $col) { |
|
| 20 | - if (!empty($col['hidden'])) { |
|
| 21 | - continue; |
|
| 22 | - } |
|
| 23 | - echo "<th>"; |
|
| 24 | - echo $col['col']['label']; |
|
| 25 | - if (!empty($col['col']['model'])) { |
|
| 26 | - $modelName = $col['col']['model']; |
|
| 27 | - $onclick = 'inji.Ui.forms.popUp(\'' . addslashes($modelName) . '\',{},function(elem){' |
|
| 28 | - . 'return function(data,modal){inji.Ui.forms.submitAjax($(elem).closest(\'form\')[0], {notSave: true});}}(this));return false;'; |
|
| 29 | - echo ' (<a href="" onclick="' . $onclick . ';this.disabled=true;return false;">Создать</a>)'; |
|
| 30 | - } |
|
| 31 | - echo "</th>"; |
|
| 32 | - } |
|
| 33 | - ?> |
|
| 19 | + foreach ($options['cols'] as $colName => $col) { |
|
| 20 | + if (!empty($col['hidden'])) { |
|
| 21 | + continue; |
|
| 22 | + } |
|
| 23 | + echo "<th>"; |
|
| 24 | + echo $col['col']['label']; |
|
| 25 | + if (!empty($col['col']['model'])) { |
|
| 26 | + $modelName = $col['col']['model']; |
|
| 27 | + $onclick = 'inji.Ui.forms.popUp(\'' . addslashes($modelName) . '\',{},function(elem){' |
|
| 28 | + . 'return function(data,modal){inji.Ui.forms.submitAjax($(elem).closest(\'form\')[0], {notSave: true});}}(this));return false;'; |
|
| 29 | + echo ' (<a href="" onclick="' . $onclick . ';this.disabled=true;return false;">Создать</a>)'; |
|
| 30 | + } |
|
| 31 | + echo "</th>"; |
|
| 32 | + } |
|
| 33 | + ?> |
|
| 34 | 34 | <td> </td> |
| 35 | 35 | </tr> |
| 36 | 36 | </thead> |
| 37 | 37 | <tbody class="listBody"> |
| 38 | 38 | <?php |
| 39 | - $i = 0; |
|
| 40 | - if (!empty($options['values'])) { |
|
| 41 | - foreach ($options['values'] as $row) { |
|
| 42 | - echo '<tr>'; |
|
| 43 | - foreach ($options['cols'] as $colName => $col) { |
|
| 44 | - $input = clone $col['input']; |
|
| 45 | - if (empty($col['hidden'])) { |
|
| 46 | - echo '<td>'; |
|
| 47 | - } |
|
| 48 | - $input->options['noContainer'] = true; |
|
| 49 | - $input->colParams['label'] = false; |
|
| 50 | - $input->colParams['value'] = $row[$colName]; |
|
| 51 | - $input->colName .= '[' . $colName . '][' . ($i) . ']'; |
|
| 52 | - $input->draw(); |
|
| 53 | - if (empty($col['hidden'])) { |
|
| 54 | - echo '</td>'; |
|
| 55 | - } |
|
| 56 | - } |
|
| 57 | - $i++; |
|
| 58 | - 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>'; |
|
| 59 | - echo '</tr>'; |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - ?> |
|
| 39 | + $i = 0; |
|
| 40 | + if (!empty($options['values'])) { |
|
| 41 | + foreach ($options['values'] as $row) { |
|
| 42 | + echo '<tr>'; |
|
| 43 | + foreach ($options['cols'] as $colName => $col) { |
|
| 44 | + $input = clone $col['input']; |
|
| 45 | + if (empty($col['hidden'])) { |
|
| 46 | + echo '<td>'; |
|
| 47 | + } |
|
| 48 | + $input->options['noContainer'] = true; |
|
| 49 | + $input->colParams['label'] = false; |
|
| 50 | + $input->colParams['value'] = $row[$colName]; |
|
| 51 | + $input->colName .= '[' . $colName . '][' . ($i) . ']'; |
|
| 52 | + $input->draw(); |
|
| 53 | + if (empty($col['hidden'])) { |
|
| 54 | + echo '</td>'; |
|
| 55 | + } |
|
| 56 | + } |
|
| 57 | + $i++; |
|
| 58 | + 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>'; |
|
| 59 | + echo '</tr>'; |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + ?> |
|
| 63 | 63 | </tbody> |
| 64 | 64 | <tfoot> |
| 65 | 65 | <tr> |
| 66 | 66 | <?php |
| 67 | - foreach ($options['cols'] as $colName => $col) { |
|
| 68 | - if (!empty($col['hidden'])) { |
|
| 69 | - continue; |
|
| 70 | - } |
|
| 71 | - echo "<th>{$col['col']['label']}</th>"; |
|
| 72 | - } |
|
| 73 | - ?> |
|
| 67 | + foreach ($options['cols'] as $colName => $col) { |
|
| 68 | + if (!empty($col['hidden'])) { |
|
| 69 | + continue; |
|
| 70 | + } |
|
| 71 | + echo "<th>{$col['col']['label']}</th>"; |
|
| 72 | + } |
|
| 73 | + ?> |
|
| 74 | 74 | <td> </td> |
| 75 | 75 | </tr> |
| 76 | 76 | </tfoot> |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <thead> |
| 2 | 2 | <tr> |
| 3 | 3 | <?php |
| 4 | - foreach ($table->cols as $col) { |
|
| 5 | - if (is_string($col)) { |
|
| 6 | - echo "<th>{$col}</th>"; |
|
| 7 | - } else { |
|
| 8 | - echo Html::el('th', !empty($col['attributes']) ? $col['attributes'] : [], $col['text']); |
|
| 9 | - } |
|
| 10 | - } |
|
| 11 | - ?> |
|
| 4 | + foreach ($table->cols as $col) { |
|
| 5 | + if (is_string($col)) { |
|
| 6 | + echo "<th>{$col}</th>"; |
|
| 7 | + } else { |
|
| 8 | + echo Html::el('th', !empty($col['attributes']) ? $col['attributes'] : [], $col['text']); |
|
| 9 | + } |
|
| 10 | + } |
|
| 11 | + ?> |
|
| 12 | 12 | </tr> |
| 13 | 13 | </thead> |
| 14 | 14 | \ No newline at end of file |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <tfoot> |
| 2 | 2 | <tr> |
| 3 | 3 | <?php |
| 4 | - foreach ($table->cols as $col) { |
|
| 5 | - if (is_string($col)) { |
|
| 6 | - echo "<th>{$col}</th>"; |
|
| 7 | - } else { |
|
| 8 | - echo Html::el('th', !empty($col['attributes']) ? $col['attributes'] : [], $col['text']); |
|
| 9 | - } |
|
| 10 | - } |
|
| 11 | - ?> |
|
| 4 | + foreach ($table->cols as $col) { |
|
| 5 | + if (is_string($col)) { |
|
| 6 | + echo "<th>{$col}</th>"; |
|
| 7 | + } else { |
|
| 8 | + echo Html::el('th', !empty($col['attributes']) ? $col['attributes'] : [], $col['text']); |
|
| 9 | + } |
|
| 10 | + } |
|
| 11 | + ?> |
|
| 12 | 12 | </tr> |
| 13 | 13 | </tfoot> |
| 14 | 14 | \ No newline at end of file |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <tr> |
| 2 | 2 | <?php |
| 3 | - foreach ($row as $html) { |
|
| 4 | - if (is_array($html)) { |
|
| 5 | - extract($html); |
|
| 6 | - } |
|
| 7 | - echo "<td " . (!empty($class) ? "class='{$class}'" : '') . ">{$html}</td>"; |
|
| 8 | - } |
|
| 9 | - ?> |
|
| 3 | + foreach ($row as $html) { |
|
| 4 | + if (is_array($html)) { |
|
| 5 | + extract($html); |
|
| 6 | + } |
|
| 7 | + echo "<td " . (!empty($class) ? "class='{$class}'" : '') . ">{$html}</td>"; |
|
| 8 | + } |
|
| 9 | + ?> |
|
| 10 | 10 | </tr> |
| 11 | 11 | \ No newline at end of file |
@@ -8,110 +8,110 @@ discard block |
||
| 8 | 8 | return false;"> |
| 9 | 9 | <div class="row"> |
| 10 | 10 | <?php |
| 11 | - $i = -1; |
|
| 12 | - $form = new Ui\Form(); |
|
| 13 | - foreach ($dataManager->managerOptions['filters'] as $col) { |
|
| 11 | + $i = -1; |
|
| 12 | + $form = new Ui\Form(); |
|
| 13 | + foreach ($dataManager->managerOptions['filters'] as $col) { |
|
| 14 | 14 | |
| 15 | - if ($dataManager->modelName) { |
|
| 16 | - $modelName = $dataManager->modelName; |
|
| 17 | - $colInfo = $modelName::getColInfo($col); |
|
| 18 | - } else { |
|
| 19 | - $colInfo = $dataManager->managerOptions['cols'][$col]; |
|
| 20 | - } |
|
| 21 | - $values = []; |
|
| 22 | - $inputOptions = []; |
|
| 23 | - if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) { |
|
| 24 | - $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col]; |
|
| 25 | - if (!empty($colOptions['userCol'])) { |
|
| 26 | - if (strpos($colOptions['userCol'], ':')) { |
|
| 27 | - $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':')); |
|
| 28 | - $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1); |
|
| 15 | + if ($dataManager->modelName) { |
|
| 16 | + $modelName = $dataManager->modelName; |
|
| 17 | + $colInfo = $modelName::getColInfo($col); |
|
| 18 | + } else { |
|
| 19 | + $colInfo = $dataManager->managerOptions['cols'][$col]; |
|
| 20 | + } |
|
| 21 | + $values = []; |
|
| 22 | + $inputOptions = []; |
|
| 23 | + if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) { |
|
| 24 | + $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col]; |
|
| 25 | + if (!empty($colOptions['userCol'])) { |
|
| 26 | + if (strpos($colOptions['userCol'], ':')) { |
|
| 27 | + $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':')); |
|
| 28 | + $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1); |
|
| 29 | 29 | |
| 30 | - $inputOptions['value'] = \Users\User::$cur->$rel->$param; |
|
| 31 | - } else { |
|
| 32 | - $this->model->$col = \Users\User::$cur->{$preset['userCol']}; |
|
| 33 | - } |
|
| 34 | - } elseif (!empty($colOptions['value'])) { |
|
| 35 | - $inputOptions['value'] = $colOptions['value']; |
|
| 36 | - } |
|
| 37 | - if (is_array($inputOptions['value'])) { |
|
| 38 | - $values = $inputOptions['value']; |
|
| 39 | - foreach ($values as $key => $value) { |
|
| 40 | - $inputOptions['value'] = $value; |
|
| 41 | - $form->input('hidden', "datamanagerFilters[{$col}][value][{$key}]", '', $inputOptions); |
|
| 42 | - } |
|
| 43 | - } else { |
|
| 44 | - $form->input('hidden', "datamanagerFilters[{$col}][value]", '', $inputOptions); |
|
| 45 | - } |
|
| 46 | - continue; |
|
| 47 | - } |
|
| 48 | - if (++$i && !($i % 2)) { |
|
| 49 | - echo '</div><div class="row">'; |
|
| 50 | - } |
|
| 51 | - echo '<div class="col-md-6">'; |
|
| 52 | - if (!empty($colInfo['colParams']['type'])) { |
|
| 53 | - switch ($colInfo['colParams']['type']) { |
|
| 54 | - case'select': |
|
| 30 | + $inputOptions['value'] = \Users\User::$cur->$rel->$param; |
|
| 31 | + } else { |
|
| 32 | + $this->model->$col = \Users\User::$cur->{$preset['userCol']}; |
|
| 33 | + } |
|
| 34 | + } elseif (!empty($colOptions['value'])) { |
|
| 35 | + $inputOptions['value'] = $colOptions['value']; |
|
| 36 | + } |
|
| 37 | + if (is_array($inputOptions['value'])) { |
|
| 38 | + $values = $inputOptions['value']; |
|
| 39 | + foreach ($values as $key => $value) { |
|
| 40 | + $inputOptions['value'] = $value; |
|
| 41 | + $form->input('hidden', "datamanagerFilters[{$col}][value][{$key}]", '', $inputOptions); |
|
| 42 | + } |
|
| 43 | + } else { |
|
| 44 | + $form->input('hidden', "datamanagerFilters[{$col}][value]", '', $inputOptions); |
|
| 45 | + } |
|
| 46 | + continue; |
|
| 47 | + } |
|
| 48 | + if (++$i && !($i % 2)) { |
|
| 49 | + echo '</div><div class="row">'; |
|
| 50 | + } |
|
| 51 | + echo '<div class="col-md-6">'; |
|
| 52 | + if (!empty($colInfo['colParams']['type'])) { |
|
| 53 | + switch ($colInfo['colParams']['type']) { |
|
| 54 | + case'select': |
|
| 55 | 55 | switch ($colInfo['colParams']['source']) { |
| 56 | - case 'array': |
|
| 56 | + case 'array': |
|
| 57 | 57 | $values = ['' => 'Не важно'] + $colInfo['colParams']['sourceArray']; |
| 58 | - break; |
|
| 59 | - case 'method': |
|
| 58 | + break; |
|
| 59 | + case 'method': |
|
| 60 | 60 | if (!empty($colInfo['colParams']['params'])) { |
| 61 | - $values = call_user_func_array([App::$cur->$colInfo['colParams']['module'], $colInfo['colParams']['method']], $colInfo['colParams']['params']); |
|
| 62 | - } else { |
|
| 63 | - $values = ['' => 'Не важно'] + App::$cur->$colInfo['colParams']['module']->$colInfo['colParams']['method'](); |
|
| 64 | - } |
|
| 65 | - break; |
|
| 66 | - case 'model': |
|
| 61 | + $values = call_user_func_array([App::$cur->$colInfo['colParams']['module'], $colInfo['colParams']['method']], $colInfo['colParams']['params']); |
|
| 62 | + } else { |
|
| 63 | + $values = ['' => 'Не важно'] + App::$cur->$colInfo['colParams']['module']->$colInfo['colParams']['method'](); |
|
| 64 | + } |
|
| 65 | + break; |
|
| 66 | + case 'model': |
|
| 67 | 67 | $values = ['' => 'Не важно'] + $colInfo['colParams']['model']::getList(['forSelect' => true]); |
| 68 | - break; |
|
| 69 | - case 'relation': |
|
| 68 | + break; |
|
| 69 | + case 'relation': |
|
| 70 | 70 | $relations = $colInfo['modelName']::relations(); |
| 71 | - $filters = $relations[$colInfo['colParams']['relation']]['model']::managerFilters(); |
|
| 72 | - $cols = $relations[$colInfo['colParams']['relation']]['model']::cols(); |
|
| 73 | - $options = [ |
|
| 74 | - 'where' => !empty($filters['getRows']['where']) ? $filters['getRows']['where'] : '' |
|
| 75 | - ]; |
|
| 76 | - if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix() . 'name'])) { |
|
| 77 | - $options['order'] = 'name'; |
|
| 78 | - } |
|
| 79 | - $items = $relations[$colInfo['colParams']['relation']]['model']::getList($options); |
|
| 80 | - $values = ['' => 'Не задано']; |
|
| 81 | - foreach ($items as $key => $item) { |
|
| 82 | - if (!empty($inputParams['showCol'])) { |
|
| 83 | - $values[$key] = $item->$inputParams['showCol']; |
|
| 84 | - } else { |
|
| 85 | - $values[$key] = $item->name(); |
|
| 86 | - } |
|
| 87 | - } |
|
| 88 | - $values; |
|
| 89 | - break; |
|
| 90 | - } |
|
| 91 | - $value = !empty($_GET['datamanagerFilters'][$col]['value']) ? $_GET['datamanagerFilters'][$col]['value'] : (!empty($params['filters'][$col]['value']) ? $params['filters'][$col]['value'] : ''); |
|
| 92 | - $inputOptions = ['value' => $value, 'values' => $values, 'multiple' => true]; |
|
| 93 | - if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) { |
|
| 71 | + $filters = $relations[$colInfo['colParams']['relation']]['model']::managerFilters(); |
|
| 72 | + $cols = $relations[$colInfo['colParams']['relation']]['model']::cols(); |
|
| 73 | + $options = [ |
|
| 74 | + 'where' => !empty($filters['getRows']['where']) ? $filters['getRows']['where'] : '' |
|
| 75 | + ]; |
|
| 76 | + if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix() . 'name'])) { |
|
| 77 | + $options['order'] = 'name'; |
|
| 78 | + } |
|
| 79 | + $items = $relations[$colInfo['colParams']['relation']]['model']::getList($options); |
|
| 80 | + $values = ['' => 'Не задано']; |
|
| 81 | + foreach ($items as $key => $item) { |
|
| 82 | + if (!empty($inputParams['showCol'])) { |
|
| 83 | + $values[$key] = $item->$inputParams['showCol']; |
|
| 84 | + } else { |
|
| 85 | + $values[$key] = $item->name(); |
|
| 86 | + } |
|
| 87 | + } |
|
| 88 | + $values; |
|
| 89 | + break; |
|
| 90 | + } |
|
| 91 | + $value = !empty($_GET['datamanagerFilters'][$col]['value']) ? $_GET['datamanagerFilters'][$col]['value'] : (!empty($params['filters'][$col]['value']) ? $params['filters'][$col]['value'] : ''); |
|
| 92 | + $inputOptions = ['value' => $value, 'values' => $values, 'multiple' => true]; |
|
| 93 | + if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) { |
|
| 94 | 94 | |
| 95 | - $inputOptions['disabled'] = true; |
|
| 96 | - $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col]; |
|
| 97 | - if (!empty($colOptions['userCol'])) { |
|
| 98 | - if (strpos($colOptions['userCol'], ':')) { |
|
| 99 | - $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':')); |
|
| 100 | - $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1); |
|
| 95 | + $inputOptions['disabled'] = true; |
|
| 96 | + $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col]; |
|
| 97 | + if (!empty($colOptions['userCol'])) { |
|
| 98 | + if (strpos($colOptions['userCol'], ':')) { |
|
| 99 | + $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':')); |
|
| 100 | + $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1); |
|
| 101 | 101 | |
| 102 | - $inputOptions['value'] = \Users\User::$cur->$rel->$param; |
|
| 103 | - } else { |
|
| 104 | - $this->model->$col = \Users\User::$cur->{$preset['userCol']}; |
|
| 105 | - } |
|
| 106 | - } elseif (!empty($colOptions['value'])) { |
|
| 102 | + $inputOptions['value'] = \Users\User::$cur->$rel->$param; |
|
| 103 | + } else { |
|
| 104 | + $this->model->$col = \Users\User::$cur->{$preset['userCol']}; |
|
| 105 | + } |
|
| 106 | + } elseif (!empty($colOptions['value'])) { |
|
| 107 | 107 | |
| 108 | - $inputOptions['value'] = $colOptions['value']; |
|
| 109 | - } |
|
| 110 | - } |
|
| 111 | - $inputOptions['class'] = 'input-sm'; |
|
| 112 | - $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions); |
|
| 113 | - break; |
|
| 114 | - case 'email': |
|
| 108 | + $inputOptions['value'] = $colOptions['value']; |
|
| 109 | + } |
|
| 110 | + } |
|
| 111 | + $inputOptions['class'] = 'input-sm'; |
|
| 112 | + $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions); |
|
| 113 | + break; |
|
| 114 | + case 'email': |
|
| 115 | 115 | case 'text': |
| 116 | 116 | case 'textarea': |
| 117 | 117 | case 'html': |
@@ -139,40 +139,40 @@ discard block |
||
| 139 | 139 | ?> |
| 140 | 140 | <div class="filter_form_field filter_select"> |
| 141 | 141 | <?php |
| 142 | - if (!empty($_GET['datamanagerFilters'][$col]['value'])) { |
|
| 143 | - $value = 1; |
|
| 144 | - } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) { |
|
| 145 | - $value = 0; |
|
| 146 | - } else { |
|
| 147 | - $value = ''; |
|
| 148 | - } |
|
| 149 | - $inputOptions = ['value' => $value, 'values' => [ |
|
| 150 | - '' => 'Не важно', |
|
| 151 | - '1' => $colInfo['label'], |
|
| 152 | - '0' => 'Нет' |
|
| 153 | - ] |
|
| 154 | - ]; |
|
| 155 | - if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) { |
|
| 142 | + if (!empty($_GET['datamanagerFilters'][$col]['value'])) { |
|
| 143 | + $value = 1; |
|
| 144 | + } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) { |
|
| 145 | + $value = 0; |
|
| 146 | + } else { |
|
| 147 | + $value = ''; |
|
| 148 | + } |
|
| 149 | + $inputOptions = ['value' => $value, 'values' => [ |
|
| 150 | + '' => 'Не важно', |
|
| 151 | + '1' => $colInfo['label'], |
|
| 152 | + '0' => 'Нет' |
|
| 153 | + ] |
|
| 154 | + ]; |
|
| 155 | + if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) { |
|
| 156 | 156 | |
| 157 | - $inputOptions['disabled'] = true; |
|
| 158 | - $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col]; |
|
| 159 | - if (!empty($colOptions['userCol'])) { |
|
| 160 | - if (strpos($colOptions['userCol'], ':')) { |
|
| 161 | - $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':')); |
|
| 162 | - $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1); |
|
| 157 | + $inputOptions['disabled'] = true; |
|
| 158 | + $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col]; |
|
| 159 | + if (!empty($colOptions['userCol'])) { |
|
| 160 | + if (strpos($colOptions['userCol'], ':')) { |
|
| 161 | + $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':')); |
|
| 162 | + $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1); |
|
| 163 | 163 | |
| 164 | - $inputOptions['value'] = \Users\User::$cur->$rel->$param; |
|
| 165 | - } else { |
|
| 166 | - $this->model->$col = \Users\User::$cur->{$preset['userCol']}; |
|
| 167 | - } |
|
| 168 | - } elseif (!empty($colOptions['value'])) { |
|
| 164 | + $inputOptions['value'] = \Users\User::$cur->$rel->$param; |
|
| 165 | + } else { |
|
| 166 | + $this->model->$col = \Users\User::$cur->{$preset['userCol']}; |
|
| 167 | + } |
|
| 168 | + } elseif (!empty($colOptions['value'])) { |
|
| 169 | 169 | |
| 170 | - $inputOptions['value'] = $colOptions['value']; |
|
| 171 | - } |
|
| 172 | - } |
|
| 173 | - $inputOptions['class'] = 'input-sm'; |
|
| 174 | - $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions); |
|
| 175 | - ?> |
|
| 170 | + $inputOptions['value'] = $colOptions['value']; |
|
| 171 | + } |
|
| 172 | + } |
|
| 173 | + $inputOptions['class'] = 'input-sm'; |
|
| 174 | + $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions); |
|
| 175 | + ?> |
|
| 176 | 176 | </div> |
| 177 | 177 | |
| 178 | 178 | <?php |
@@ -2,10 +2,10 @@ discard block |
||
| 2 | 2 | <div class="row"> |
| 3 | 3 | <div class="col-md-3"> |
| 4 | 4 | <?php |
| 5 | - \Ui\Tree::ul($category->getRoot(), 0, function($category) { |
|
| 6 | - echo "<a href='{$category->getHref()}'> {$category->name()}</a>"; |
|
| 7 | - }); |
|
| 8 | - ?> |
|
| 5 | + \Ui\Tree::ul($category->getRoot(), 0, function($category) { |
|
| 6 | + echo "<a href='{$category->getHref()}'> {$category->name()}</a>"; |
|
| 7 | + }); |
|
| 8 | + ?> |
|
| 9 | 9 | </div> |
| 10 | 10 | <div class="col-md-9"> |
| 11 | 11 | <div class="content"> |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | <div class ="category-materials"> |
| 17 | 17 | <div class ="row"> |
| 18 | 18 | <?php |
| 19 | - $i = 0; |
|
| 20 | - foreach ($materials as $material) { |
|
| 21 | - ?> |
|
| 19 | + $i = 0; |
|
| 20 | + foreach ($materials as $material) { |
|
| 21 | + ?> |
|
| 22 | 22 | <div class = "col-sm-6 category-material"> |
| 23 | 23 | <a class="category-material-name" href ="<?= $material->getHref(); ?>"><h3><?= $material->name; ?></h3></a> |
| 24 | 24 | <div class="category-material-preview"><?= $material->preview; ?></div> |