This content has been marked as final.
Show 1 reply
-
1. Re: Removing Default
cnovara Oct 6, 2004 12:41 PM (in response to mchinn)For my own need, see http://enfanceetcroissance.com I have modified the menuBlock class to remove the module section for all users except admin.
I want a complete control of what links users see, so I make the menu content by working on "before" MBean property (you see what I mean uhh ?). Thats my personal choice, somehow against pure CMS spirit.
To achieve this, I have sub-classed menuBlock, created my own custom class and replaced menu-block-service.xml from jboss deploy rep by my own one.
You can also modify the original class ...
My mods are VERY trivial, find the render method in MenuBlock.java andpaste this onepublic void render(Page page) { user = getApi().currentUser(); if (user!=null) // We are connected login=user.getUserName(); else { login=null; } //System.out.println("login= "+login); renderMenu(page, bulletBefore, menuBefore); if ("admin".equals(login)) renderModules(page); // Hide modules for non-admin renderMenu(page, bulletBefore, menuAfter); }
If that's not clear, just ask me more.
I'm looking for ideas to make it cleaner and perhaps add it to CVS (Nukes 2 ?)