Thursday 03 April 2008 3:13:35 am
Hi, On a project, I had the same need. I have chosen as a solution, to ovverride paglayout.tpl of design admin, and then Modify the code:
{* code for display the principal menu*}
{section var=Menu loop=topmenu($ui_context)}
{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}
{/section}
By this one:
{*define the user groups*}
{def $user=fetch( 'user', 'current_user' )}
{def $group_id = $user.contentobject.main_parent_node_id}
{section var=Menu loop=topmenu($ui_context)}
{*test of the group of user*}
{if eq($group_id,ezini('GroupeXXXXXX','GroupID','configuration.ini'))}
{switch match=$Menu.url}
{case match="content/view/full/2"}{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}{/case}
{case match="content/draft"}{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}{/case}
{case}
{/case}
{/switch}
{else}
{include uri='design:page_topmenuitem.tpl' menu_item=$Menu navigationpart_identifier=$navigation_part.identifier}
{/if}
{/section}
This code makes it possible to test if a user belongs to the group GroupXXXXX (defined in the file configuration.ini) if so, it shows just two menus; content structure and content draft. i hope this will help you. tks Abdelkader.
Abdelkader RHOUATI
Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery
|