"group.php", "name" => get_lang("GroupManagement"));
/*
-----------------------------------------------------------
Header
-----------------------------------------------------------
*/
Display::display_header($nameTools,"Group");
/*
-----------------------------------------------------------
Actions and Action links
-----------------------------------------------------------
*/
/*
* User wants to register in this group
*/
if ($_GET['selfReg'] && GroupManager :: is_self_registration_allowed($_SESSION['_uid'], $current_group['id']))
{
GroupManager :: subscribe_users($_SESSION['_uid'], $current_group['id']);
Display :: display_normal_message(get_lang('GroupNowMember'));
}
/*
* User wants to unregister from this group
*/
if ($_GET['selfUnReg'] && GroupManager :: is_self_unregistration_allowed($_SESSION['_uid'], $current_group['id']))
{
GroupManager :: unsubscribe_users($_SESSION['_uid'], $current_group['id']);
Display::display_normal_message(get_lang('StudentDeletesHimself'));
}
/*
* Edit the group
*/
if (api_is_allowed_to_edit() or GroupManager :: is_tutor($_user['user_id']))
{
echo "".get_lang("EditGroup")."
";
}
/*
* Register to group
*/
if (GroupManager :: is_self_registration_allowed($_SESSION['_uid'], $current_group['id']))
{
echo '
'.get_lang("StudentUnsubscribe").'
'; } if( isset($_GET['action'])) { switch( $_GET['action']) { case 'show_msg': Display::display_normal_message($_GET['msg']); break; } } /* ----------------------------------------------------------- Main Display Area ----------------------------------------------------------- */ $course_code = $_course['sysCode']; $is_course_member = CourseManager :: is_user_subscribed_in_real_or_linked_course($_SESSION['_uid'], $course_code); /* * Group title and comment */ api_display_tool_title($nameTools.' '.stripslashes($current_group['name'])); echo ''.stripslashes($current_group['description']).''; /* * Group Tools */ // If the user is subscribed to the group or the user is a tutor of the group then if (api_is_allowed_to_edit() OR GroupManager :: is_user_in_group($_SESSION['_uid'], $current_group['id'])) { $tools = ''; // Edited by Patrick Cool, 12 feb 2004: hide the forum link if there is no forum for this group (deleted through forum_admin.php) if (!is_null($current_group['forum_id']) && $current_group['forum_state'] != TOOL_NOT_AVAILABLE) { $tools .= "
".get_lang("Forums")."";
}
if( $current_group['doc_state'] != TOOL_NOT_AVAILABLE )
{
// link to the documents area of this group
$tools .= "";
}
if ( $current_group['calendar_state'] != TOOL_NOT_AVAILABLE)
{
//link to a group-specific part of agenda
$tools .= "";
}
if ( $current_group['work_state'] != TOOL_NOT_AVAILABLE)
{
//link to the works area of this group
$tools .= "";
}
if ( $current_group['announcements_state'] != TOOL_NOT_AVAILABLE)
{
//link to a group-specific part of announcements
$tools .= "";
}
echo ''.get_lang("Tools").':'.$tools.''; } else { $tools = ''; if ($current_group['forum_state'] == TOOL_PUBLIC && !is_null($current_group['forum_id'])) { $tools .= "
".get_lang("Forums")."
".get_lang("GroupDocument")."
".get_lang("GroupCalendar")."
".get_lang("GroupWork")."
".get_lang("GroupAnnouncements")."'.$tools.''; } /* * list all the tutors of the current group */ $tutors = GroupManager::get_subscribed_tutors($current_group['id']); if (count($tutors) == 0) { $tutor_info = get_lang("GroupNoneMasc"); } else { foreach($tutors as $index => $tutor) { $tutor_info .= ""; } } echo ''.get_lang("GroupTutors").':
'.$tutor_info.''; /* * list all the members of the current group */ $tutors = GroupManager::get_subscribed_users($current_group['id']); if (count($tutors) == 0) { $member_info = get_lang("GroupNoneMasc"); } else { foreach($tutors as $index => $member) { $member_info .= ""; } } echo ''.get_lang("GroupMembers").':
'.$member_info.''; /* ============================================================================== FOOTER ============================================================================== */ if ($origin != 'learnpath') { Display::display_footer(); } ?>