diff --git a/classes/helper/Helper.php b/classes/helper/Helper.php index 3479948eb..3ee633b15 100755 --- a/classes/helper/Helper.php +++ b/classes/helper/Helper.php @@ -98,7 +98,7 @@ class HelperCore } /** - * @deprecated since 1.5 - use Helper::renderCategoryTree() instead + * Since 1.5 - This function will be deprecated in 1.6 - use Helper::renderCategoryTree() instead * @static * @param $translations * @param array $selected_cat @@ -145,7 +145,6 @@ class HelperCore * ( * [id_category] => 1 * [name] => Home page - * [link_rewrite] => home * ) * ) * @param string $input_name name of input diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index edf06cc31..900bb4701 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -247,21 +247,11 @@ class AdminGroupsControllerCore extends AdminController ) ) ); - $root_category = Category::getRootCategory(); - $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name[$this->context->language->id]); + $this->fields_value['reduction'] = isset($group->reduction) ? $group->reduction : 0; - $trads = array( - 'Root' => $root_category, - 'selected' => $this->l('selected'), - 'Collapse All' => $this->l('Collapse All'), - 'Expand All' => $this->l('Expand All'), - 'Check All' => $this->l('Check All'), - 'Uncheck All' => $this->l('Uncheck All'), - 'search' => $this->l('Search a category') - ); - - $this->tpl_form_vars['categoryTreeView'] = Helper::renderAdminCategorieTree($trads, array(), 'id_category', true, false, array(), true); + $helper = new Helper(); + $this->tpl_form_vars['categoryTreeView'] = $helper->renderCategoryTree(null, array(), 'id_category', true, false, array(), true); return parent::renderForm(); } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 6a952dfcb..05ce16460 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2477,17 +2477,6 @@ class AdminProductsControllerCore extends AdminController else $selected_cat = Product::getProductCategoriesFull($product->id, $this->default_form_language); } - $root_category = Category::getRootCategory(); - $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name[$this->context->language->id]); - $translations = array( - 'Root' => $root_category, - 'selected' => $this->l('selected'), - 'Collapse All' => $this->l('Collapse All'), - 'Expand All' => $this->l('Expand All'), - 'Check All' => $this->l('Check All'), - 'Uncheck All' => $this->l('Uncheck All'), - 'search' => $this->l('Search a category') - ); // Multishop block $data->assign('feature_shop_active', Shop::isFeatureActive()); @@ -2515,10 +2504,11 @@ class AdminProductsControllerCore extends AdminController $product->manufacturer_name = Manufacturer::getNameById($product->id_manufacturer); + $helper = new Helper(); $data->assign(array('default_category' => $default_category, 'selected_cat_ids' => implode(',', array_keys($selected_cat)), 'selected_cat' => $selected_cat, - 'category_tree' => Helper::renderAdminCategorieTree($translations, $selected_cat, 'categoryBox', false, true), + 'category_tree' => $helper->renderCategoryTree(null, $selected_cat, 'categoryBox', false, true), 'product' => $product, 'link' => $this->context->link )); diff --git a/controllers/admin/AdminShopController.php b/controllers/admin/AdminShopController.php index c582dbf82..bdb87693c 100755 --- a/controllers/admin/AdminShopController.php +++ b/controllers/admin/AdminShopController.php @@ -176,15 +176,9 @@ class AdminShopControllerCore extends AdminController { $root_category = new Category((int)Tools::getValue('id_category')); $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name[$this->context->language->id]); - $trads = array( - 'Root' => $root_category, - 'selected' => $this->l('selected'), - 'Collapse All' => $this->l('Collapse All'), - 'Check All' => $this->l('Check All'), - 'Uncheck All' => $this->l('Uncheck All'), - 'Expand All' => $this->l('Expand All') - ); - echo Helper::renderAdminCategorieTree($trads, array($root_category['id_category'])); + + $helper = new Helper(); + echo $helper->renderCategoryTree($root_category, array($root_category['id_category'])); } } @@ -507,16 +501,8 @@ class AdminShopControllerCore extends AdminController else $root_category = new Category($id_root); $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name[$this->context->language->id]); - $translations = array( - 'Root' => $root_category, - 'selected' => $this->l('selected'), - 'Collapse All' => $this->l('Collapse All'), - 'Expand All' => $this->l('Expand All'), - 'Check All' => $this->l('Check All'), - 'Uncheck All' => $this->l('Uncheck All'), - 'search' => $this->l('Search a category') - ); - return Helper::renderAdminCategorieTree($translations, $selected_cat, 'categoryBox', false, true); + $helper = new Helper(); + return $helper->renderCategoryTree($root_category, $selected_cat, 'categoryBox', false, true); } } diff --git a/modules/loyalty/loyalty.php b/modules/loyalty/loyalty.php index 595586edb..c7af29c9c 100644 --- a/modules/loyalty/loyalty.php +++ b/modules/loyalty/loyalty.php @@ -324,31 +324,10 @@ class Loyalty extends Module '; $index = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY')); $indexedCategories = isset($_POST['categoryBox']) ? $_POST['categoryBox'] : $index; - // Translations are not automatic for the moment ;) - if (version_compare(_PS_VERSION_,'1.5','>')) - { - if ($this->context->shop() == Shop::CONTEXT_SHOP) - { - $root_category = Category::getRootCategory(); - $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name); - } - else - $root_category = array('id_category' => '0', 'name' => $this->l('Root')); - } - else - { - $root_category = array('id_category' => '1', 'name' => $this->l('Home')); - } - $trads = array( - 'Root' => $root_category, - 'selected' => $this->l('selected'), - 'Collapse All' => $this->l('Collapse All'), - 'Expand All' => $this->l('Expand All'), - 'Check All' => $this->l('Check All'), - 'Uncheck All' => $this->l('Uncheck All') - ); - $html .= '
'.Helper::renderAdminCategorieTree($trads, $indexedCategories).'
'; - $html .= ' + + $helper = new Helper(); + $html .= '
'.$helper->renderCategoryTree(null, $indexedCategories).'
'; + $html .= '

'.$this->l('Mark the box(es) of categories in which loyalty vouchers are usable.').'

'.$this->l('Loyalty points progression').'