// Context part 11

This commit is contained in:
tDidierjean
2011-07-18 15:50:58 +00:00
parent 4b7dee58b7
commit 6551a3ece7
60 changed files with 378 additions and 520 deletions
+2 -2
View File
@@ -124,7 +124,7 @@ class BlockCategories extends Module
public function getTree($resultParents, $resultIds, $maxDepth, $id_category = 1, $currentDepth = 0)
{
global $link;
$context = Context::getContext();
$children = array();
if (isset($resultParents[$id_category]) AND sizeof($resultParents[$id_category]) AND ($maxDepth == 0 OR $currentDepth < $maxDepth))
@@ -132,7 +132,7 @@ class BlockCategories extends Module
$children[] = $this->getTree($resultParents, $resultIds, $maxDepth, $subcat['id_category'], $currentDepth + 1);
if (!isset($resultIds[$id_category]))
return false;
$return = array('id' => $id_category, 'link' => $link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']),
$return = array('id' => $id_category, 'link' => $context->link->getCategoryLink($id_category, $resultIds[$id_category]['link_rewrite']),
'name' => $resultIds[$id_category]['name'], 'desc'=> $resultIds[$id_category]['description'],
'children' => $children);
return $return;