'; if (api_is_allowed_to_edit(false,true)) { echo Display::return_icon('group_add.gif', get_lang('NewGroupCreate')) . ''.get_lang('NewGroupCreate').' '; if( Database::count_rows(Database::get_course_table(TABLE_GROUP)) > 0) { //echo ''.Display::return_icon('group_view.gif').' '.get_lang('GroupOverview').' '; echo Display::return_icon('group.gif', get_lang('GroupOverview')) .''.get_lang('GroupOverview').' '; } if (get_setting('allow_group_categories') == 'true') { echo Display::return_icon('folder_new.gif', get_lang('AddCategory')) . ''.get_lang('AddCategory').' '; } else { //echo ''.Display::return_icon('edit_group.gif').' '.get_lang('PropModify').' '; echo Display::return_icon('settings.gif', get_lang('PropModify')) . ''.get_lang('PropModify').' '; } //echo ''.Display::return_icon('group_add_big.gif').' '.get_lang('NewGroupCreate').' '; } $group_cats = GroupManager :: get_categories(); if (get_setting('allow_group_categories') == 'true' && count($group_cats) > 1) { //echo '
'; echo ''.get_lang('ShowAll').''; } echo ''; /* * List all categories */ foreach ($group_cats as $index => $category) { $group_list = array (); $in_category = false; if (get_setting('allow_group_categories') == 'true') { if (isset ($_GET['show_all']) || (isset ($_GET['category']) && $_GET['category'] == $category['id'])) { echo ''; echo ' '.$category['title'].''; $in_category = true; } else { echo ''; echo ' '.$category['title'].''; } $group_list = GroupManager :: get_group_list($category['id']); echo ' ('.count($group_list).' '.get_lang('ExistingGroups').')'; if (api_is_allowed_to_edit(false,true)) { echo ' '; echo ' '; if ($index != 0) { echo ' '; } if ($index != count($group_cats) - 1) { echo ' '; } } echo ''.$category['description'].'
'; } else { $group_list = GroupManager :: get_group_list(); $in_category = true; } //if (count($group_list) > 0 && $in_category) if ($in_category) { $totalRegistered = 0; // Determine wether current user is tutor for this course $user_is_tutor = GroupManager :: is_tutor($_user['user_id']); $group_data = array (); foreach ($group_list as $index => $this_group) { // all the tutors of this group $tutorsids_of_group=GroupManager::get_subscribed_tutors($this_group['id'],true); // create a new table-row $row = array (); // checkbox if (api_is_allowed_to_edit(false,true) && count($group_list) > 1) { $row[] = $this_group['id']; } // group name if ((api_is_allowed_to_edit(false,true) || in_array($_user['user_id'],$tutorsids_of_group) || $this_group['is_member'] || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_FORUM) || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_DOCUMENTS) || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_CALENDAR) || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_ANNOUNCEMENT) || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_WORK) || GroupManager::user_has_access($_user['user_id'],$this_group['id'],GROUP_TOOL_WIKI)) && !(api_is_course_coach() && intval($this_group['session_id'])!=intval($_SESSION['id_session']))) { isset($origin)?$orig=$origin:$orig=null; $group_name = ''.stripslashes($this_group['name']).''; if (!empty($_SESSION['_user']['user_id']) && !empty($this_group['id_tutor']) && $_SESSION['_user']['user_id'] == $this_group['id_tutor']) { $group_name .= ' ('.get_lang('OneMyGroups').')'; } elseif ($this_group['is_member']) { $group_name .= ' ('.get_lang('MyGroup').')'; } if(api_is_allowed_to_edit() && !empty($this_group['session_name'])) { $group_name .= ' ('.$this_group['session_name'].')'; } $row[] = $group_name.'