Задисейблил форму редактирования категорий для случая выключенного shop_edit_enable

parent 04e920c0
...@@ -282,6 +282,7 @@ class Cabinet extends Common ...@@ -282,6 +282,7 @@ class Cabinet extends Common
$data['lang'] = $request->getAttribute('layoutInfo')->getLang(); $data['lang'] = $request->getAttribute('layoutInfo')->getLang();
$data['feeds_cats'] = $feeds_cats; $data['feeds_cats'] = $feeds_cats;
$data['reports_list'] = $reports_list; $data['reports_list'] = $reports_list;
$data['edit_enable'] = true;
} else { } else {
$data['error'] = _t('Извините, у магазинов пользователя нет фидов '); $data['error'] = _t('Извините, у магазинов пользователя нет фидов ');
......
...@@ -40,6 +40,7 @@ if (!$error) { ...@@ -40,6 +40,7 @@ if (!$error) {
$lang = $this->lang; $lang = $this->lang;
$feeds_cats = $this->feeds_cats; $feeds_cats = $this->feeds_cats;
$reports_list = $this->reports_list; $reports_list = $this->reports_list;
$edit_enable = $this->edit_enable;
} }
?> ?>
...@@ -69,18 +70,24 @@ if (!$error) { ...@@ -69,18 +70,24 @@ if (!$error) {
</div> </div>
<?php <?php
global $edited_class;
$edited_class = ($edit_enable) ? 'edited' : '';
function render_cat($i, $cat) function render_cat($i, $cat)
{ {
global $edited_class;
$i++; $i++;
$symb = (count($cat['sub_cats']) > 0) ? '<span class="group"><b class="closed">+</b><b class="open">&ndash;</b></span>' : '<span class="group"></span>'; $symb = (count($cat['sub_cats']) > 0) ? '<span class="group"><b class="closed">+</b><b class="open">&ndash;</b></span>' : '<span class="group"></span>';
?> ?>
<tr class="feed-cat" style="font-size: <?= 16-$i+1 ?>px;" data-id="<?= $cat['id'] ?>" data-parent="<?= $cat['parentid'] ?>"> <tr class="feed-cat" style="font-size: <?= 16-$i+1 ?>px;" data-id="<?= $cat['id'] ?>" data-parent="<?= $cat['parentid'] ?>">
<td> <td>
<span class="cat-title" style="padding-left: <?= ($i-1)*40 ?>px;"><?= $symb ?><?= $cat['title'] ?> <span class="foreign-id" data-id="<?= $cat['foreignid'] ?>">[<?= $cat['foreignid'] ?>]</span></span> <span class="cat-title" style="padding-left: <?= ($i-1)*40 ?>px;"><?= $symb ?><?= $cat['title'] ?> <span class="foreign-id" data-id="<?= $cat['foreignid'] ?>">[<?= $cat['foreignid'] ?>]</span></span>
</td> </td>
<td class="percent <?= ($cat['own']) ? 'own': 'inherited' ?>" data-old-type="<?= ($cat['own']) ? 'own': 'inherited' ?>"> <td class="percent <?= ($cat['own']) ? 'own': 'inherited' ?>" data-old-type="<?= ($cat['own']) ? 'own': 'inherited' ?>">
<span class="edited" data-old-value="<?= $cat['percent'] ?>"><span class="percent-value"><?= $cat['percent'] ?></span>&nbsp;%</span>
<span class="<?= $edited_class ?>" data-old-value="<?= $cat['percent'] ?>"><span class="percent-value"><?= $cat['percent'] ?></span>&nbsp;%</span>
<span class="editing-wrap"><input class="percent-input editing" value="<?= $cat['percent'] ?>">&nbsp;%</span> <span class="editing-wrap"><input class="percent-input editing" value="<?= $cat['percent'] ?>">&nbsp;%</span>
<br /><span class="old-value"><?= $cat['percent'] ?>&nbsp;%</span> <br /><span class="old-value"><?= $cat['percent'] ?>&nbsp;%</span>
</td> </td>
...@@ -102,8 +109,7 @@ if (!$error) { ...@@ -102,8 +109,7 @@ if (!$error) {
<?php <?php
} }
?> ?>
<?php foreach ($feeds_cats as $feeds_cat) : ?> <?php foreach ($feeds_cats as $feeds_cat) : ?>
<div class="feed-title">фид: <b><?= $feeds_cat['title'] ?></b></div> <div class="feed-title">фид: <b><?= $feeds_cat['title'] ?></b></div>
...@@ -143,6 +149,8 @@ if (!$error) { ...@@ -143,6 +149,8 @@ if (!$error) {
<?php endforeach; ?> <?php endforeach; ?>
<!-- Сохранить / Отмена --> <!-- Сохранить / Отмена -->
<div class="form-actions"> <div class="form-actions">
<a class="btn btn-primary submit-action" href="#" action="<?= $form_link ?>" method="post"><?= _t('Сохранить') ?></a> <a class="btn btn-primary submit-action" href="#" action="<?= $form_link ?>" method="post"><?= _t('Сохранить') ?></a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment