'; echo '
  •  '.get_lang("NewGroupCreate").'
  • '; if (get_setting('allow_group_categories') == 'true') { echo '
  • '.get_lang("AddCategory").'
  • '; } else { echo '
  •  '.get_lang('PropModify').'
  • '; } if( Database::count_rows(Database::get_course_table(TABLE_GROUP)) > 0) { echo '
  •  '.get_lang('GroupOverview').'
  • '; } echo ''; } $group_cats = GroupManager :: get_categories(); if (get_setting('allow_group_categories') == 'true' && count($group_cats) > 1) { echo '

    '.get_lang('ShowAll').'

    '; } /* * 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()) { echo ''.get_lang('Edit').' '; echo ''.get_lang('Delete').' '; if ($index != 0) { echo ' '; } if ($index != count($group_cats) - 1) { echo ' '; } } echo '

    '.$category['description'].'

    '; } else { $group_list = GroupManager :: get_group_list(); $in_category = true; } echo '
    '; if (count($group_list) > 0 && $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() && count($group_list) > 1) { $row[] = $this_group['id']; } // group name if (api_is_allowed_to_edit() || 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)) { $group_name = ''.$this_group['name'].''; if ($_SESSION['_uid'] && $_SESSION['_uid'] == $this_group['id_tutor']) { $group_name .= ' ('.get_lang('OneMyGroups').')'; } elseif ($this_group['is_member']) { $group_name .= ' ('.get_lang("MyGroup").')'; } $row[] = $group_name.'
    '.trim($this_group['description']); } else { $row[] = $this_group['name'].'
    '.trim($this_group['description']); } // self-registration / unregistration if (!api_is_allowed_to_edit()) { if (GroupManager :: is_self_registration_allowed($_user['user_id'], $this_group['id'])) { $row[] = ''.get_lang("GroupSelfRegInf").''; } elseif (GroupManager :: is_self_unregistration_allowed($_user['user_id'], $this_group['id'])) { $row[] = ''.get_lang("GroupSelfUnRegInf").''; } else { $row[] = '-'; } } // number of members in group $row[] = $this_group['number_of_members']; // max number of members in group $row[] = ($this_group['maximum_number_of_members'] == MEMBER_PER_GROUP_NO_LIMIT ? '-' : $this_group['maximum_number_of_members']); // tutor name $tutor_info = ''; if($this_group['id_tutor'] != 0) { $tutor = api_get_user_info($this_group['id_tutor']); $tutor_info = Display::encrypted_mailto_link($tutor['mail'],$tutor['firstName'].' '.$tutor['lastName']); } $row[] = $tutor_info; // edit-links if (api_is_allowed_to_edit()) { $edit_actions = ''.get_lang( '; $edit_actions .= ''.get_lang( '; $edit_actions .= ''.get_lang( '; $edit_actions .= ''.get_lang('; $row[] = $edit_actions; } $totalRegistered = $totalRegistered + $this_group[nbMember]; $group_data[] = $row; } // while loop if (isset ($_GET['show_all'])) { $paging_options = array ('per_page' => count($group_data)); } else { $paging_options = array (); } $table = new SortableTableFromArray($group_data); $table->set_additional_parameters(array('category'=>$_GET['category'])); $column = 0; if (api_is_allowed_to_edit() and count($group_list) > 1) { $table->set_header($column++,'', false); } $table->set_header($column++,get_lang("ExistingGroups")); if (!api_is_allowed_to_edit()) // If self-registration allowed { $table->set_header($column++,get_lang("GroupSelfRegistration")); } $table->set_header($column++,get_lang("Registered")); $table->set_header($column++,get_lang("Max")); $table->set_header($column++,get_lang('GroupTutor')); if (api_is_allowed_to_edit()) // only for course administrator { $table->set_header($column++,get_lang("Modify"), false); $form_actions = array(); $form_actions['delete_selected'] = get_lang('Delete'); $form_actions['fill_selected'] = get_lang('FillGroup'); $form_actions['empty_selected'] = get_lang('EmptyGroup'); if (count($group_list) > 1) { $table->set_form_actions($form_actions,'group'); } } $table->display(); } elseif ($in_category) { echo get_lang('NoGroupsAvailable'); } echo '
    '; } /* ============================================================================== FOOTER ============================================================================== */ if (!isset ($_GET['origin']) || $_GET['origin'] != 'learnpath') { Display::display_footer(); } ?>