This topic is locked

Hiding Tabs

8/30/2010 5:39:52 PM
PHPRunner General questions
swant author

Im having trouble trying to figure this out. When being an admin i can view all the tabs to each table. However i would like to hide these on the main page because there is no reason to click on them.

there is only one tab i want to show rather than all the tabs for all the tables

Sergey Kornilov admin 8/30/2010

Not sure what's the 'main page' in your scenario.
I think you can group some of menu items/tabs under a single tab using Menu Editor.

D
Dale 8/31/2010

My Admin has full tabs as you show, and I wanted the Signed in user and the Guest to only see three or four of the tabs.

In the example function below, 'category1' and 'item' are the only two tables that I want to display to all other users.

You would replace these with the table names of your database. The last or condition is to hide any

menu choices that dont relate to any table in the database. IE, I have a HELP menu tab, that is set

to open an external page. Modify your conditions as needed.
I did it this way.

Using the GLOBAL events, select the Menu item: Modify event.
if ($_SESSION["GroupID"] != "Admin")

{

if ($menuItem->getTable() == 'category1' || $menuItem->getTable() == 'item' || $menuItem->getTable() == '')

{

return true;

}

else

{

return false;

}

{

else

{

return true;

}
Save and build. This will only show the tabs you want to who you want.