$active != 0 ? "$webimroot/operator/group.php?gid=$gid" : "", getlocal("page_group.tab.members") => $active != 1 ? "$webimroot/operator/groupmembers.php?gid=$gid" : "", ); } else { $page['tabs'] = array(); } } function get_operator_groupslist($operatorid, $link) { global $settings, $mysqlprefix; if ($settings['enablegroups'] == '1') { $groupids = array(0); $allgroups = select_multi_assoc("select groupid from ${mysqlprefix}chatgroupoperator where operatorid = $operatorid order by groupid", $link); foreach ($allgroups as $g) { $groupids[] = $g['groupid']; } return implode(",", $groupids); } else { return ""; } } function get_available_parent_groups($skipgroup) { global $mysqlprefix; $link = connect(); $query = "select ${mysqlprefix}chatgroup.groupid as groupid, parent, vclocalname from ${mysqlprefix}chatgroup order by vclocalname"; $groupslist = select_multi_assoc($query, $link); $result = array(array('groupid' => '', 'level' => '', 'vclocalname' => getlocal("form.field.groupparent.root"))); if ($skipgroup) { $skipgroup = (array)$skipgroup; } else { $skipgroup = array(); } $result = array_merge($result, get_sorted_child_groups_($groupslist, $skipgroup, 0) ); close_connection($link); return $result; } function group_has_children($groupid, $link) { global $mysqlprefix; $children = select_one_row(sprintf("select COUNT(*) as count from ${mysqlprefix}chatgroup where parent = %u", $groupid), $link); return ($children['count'] > 0); } ?>