This topic is locked

Hide menu item

3/27/2012 8:04:29 AM
PHPRunner General questions
J
Jeroef author

This code is working nice, but what do i type if need to hide more items?
if ($_SESSION["GroupID"]!="manager")

{

$title = $menuItem->getTitle();

if ($title=="Yahoo Finance")

return false;

}

return true;
Regards

C
cgphp 3/27/2012
if ($_SESSION["GroupID"]!="manager")

{

$items_to_hide = array("Yahoo Finance","Second Item Name", "Third Item Name");
if(in_array($menuItem->getTitle(),$items_to_hide))

{

return false;

}

}
return true;