Page 1 of 1

How to remove a menu item

Posted: Tue Sep 03, 2013 11:00 pm
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


Re: How to remove a menu item

Posted: Wed Sep 04, 2013 2:31 am
by digitalphotoworld

Add in function MenuItem_Adding

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

return false;

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


Re: How to remove a menu item

Posted: Fri Sep 06, 2013 1:24 am
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;    
}