\n";
foreach ($indent_images as $im)
{
$ret .= "

";
}
// If this link has children, wrap the next image in a link and an expand/hide option
if ($num_children)
{
$ret .= "
";
$ret .= "
\n";
}
else
{
$ret .= "

\n";
}
$name_line = '';
if ($this->graph_debug) { $name_line = $this->class_tree[$listnum]['userclass_id'].":"; }
// if ($this->graph_debug) { $name_line = varset($this->class_tree[$listnum]['userclass_id'], 'XXX').":"; }
if ($this->class_tree[$listnum]['userclass_type'] == UC_TYPE_GROUP)
{
$name_line .= '
'.$this->class_tree[$listnum]['userclass_name'].' ('.UCSLAN_81.').'; // Highlight groups
}
else
{
$name_line .= $this->class_tree[$listnum]['userclass_name'];
}
if ($this->graph_debug) $name_line .= "[vis:".$this->class_tree[$listnum]['userclass_visibility'].", edit:".$this->class_tree[$listnum]['userclass_editclass']."] = ".$this->class_tree[$listnum]['userclass_accum']." Children: ".implode(',',$this->class_tree[$listnum]['class_children']);
// Next (commented out) line gives a 'conventional' link
//$ret .= "
".$name_line." ";
if($this->queryCanEditClass($this->class_tree[$listnum]['userclass_id']))
{
$url = e_SELF.'?mode=main&action=edit&id='.$this->class_tree[$listnum]['userclass_id'];
$onc = '';
}
else
{
$url = '#';
$onc = " onclick=\"alert('".str_replace("'", "\\'", (stripslashes(UCSLAN_90)))."'); return false;\"";
}
$ret .= $this->top_icon."\n";
$image_level = count($indent_images);
if ($is_last)
{
$indent_images[] = 'linebottom.gif';
}
else
{
$indent_images[] = 'line.gif';
}
if (isset($this->class_tree[$listnum]['class_children'])) foreach ($this->class_tree[$listnum]['class_children'] as $p)
{
$num_children--;
if ($num_children)
{ // Use icon indicating more below
$ret .= $this->show_graphical_subtree($p, $indent_images, FALSE);
}
else
{ // else last entry on this tree
$ret .= $this->show_graphical_subtree($p, $indent_images, TRUE);
}
}
$ret .= "
";
}
return $ret;
}
/**
* Create graphical class tree, including clickable links to expand/contract branches.
*
* @param boolean $show_debug - TRUE to display additional information against each class
* @return string - text for display
*/
public function show_graphical_tree($show_debug=FALSE)
{
$this->graph_debug = $show_debug;
$indent_images = array();
$ret = "