'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'), ]; /* Ensure all private groups // Juan Carlos RaƱa Trabado */ $forums = get_forums_of_group($groupEntity); if (!GroupManager::userHasAccessToBrowse($user_id, $groupEntity, api_get_session_id())) { api_not_allowed(true); } /* * User wants to register in this group */ if (!empty($_GET['selfReg']) && GroupManager::is_self_registration_allowed($user_id, $groupEntity) ) { GroupManager::subscribeUsers($user_id, $groupEntity); Display::addFlash(Display::return_message(get_lang('You are now a member of this group.'))); } /* * User wants to unregister from this group */ if (!empty($_GET['selfUnReg']) && GroupManager::is_self_unregistration_allowed($user_id, $groupEntity) ) { GroupManager::unsubscribeUsers($user_id, $groupEntity); Display::addFlash( Display::return_message(get_lang('You\'re now unsubscribed.'), 'normal') ); } Display::display_header( $nameTools.' '.Security::remove_XSS($groupEntity->getName()), 'Group' ); Display::display_introduction_section(TOOL_GROUP); $actions = ''. Display::return_icon( 'back.png', get_lang('Back to Groups list'), '', ICON_SIZE_MEDIUM ). ''; $confirmationMessage = addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES)); // Register to group. $subscribe_group = ''; if (GroupManager::is_self_registration_allowed($user_id, $groupEntity)) { $subscribe_group = ''. get_lang('Add me to this group'). ''; } // Unregister from group. $unsubscribe_group = ''; if (GroupManager::is_self_unregistration_allowed($user_id, $groupEntity)) { $unsubscribe_group = ''. get_lang('Unsubscribe me from this group.').''; } echo Display::toolbarAction('toolbar', [$actions]); $edit_url = ''; if (api_is_allowed_to_edit(false, true) || GroupManager::isTutorOfGroup($user_id, $groupEntity) ) { $edit_url = ''. Display::return_icon('edit.png', get_lang('Edit this group'), '', ICON_SIZE_SMALL). ''; } echo Display::page_header( Security::remove_XSS($groupEntity->getName()).' '.$edit_url.' '.$subscribe_group.' '.$unsubscribe_group ); if (!empty($groupEntity->getDescription())) { echo '
'.Security::remove_XSS($groupEntity->getDescription()).'
'; } if (api_is_allowed_to_edit(false, true) || GroupManager::userHasAccessToBrowse($user_id, $groupEntity, api_get_session_id()) ) { $actions_array = []; if (is_array($forums)) { if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getForumState()) { foreach ($forums as $forum) { if ('public' === $forum->getForumGroupPublicPrivate() || ('private' === $forum->getForumGroupPublicPrivate()) || !empty($user_is_tutor) || api_is_allowed_to_edit(false, true) ) { $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH). 'forum/viewforum.php?forum='.$forum->getIid().'&'.api_get_cidreq().'&origin=group', 'content' => Display::return_icon( 'forum.png', get_lang('Forum').': '.$forum->getForumTitle(), [], 32 ), ]; } } } } if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getDocState()) { $params = [ 'toolName' => 'document', 'cid' => $courseId, ]; $url = Container::getRouter()->generate('chamilo_core_course_redirect_tool', $params).'?'.api_get_cidreq(); $actions_array[] = [ 'url' => $url, 'content' => Display::return_icon('folder.png', get_lang('Documents'), [], 32), ]; } if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getCalendarState()) { $groupFilter = ''; if (!empty($group_id)) { $groupFilter = "&type=course&user_id=GROUP:$group_id"; } $params = [ 'toolName' => 'agenda', 'cid' => $courseId, ]; $url = Container::getRouter()->generate('chamilo_core_course_redirect_tool', $params).'?'.api_get_cidreq(); // Link to a group-specific part of agenda $actions_array[] = [ 'url' => $url, 'content' => Display::return_icon('agenda.png', get_lang('Agenda'), [], 32), ]; } if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getWorkState()) { // 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('Assignments'), [], 32), ]; } if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getAnnouncementsState()) { // 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('Announcements'), [], 32), ]; } if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getWikiState()) { // 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&sid='.api_get_session_id().'&group_id='.$groupEntity->getIid(), 'content' => Display::return_icon('wiki.png', get_lang('Wiki'), [], 32), ];*/ } if (GroupManager::TOOL_NOT_AVAILABLE != $groupEntity->getChatState()) { // 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='.$groupEntity->getIid()."','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().'&gid='.$groupEntity->getIid(), 'content' => Display::return_icon('chat.png', get_lang('Chat'), [], 32), ]; }*/ } $enabled = api_get_plugin_setting('bbb', 'tool_enable'); if ('true' === $enabled) { $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), ]; } } $enabled = api_get_plugin_setting('zoom', 'tool_enable'); if ('true' === $enabled) { $actions_array[] = [ 'url' => api_get_path(WEB_PLUGIN_PATH).'zoom/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)) { if (GroupManager::TOOL_PUBLIC == $groupEntity->getForumState()) { foreach ($forums as $forum) { if ('public' === $forum->getForumGroupPublicPrivate()) { $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH). 'forum/viewforum.php?cid='.api_get_course_int_id(). '&forum='.$forum->getIid().'&gid='.$groupEntity->getIid().'&origin=group', 'content' => Display::return_icon( 'forum.png', get_lang('Group Forum'), [], ICON_SIZE_MEDIUM ), ]; } } } } if (GroupManager::TOOL_PUBLIC == $groupEntity->getDocState()) { // 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('Documents'), [], ICON_SIZE_MEDIUM), ]; } if (GroupManager::TOOL_PUBLIC == $groupEntity->getCalendarState()) { $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('Agenda'), [], 32), ]; } if (GroupManager::TOOL_PUBLIC == $groupEntity->getWorkState()) { // 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('Assignments'), [], ICON_SIZE_MEDIUM), ]; } if (GroupManager::TOOL_PUBLIC == $groupEntity->getAnnouncementsState()) { // 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('Announcements'), [], ICON_SIZE_MEDIUM), ]; } if (GroupManager::TOOL_PUBLIC == $groupEntity->getWikiState()) { // 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&sid='.api_get_session_id().'&gid='.$group_id, 'content' => Display::return_icon('wiki.png', get_lang('Wiki'), [], 32), ]; } if (GroupManager::TOOL_PUBLIC == $groupEntity->getChatState()) { // 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='.$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='.$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 = $groupEntity->getTutors(); $userRepo = Container::getUserRepository(); $tutor_info = ''; if (0 == count($tutors)) { $tutor_info = get_lang('(none)'); } else { $tutor_info .= '