Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
5 + 7 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
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. [/quote]" />

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.

Who's Online

254 user(s) are online (181 user(s) are browsing Support Forums)


Members: 0


Guests: 254


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits