diff --git a/etemplate/inc/class.select_widget.inc.php b/etemplate/inc/class.select_widget.inc.php index 03d64eebf7..5e5dc1c04b 100644 --- a/etemplate/inc/class.select_widget.inc.php +++ b/etemplate/inc/class.select_widget.inc.php @@ -226,20 +226,15 @@ { $GLOBALS['phpgw']->categories = CreateObject('phpgwapi.categories'); } - $cats = $GLOBALS['phpgw']->categories->return_sorted_array(0,False,'','','',!$type); - - while (list(,$cat) = @each($cats)) + foreach((array)$GLOBALS['phpgw']->categories->return_sorted_array(0,False,'','','',!$type) as $cat) { - for ($j=0,$s=''; $j < $cat['level']; $j++) - { - $s .= ' '; - } - $s .= $GLOBALS['phpgw']->strip_html($cat['name']); + $s = str_repeat(' ',$cat['level']) . $GLOBALS['egw']->strip_html($cat['name']); + if ($cat['app_name'] == 'phpgw') { $s .= ' <' . lang('Global') . '>'; } - if ($cat['owner'] == '-1') + elseif ($cat['owner'] == '-1') { $s .= ' <' . lang('Global') . ' ' . lang($cat['app_name']) . '>'; }