[-] BO : Do not display root category bool if addrootcategory not in url

This commit is contained in:
gRoussac
2013-08-07 11:51:48 +02:00
parent e6a819e5dd
commit 82621c08ec
2 changed files with 8 additions and 6 deletions
@@ -34,7 +34,7 @@
{if $shared_category}
<p class="warn">{l s='If you delete this picture, it will be deleted in all of your shared shops!'}</p>
{/if}
<br>
<br />
<a href="{$current}&{$identifier}={$form_id}&token={$token}&{if $shared_category}forcedeleteImage=1{else}deleteImage=1{/if}">
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a>
@@ -71,4 +71,4 @@
<span>{$input.customer}</span><br />
</p>
{/if}
{/block}
{/block}
@@ -459,7 +459,8 @@ class AdminCategoriesControllerCore extends AdminController
$this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
// Display this field only if multistore option is enabled
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'))
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && Tools::isSubmit('add'.$this->table.'root'))
{
$this->fields_form['input'][] = array(
'type' => 'radio',
'label' => $this->l('Root Category:'),
@@ -480,6 +481,8 @@ class AdminCategoriesControllerCore extends AdminController
)
)
);
unset($this->fields_form['input'][2],$this->fields_form['input'][3]);
}
// Display this field only if multistore option is enabled AND there are several stores configured
if (Shop::isFeatureActive())
$this->fields_form['input'][] = array(
@@ -494,9 +497,6 @@ class AdminCategoriesControllerCore extends AdminController
if (in_array($input['name'], array('id_parent', 'is_root_category')))
unset($this->fields_form['input'][$k]);
if (Tools::isSubmit('add'.$this->table.'root'))
unset($this->fields_form['input'][2],$this->fields_form['input'][3]);
if (!($obj = $this->loadObject(true)))
return;
@@ -520,6 +520,8 @@ class AdminCategoriesControllerCore extends AdminController
foreach ($groups as $group)
$this->fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $category_groups_ids)));
$this->fields_value['is_root_category'] = (bool)Tools::isSubmit('add'.$this->table.'root');
return parent::renderForm();
}