Commit 34296f95 authored by Jonny Bradley's avatar Jonny Bradley

[FIX] categ module: Use same tree pre-processing as tiki-browse_categories.php...

[FIX] categ module: Use same tree pre-processing as tiki-browse_categories.php to work out roots properly (previously was sometimes ending up with no categories when in category jail)
parent be17853f
......@@ -107,11 +107,16 @@ function module_categories($mod_reference, &$module_params)
$tree_nodes[] = array(
"id" => $cat["categId"],
"parent" => $cat["parentId"],
'parentId' => $cat['parentId'],
'categId' => $cat['categId'],
"data" => '<a class="catname" href="'.$url.'">' . htmlspecialchars($cat['name']) . '</a><br />'
);
}
$res = '';
$tm = new BrowseTreeMaker('mod_categ' . $module_params['module_position'] . $module_params['module_ord']);
$res = $tm->make_tree($categId, $tree_nodes);
foreach ($categlib->findRoots($tree_nodes) as $node) {
$res .= $tm->make_tree($node, $tree_nodes);
}
$smarty->assign('tree', $res);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment