How to remove a menu item

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
kaybroz
User
Posts: 1
Location: Kampala, Uganda

How to remove a menu item

Post by kaybroz »

Hi everyone, I have using phpmaker for a while and I really appreciate it as a great tool for code generation.
However I have a requirement of removing the Logout and Change Password items from the menu.
I am going to actually use icons some where on the page.
How can I accomplish this? I have been trying to use the Menu_Rendering function but i am not yet successful.
Kindly rescue me. Thanks


digitalphotoworld
User
Posts: 416
Location: Nürnberg/Germany

Post by digitalphotoworld »

Add in function MenuItem_Adding

if ($Item->Id == -2)     

return false;

To view the whole menu array use
print_r($item);


mobhar
User
Posts: 11905

Post by mobhar »

Insert the following code into your "MenuItem_Adding" server event:

if ($Item->Text == $Language->Phrase("changepwd") || $Item->Text == $Language->Phrase("logout")) {
   return FALSE;    
}

Post Reply