'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'), ]; /* Ensure all private groups // Juan Carlos RaƱa Trabado */ $forums_of_groups = get_forums_of_group($current_group); if (!GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_session_id())) { api_not_allowed(true); } /* Actions and Action links */ /* * User wants to register in this group */ if (!empty($_GET['selfReg']) && GroupManager::is_self_registration_allowed($user_id, $current_group) ) { GroupManager::subscribe_users($user_id, $current_group); Display::addFlash(Display::return_message(get_lang('GroupNowMember'))); } /* * User wants to unregister from this group */ if (!empty($_GET['selfUnReg']) && GroupManager::is_self_unregistration_allowed($user_id, $current_group) ) { GroupManager::unsubscribe_users($user_id, $current_group); Display::addFlash( Display::return_message(get_lang('StudentDeletesHimself'), 'normal') ); } Display::display_header( $nameTools.' '.Security::remove_XSS($current_group['name']), 'Group' ); /* Introduction section (editable by course admin) */ Display::display_introduction_section(TOOL_GROUP); echo '
'.Security::remove_XSS($current_group['description']).'
'; } //if (GroupManager::userHasAccessToBrowse($user_id, $this_group, $session_id)) { // If the user is subscribed to the group or the user is a tutor of the group then if (api_is_allowed_to_edit(false, true) || GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_session_id()) ) { $actions_array = []; if (is_array($forums_of_groups)) { if ($current_group['forum_state'] != GroupManager::TOOL_NOT_AVAILABLE) { foreach ($forums_of_groups as $key => $value) { if ($value['forum_group_public_private'] == 'public' || ($value['forum_group_public_private'] == 'private') || !empty($user_is_tutor) || api_is_allowed_to_edit(false, true) ) { $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.$value['forum_id'].'&'.api_get_cidreq().'&origin=group', 'content' => Display::return_icon( 'forum.png', get_lang('Forum').': '.$value['forum_title'], [], 32 ), ]; } } } } if ($current_group['doc_state'] != GroupManager::TOOL_NOT_AVAILABLE) { // Link to the documents area of this group $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq(), 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), [], 32), ]; } if ($current_group['calendar_state'] != GroupManager::TOOL_NOT_AVAILABLE) { $groupFilter = ''; if (!empty($group_id)) { $groupFilter = "&type=course&user_id=GROUP:$group_id"; } // Link to a group-specific part of agenda $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?'.api_get_cidreq().$groupFilter, 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), [], 32), ]; } if ($current_group['work_state'] != GroupManager::TOOL_NOT_AVAILABLE) { // Link to the works area of this group $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), 'content' => Display::return_icon('work.png', get_lang('GroupWork'), [], 32), ]; } if ($current_group['announcements_state'] != GroupManager::TOOL_NOT_AVAILABLE) { // Link to a group-specific part of announcements $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(), 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), [], 32), ]; } if ($current_group['wiki_state'] != GroupManager::TOOL_NOT_AVAILABLE) { // Link to the wiki area of this group $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'wiki/index.php?'.api_get_cidreq().'&action=show&title=index&session_id='.api_get_session_id().'&group_id='.$current_group['id'], 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), [], 32), ]; } if ($current_group['chat_state'] != GroupManager::TOOL_NOT_AVAILABLE) { // Link to the chat area of this group if (api_get_course_setting('allow_open_chat_window')) { $actions_array[] = [ 'url' => "javascript: void(0);", 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32), 'url_attributes' => [ 'onclick' => " window.open('../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id']."','window_chat_group_".api_get_course_id()."_".api_get_group_id()."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')", ], ]; } else { $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id'], 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32), ]; } } $enabled = api_get_plugin_setting('bbb', 'tool_enable'); if ($enabled === 'true') { $bbb = new bbb(); if ($bbb->hasGroupSupport()) { $actions_array[] = [ 'url' => api_get_path(WEB_PLUGIN_PATH)."bbb/start.php?".api_get_cidreq(), 'content' => Display::return_icon('bbb.png', get_lang('VideoConference'), [], 32), ]; } } if (!empty($actions_array)) { echo Display::actions($actions_array); } } else { $actions_array = []; if (is_array($forums_of_groups)) { if ($current_group['forum_state'] == GroupManager::TOOL_PUBLIC) { foreach ($forums_of_groups as $key => $value) { if ($value['forum_group_public_private'] == 'public') { $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?cidReq='.api_get_course_id().'&forum='.$value['forum_id'].'&gidReq='.Security::remove_XSS($current_group['id']).'&origin=group', 'content' => Display::return_icon( 'forum.png', get_lang('GroupForum'), [], ICON_SIZE_MEDIUM ), ]; } } } } if ($current_group['doc_state'] == GroupManager::TOOL_PUBLIC) { // Link to the documents area of this group $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'document/document.php?'.api_get_cidreq(), 'content' => Display::return_icon('folder.png', get_lang('GroupDocument'), [], ICON_SIZE_MEDIUM), ]; } if ($current_group['calendar_state'] == GroupManager::TOOL_PUBLIC) { $groupFilter = ''; if (!empty($group_id)) { $groupFilter = "&type=course&user_id=GROUP:$group_id"; } // Link to a group-specific part of agenda $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'calendar/agenda_js.php?'.api_get_cidreq().$groupFilter, 'content' => Display::return_icon('agenda.png', get_lang('GroupCalendar'), [], 32), ]; } if ($current_group['work_state'] == GroupManager::TOOL_PUBLIC) { // Link to the works area of this group $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), 'content' => Display::return_icon('work.png', get_lang('GroupWork'), [], ICON_SIZE_MEDIUM), ]; } if ($current_group['announcements_state'] == GroupManager::TOOL_PUBLIC) { // Link to a group-specific part of announcements $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'announcements/announcements.php?'.api_get_cidreq(), 'content' => Display::return_icon('announce.png', get_lang('GroupAnnouncements'), [], ICON_SIZE_MEDIUM), ]; } if ($current_group['wiki_state'] == GroupManager::TOOL_PUBLIC) { // Link to the wiki area of this group $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH).'wiki/index.php?'.api_get_cidreq().'&action=show&title=index&session_id='.api_get_session_id().'&group_id='.$current_group['id'], 'content' => Display::return_icon('wiki.png', get_lang('GroupWiki'), [], 32), ]; } if ($current_group['chat_state'] == GroupManager::TOOL_PUBLIC) { // Link to the chat area of this group if (api_get_course_setting('allow_open_chat_window')) { $actions_array[] = [ 'url' => "javascript: void(0);\" onclick=\"window.open('../chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id']."','window_chat_group_".api_get_course_id()."_".api_get_group_id()."','height=380, width=625, left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no') \"", 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32), ]; } else { $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH)."chat/chat.php?".api_get_cidreq()."&toolgroup=".$current_group['id'], 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32), ]; } } if (!empty($actions_array)) { echo Display::actions($actions_array); } } /* * List all the tutors of the current group */ $tutors = GroupManager::get_subscribed_tutors($current_group); $tutor_info = ''; if (count($tutors) == 0) { $tutor_info = get_lang('GroupNoneMasc'); } else { $tutor_info .= '