From a54a8bcf7316de37a258bf020cbe16bbd50ee30b Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 3 Mar 2014 17:32:01 +0100 Subject: [PATCH] Students can browse group list. --- main/group/group.php | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/main/group/group.php b/main/group/group.php index e18d5f7c24..6a43269fa3 100644 --- a/main/group/group.php +++ b/main/group/group.php @@ -47,22 +47,13 @@ if (api_get_setting('allow_group_categories') == 'false') { $res = Database::query($sql); $num = Database::num_rows($res); if ($num == 0) { - $sql = "INSERT INTO ".$cat_table." ( c_id, id , title , description , forum_state, wiki_state, max_student, self_reg_allowed, self_unreg_allowed, groups_per_user, display_order) + $sql = "INSERT INTO $cat_table (c_id, id , title , description , forum_state, wiki_state, max_student, self_reg_allowed, self_unreg_allowed, groups_per_user, display_order) VALUES ($course_id, '2', '".Database::escape_string(get_lang('DefaultGroupCategory'))."', '', '1', '1', '8', '0', '0', '0', '0');"; Database::query($sql); } } /* Header */ - -if (!isset ($_GET['origin']) || $_GET['origin'] != 'learnpath') { - // So we are not in learnpath tool - event_access_tool(TOOL_GROUP); - if (!$is_allowed_in_course) { - api_not_allowed(true); - } -} - Display::display_header(get_lang('Groups')); // Tool introduction @@ -71,14 +62,14 @@ Display::display_introduction_section(TOOL_GROUP); /* * Self-registration and un-registration */ - $my_group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null; - $my_msg = isset($_GET['msg']) ? Security::remove_XSS($_GET['msg']) : null; - $my_group = isset($_REQUEST['group']) ? Security::remove_XSS($_REQUEST['group']) : null; - $my_get_id1 = isset($_GET['id1']) ? Security::remove_XSS($_GET['id1']) : null; - $my_get_id2 = isset($_GET['id2']) ? Security::remove_XSS($_GET['id2']) : null; - $my_get_id = isset($_GET['id']) ? Security::remove_XSS($_GET['id']) : null; - -if (isset($_GET['action'])) { +$my_group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null; +$my_msg = isset($_GET['msg']) ? Security::remove_XSS($_GET['msg']) : null; +$my_group = isset($_REQUEST['group']) ? Security::remove_XSS($_REQUEST['group']) : null; +$my_get_id1 = isset($_GET['id1']) ? Security::remove_XSS($_GET['id1']) : null; +$my_get_id2 = isset($_GET['id2']) ? Security::remove_XSS($_GET['id2']) : null; +$my_get_id = isset($_GET['id']) ? Security::remove_XSS($_GET['id']) : null; + +if (isset($_GET['action']) && $is_allowed_in_course) { switch ($_GET['action']) { case 'self_reg': if (GroupManager :: is_self_registration_allowed($_SESSION['_user']['user_id'], $my_group_id)) { @@ -206,7 +197,7 @@ if (api_get_setting('allow_group_categories') == 'true') { if (api_is_allowed_to_edit(false, true)) { $actions .= ''. Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).''; - $actions .= ''. + $actions .= ''. Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).''; if ($index != 0) { $actions .= ' '.