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

parent 04e920c0
......@@ -282,6 +282,7 @@ class Cabinet extends Common
$data['lang'] = $request->getAttribute('layoutInfo')->getLang();
$data['feeds_cats'] = $feeds_cats;
$data['reports_list'] = $reports_list;
$data['edit_enable'] = true;
} else {
$data['error'] = _t('Извините, у магазинов пользователя нет фидов ');
......
......@@ -40,6 +40,7 @@ if (!$error) {
$lang = $this->lang;
$feeds_cats = $this->feeds_cats;
$reports_list = $this->reports_list;
$edit_enable = $this->edit_enable;
}
?>
......@@ -69,18 +70,24 @@ if (!$error) {
</div>
<?php
global $edited_class;
$edited_class = ($edit_enable) ? 'edited' : '';
function render_cat($i, $cat)
{
global $edited_class;
$i++;
$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'] ?>">
<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>
</td>
<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>
<br /><span class="old-value"><?= $cat['percent'] ?>&nbsp;%</span>
</td>
......@@ -102,8 +109,7 @@ if (!$error) {
<?php
}
?>
<?php foreach ($feeds_cats as $feeds_cat) : ?>
<div class="feed-title">фид: <b><?= $feeds_cat['title'] ?></b></div>
......@@ -143,6 +149,8 @@ if (!$error) {
<?php endforeach; ?>
<!-- Сохранить / Отмена -->
<div class="form-actions">
<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