/* ----------------------------------------------------------------------------------------- listGroups() Lists all availiable groups in the database. Used in admin interface.
Useage: listGroups("checkAll"); or listGroups(); or listGroups($groupid); or listGroups("1 3 4");
listGroups("checkAll"); & listGroups(); * Will preckeck all boxes. * This is usefull for new entries where groupids don't pre-exist.
listGroups($groupid); * Will preckeck any matches. * $groupid can either contain a space delimited string of numbers or an array of numbers. * $groupid is normaly taken from the dbtable of the module in question.
listGroups("1 3 4"); * Will preckeck any group matching any of the numbers. ------------------------------------------------------------------------------------------*/ function listGroups($grps="checkAll") { global $xoopsDB, $myts;
$result = $xoopsDB->queryF("SELECT groupid, name FROM ".$xoopsDB->prefix('groups')." ORDER BY name ASC");
if (!is_array($grps)) { $grps = explode(" ", $grps); }
/* ----------------------------------------------------------------------------------------- checkAccess() Checks if the current user accessing the page belongs to one of the $grps, and if not, sends him where you like. Used in modules.
Useage: checkAccess(, , function checkAccess($grps, $url="index.php", $time="2", $msg=_NOPERM) { global $xoopsUser;
/* ----------------------------------------------------------------------------------------- saveAccess() Makes sure $groupid is a space delimited string and not an array, before saving to database. Used in admin interface.
Useage: $groupid = saveAccess($groupid); ------------------------------------------------------------------------------------------*/ function saveAccess($grps) {