Include path for sub-categories

This commit is contained in:
Nathan Gray 2011-02-17 16:40:57 +00:00
parent ebffdf2f53
commit d846176c9f

View File

@ -235,7 +235,10 @@ abstract class bo_merge
$cats[$GLOBALS['egw']->categories->id2name($cat_id,'main')] = array(); $cats[$GLOBALS['egw']->categories->id2name($cat_id,'main')] = array();
if($GLOBALS['egw']->categories->id2name($cat_id,'main') != $cat_id) if($GLOBALS['egw']->categories->id2name($cat_id,'main') != $cat_id)
{ {
$cats[$GLOBALS['egw']->categories->id2name($cat_id,'main')][] = $GLOBALS['egw']->categories->id2name($cat_id,'name'); $path = $GLOBALS['egw']->categories->id2name($cat_id,'path');
$path = explode(' / ', $path);
unset($path[0]); // Drop main
$cats[$GLOBALS['egw']->categories->id2name($cat_id,'main')][] = implode(' / ', $path);
} }
} }
foreach($cats as $main => $cat) { foreach($cats as $main => $cat) {