| Re: speaking of permissions for modules . . . |
| by phatjew on 2003/10/22 23:09:11 Thanks -- that was a great answer. I should have thought of it myself, but I am a XOOPS newbie. |
| Re: speaking of permissions for modules . . . |
| by mrgym on 2003/10/18 21:30:25 There are a couple of ways. 1. hiding submenu items can be done in the template for ALL submenu items. Add a smarty <{if}> to the system_block_mainmenu.html using the template manager. <{foreach item=sublink from=$module.sublinks}> <{if $xoops_isuser == true}> <a class="menuSub" href="<{$sublink.url}>"><{$sublink.name}></a> <{/if}> <{/foreach}> 2. Your submenu can be generated dynamically. xoops_version.php can look like this; //submenu if($xoopsUser){ //make a submenu if is a user include_once("include/db.class.php"); //global $xoopsDB or //$GLOBALS['xoopsDB'] even for globals off $menuDB = new db($GLOBALS['xoopsDB'],$_GET); //then feed the array to the modversion[sub] array foreach($menuDB->menu as $k=>$v){ $modversion['sub'][$k]['name']=$v['name']; $modversion['sub'][$k]['url']= $v['url']; } } //there are already enough vars! unset($menuDB); If you need to be more precise than "is this a user" then see the top post in this modules forum. |
| speaking of permissions for modules . . . |
| by phatjew on 2003/10/18 17:34:54 The module I am writing has sub-menu items in the main menu. One of them is a "submit" link, exactly lke the one for the Web Links module. However, I only want the submit menu option to show up for certain groups. Is there a way to change a module's Main Menu options based on group permissions? Thanks in advance for any help with this. --Rafi Speak to me in PHP. |