|
RE: Navigation Menu Only for Admin?: msg#00062php.drupal.support
> Make a custom PHP block with the following code: > > global $user; > if ($user->uid == 1) { > return '<div class="menu">'. theme('menu_tree') .'</div>'; > } Hi Steven, It wasn't working properly, so I changed the code to: if ($user->uid == 1) { $OUTPUT .= ("<div class='menu'>" .menu_tree() ."</div>"); } Is this appropriate? (Haven't been using Drupal long -- don't know all the security or coding issues yet.) I added to an existing menu block which now looks like: global $user; if ($user->uid) { $OUTPUT="Welcome back, $user->name,<BR> <UL> <LI><a href=\"?q=queue\"><B>RATE STORIES</a></LI> <LI><a href=\"?q=node/add/story\">ADD A NEWS STORY</a></LI> <LI><a href=\"?q=node/add/event\">ADD AN EVENT</B></a></LI> <LI><a href=\"?q=node/add/image\">ADD PICTURES</B></a></LI> <LI><a href=\"?q=user/edit\">My Settings</a></LI> <LI><a href=\"?q=logout\">Logout</a></LI> </UL>"; } else { $OUTPUT="Welcome, visitor."; } if ($user->uid == 1) { $OUTPUT .= ("<BR><div class='menu'>" .menu_tree() ."</div>"); } return ($OUTPUT); Will this cause any problems in the future? Cheers, Mark -- [ Drupal support list | http://list.drupal.org/ ] |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re[2]: Getting started with taxonomy: 00062, Valery V. Kachurov |
|---|---|
| Next by Date: | Re: Comments permissions: 00062, Jeremy Andrews |
| Previous by Thread: | Re: Navigation Menu Only for Admin?i: 00062, Steven Wittens |
| Next by Thread: | Re: Navigation Menu Only for Admin?: 00062, war-boar |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |