// Categories tree
This commit is contained in:
@@ -477,15 +477,19 @@ class CategoryCore extends ObjectModel
|
||||
return $categories;
|
||||
}
|
||||
|
||||
public static function getNestedCategories($root_category = 1,
|
||||
public static function getNestedCategories($root_category = null,
|
||||
$id_lang = false, $active = true, $sql_filter = '', $sql_sort = '',
|
||||
$sql_limit = '')
|
||||
{
|
||||
if (!isset($root_category))
|
||||
$root_category = self::getRootCategory($id_lang)->id;
|
||||
|
||||
if (!Validate::isInt($root_category))
|
||||
die(Tools::displayError());
|
||||
|
||||
if (!Validate::isBool($active))
|
||||
die(Tools::displayError());
|
||||
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'category` c
|
||||
|
||||
@@ -89,16 +89,7 @@ class HelperFormCore extends Helper
|
||||
case 'categories':
|
||||
if ($categories)
|
||||
{
|
||||
// Added Jquery plugin treeview (css and js files)
|
||||
$this->context->controller->addJqueryPlugin('treeview-categories');
|
||||
|
||||
// Added JS files
|
||||
$this->context->controller->addJS(_PS_JS_DIR_.'jquery/plugins/treeview-categories/jquery.treeview-categories.async.js');
|
||||
$this->context->controller->addJS(_PS_JS_DIR_.'jquery/plugins/treeview-categories/jquery.treeview-categories.edit.js');
|
||||
$this->context->controller->addJS(_PS_JS_DIR_.'admin-categories-tree.js');
|
||||
|
||||
if (isset($params['use_search']) && $params['use_search'])
|
||||
$this->context->controller->addJS(_PS_JS_DIR_.'jquery/plugins/autocomplete/jquery.autocomplete.js');
|
||||
$this->context->smarty->assign('categories_tree', $params['categories_tree']);
|
||||
$categories = false;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user