13
Update: This will feature in the next version (no ETA, no) of the News module, where you will be able to specify the usergroups with submit rights as well as approve rights.
If you want the quick-and-dirty solution to this particular problem, do this:
in modules/news/xoops_version.php change the original lines within the "// Menu" code to the following:
// Menu
$modversion['hasMain'] = 1;
$module_handler =& xoops_gethandler('module');
$module =& $module_handler->getByDirname('news');
$config_handler =& xoops_gethandler('config');
$moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
$cansubmit = 0;
if (in_array(XOOPS_GROUP_ANONYMOUS, $moduleConfig['submitgroups'])) {
$cansubmit = 1;
}
else {
global $xoopsUser;
if (isset($xoopsUser)) {
$groups =& $xoopsUser->getGroups();
foreach ($groups as $key => $group) {
if (in_array($group['groupid'], $moduleConfig['submitgroups']) || $xoopsUser->isAdmin($module->getVar('mid'))) {
$cansubmit = 1;
break;
}
}
}
}
if ($cansubmit) {
$modversion['sub'][1]['name'] = _MI_NEWS_SMNAME1;
$modversion['sub'][1]['url'] = "submit.php";
}
unset($cansubmit);
$modversion['sub'][2]['name'] = _MI_NEWS_SMNAME2;
$modversion['sub'][2]['url'] = "archive.php";
and add the following lines to the Config Settings:
$member_handler =& xoops_gethandler('member');
$groups =& $member_handler->getGroups();
foreach ($groups as $key => $group) {
if (XOOPS_GROUP_ADMIN != $group->getVar('groupid')) {
$grouparray[$group->getVar('name')] = $group->getVar('groupid');
}
}
$modversion['config'][6]['name'] = 'submitgroups';
$modversion['config'][6]['title'] = '_MI_ALLOWEDSUBMITGROUPS';
$modversion['config'][6]['description'] = '_MI_ALLOWEDSUBMITGROUPSDESC';
$modversion['config'][6]['formtype'] = 'select_multi';
$modversion['config'][6]['valuetype'] = 'array';
$modversion['config'][6]['default'] = array();
$modversion['config'][6]['options'] = $grouparray;
You will now be able to specify in the News Module Preferences which usergroups will see the link
Note: This will NOT affect the submit page, so if your registered users use the direct link to the submit page, they will still be able to submit news items.