Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop

This commit is contained in:
Christophe Latour 2017-09-15 16:16:57 +02:00
commit 0127305b36

View File

@ -64,7 +64,7 @@ class AdminCategories extends AdminTab
parent::__construct();
}
protected function recurseCategoryTreeFlat($id_category, $category_selected, $level_start = 1)
protected function recurseCategoryTreeFlat($id_category, $category_selected, $level_start = 0)
{
global $currentIndex;
@ -119,6 +119,12 @@ class AdminCategories extends AdminTab
if ($categoryRoot) {
echo '<select id="selectCategory" style="margin:0 5px;padding:4px;font-size:14px;"
onchange="document.location=$(this).find(\'option:selected\').data(\'url\');">';
// Add root category
echo '<option value="" data-url="'.$currentIndex.'&'.
$this->identifier.'='.$categoryRoot['id_category'].'&view'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"'.
($this->_category->id_category == $categoryRoot['id_category'] ? ' selected="selected"' : '').'>'.
$levelStr.$categoryRoot['name'].'</option>';
// List recursively
echo $this->recurseCategoryTreeFlat($categoryRoot['id_category'], $this->_category->id_category);
echo '</select>';
}