3
Yes, it's possible. Here's an example (from my chess module).
'groups_play' is a module configuration parameter that contains a list of user groups.
xoops_version.php
...
// Config
$modversion['config'][1]['name'] = 'groups_play';
$modversion['config'][1]['title'] = '_MI_CHESS_GROUPS_PLAY';
$modversion['config'][1]['description'] = '_MI_CHESS_GROUPS_PLAY_DES';
$modversion['config'][1]['formtype'] = 'group_multi';
$modversion['config'][1]['valuetype'] = 'array';
$modversion['config'][1]['default'] = array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS);
...
// Menu
$modversion['hasMain'] = 1;
$modversion['sub'][1]['name'] = _MI_CHESS_SMNAME1;
$modversion['sub'][1]['url'] = 'help.php';
$modversion['sub'][2]['name'] = _MI_CHESS_SMNAME2;
$modversion['sub'][2]['url'] = 'index.php';
// Display create-game menu item if current user has the play-chess right.
global $xoopsModule, $xoopsModuleConfig, $xoopsUser;
if (is_object($xoopsModule) and $xoopsModule->getVar('dirname') == 'chess'
and !empty($xoopsModuleConfig['groups_play']) and is_array($xoopsModuleConfig['groups_play'])
and (in_array(XOOPS_GROUP_ANONYMOUS, $xoopsModuleConfig['groups_play'])
or is_object($xoopsUser) and count(array_intersect($xoopsUser->getGroups(), $xoopsModuleConfig['groups_play'])) > 0))
{
$modversion['sub'][3]['name'] = _MI_CHESS_SMNAME3;
$modversion['sub'][3]['url'] = 'create.php';
}
...