php while selecting a node should be highlighted.
Posted
by shaibi
on Stack Overflow
See other posts from Stack Overflow
or by shaibi
Published on 2010-04-13T08:31:49Z
Indexed on
2010/04/13
8:32 UTC
Read the original article
Hit count: 234
php
I need to highlight the node value when I select it.how can I wrirte code for that in php my code is
function generate_menu($parent) { $has_childs = false; global $menu_array; foreach($menu_array as $key => $value) { //print_r($value); if ($value['parentid'] == $parent) {
if ($has_childs === false)
{
$has_childs = true;
$menu .= '<ul>';
}
$clor = 'black';
if(($_GET['id']>0) &&($key == $_GET['id']))
{
$clor = '#990000';
}
$chld = generate_menu($key);
$cls = ($chld != '')? 'folder' : 'file';
$menu .= '<li><span class="'.$cls.'" color='.$clor.'> ' . $value['humanid'].'-'.$value['title'] . ' <a href="index.php?id='.$key.'"><img src="images/edit.png" alt=" Edit" title="Edit"/></a></span>';
$menu .= $chld;
$menu .= '</li>';
}
}
if ($has_childs === true) $menu .= '</ul>';
return $menu ;
}
?>
© Stack Overflow or respective owner