Hide Menu Item for admins

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
andyrav
User
Posts: 636

Hide Menu Item for admins

Post by andyrav »

Hi
Is there a way to hind a menu item also from admins?

if (CurrentUserLevel() != "1") {
        if ($item->Url == "customerdashboard") {        
			return FALSE;//dont draw it
		}
    }

This is working for non admin just also want to hide form admins too

thanks


arbei
User
Posts: 9286

Post by arbei »

andyrav wrote:

if (CurrentUserLevel() != "1") {

Then you should not exclude administrators by above.


andyrav
User
Posts: 636

Post by andyrav »

not sure what you mean, can you post an example please


mobhar
User
Posts: 11660

Post by mobhar »

You may try:

if (CurrentUserLevel() == -1) { // admin user level
    if ($item->Url == "customerdashboard") {
        return false; // hide menu item
    }
}

Post Reply