From fa19c325a920e8861346f8e45ecae0de653be144 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 3 Jan 2007 08:17:56 +0000 Subject: [PATCH] Some minor changes towards MDL-8048 ... much more to do --- group/index.php | 255 +++++++++++++++++++++++++++++++ theme/standard/styles_layout.css | 4 + 2 files changed, 259 insertions(+) create mode 100644 group/index.php diff --git a/group/index.php b/group/index.php new file mode 100644 index 0000000000..986b61aa2b --- /dev/null +++ b/group/index.php @@ -0,0 +1,255 @@ +libdir.'/moodlelib.php'); + +$success = true; + +$courseid = required_param('id', PARAM_INT); +$groupingid = optional_param('grouping', -1, PARAM_INT); +$groupid = optional_param('group', false, PARAM_INT); +$userid = optional_param('user', false, PARAM_INT); + +function groups_param_action($prefix = 'b_') { + $action = false; +//($_SERVER['QUERY_STRING'] && preg_match("/$prefix(.+?)=(.+)/", $_SERVER['QUERY_STRING'], $matches)) { //b_(.*?)[&;]{0,1}/ + + if ($_POST) { + $form_vars = $_POST; + } + elseif ($_GET) { + $form_vars = $_GET; + } + if ($form_vars) { + foreach ($form_vars as $key => $value) { + //echo "$key => $value
\n"; + if (preg_match("/$prefix(.+)/", $key, $matches)) { + $action = $matches[1]; + break; + } + } + } + if ($action && !preg_match('/^\w+$/', $action)) { + $action = false; + error('Action had wrong type.'); + } + ///if (debugging()) echo 'Debug: '.$action; + return $action; +} +$action = groups_param_action(); + +// Get the course information so we can print the header and +// check the course id is valid +$course = groups_get_course_info($courseid); +if (! $course) { + $success = false; + print_error('The course ID is invalid'); +} + +if ($success) { + // Make sure that the user has permissions to manage groups. + require_login($courseid); + + $context = get_context_instance(CONTEXT_COURSE, $courseid); + if (! has_capability('moodle/course:managegroups', $context)) { + redirect(); //"group.php?id=$course->id"); // Not allowed to see all groups + } + + // Set the session key so we can check this later + $sesskey = !empty($USER->id) ? $USER->sesskey : ''; + + switch ($action) { + + case 'showgroupingsettingsform': + redirect(groups_grouping_edit_url($courseid, $groupingid, false)); + break; + case 'showgroupingpermsform': + break; + case 'deletegrouping': + break; + case 'showcreategroupingform': + redirect(groups_grouping_edit_url($courseid, null, false)); + break; + case 'printerfriendly': + redirect('groupui/printgrouping.php?courseid='. $courseid .'&groupingid='. $groupingid); + break; + + case 'showgroupsettingsform': + redirect(groups_group_edit_url($courseid, $groupid, $groupingid, false)); + break; + case 'deletegroup': + redirect(groups_group_edit_url($courseid, $groupid, $groupingid, false, 'delete=1')); + break; + case 'removegroup': + break; + case 'showcreategroupform': + if (GROUP_NOT_IN_GROUPING == $groupingid) { + print_error('errornotingrouping', 'group', groups_home_url($courseid), get_string('notingrouping', 'group')); + } + redirect(groups_group_edit_url($courseid, null, $groupingid, false)); + break; + case 'addgroupstogroupingsform': + break; + case 'updategroups': //Currently reloading. + break; + + case 'removemembers': + break; + case 'showaddmembersform': + redirect(groups_members_add_url($courseid, $groupid, $groupingid, false)); + break; + case 'updatemembers': //Currently reloading. + break; + default: + //print_error('Unknown action.'); + break; + } + + // Print the page and form + $strgroups = get_string('groups'); + $strparticipants = get_string('participants'); + + print_header("$course->shortname: $strgroups home", //TODO: home + "$course->fullname", + "wwwroot/course/view.php?id=$courseid\">$course->shortname ". + "-> wwwroot/user/index.php?id=$courseid\">$strparticipants ". + "-> $strgroups", '', '', true, '', user_login_string($course, $USER)); + + $usehtmleditor = false; + +//groups_sort_language_strings(); +?> +
+ + +" /> + + +*/ ?> + + + + + + + +
+

+ + +

+

+

+

+

+

+

+
+

+ + +

+

+

+

+

+

+ +
+

+ + +

+

+ +
+ + +
+ diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 6605f9caa6..6b77ff58b3 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -281,6 +281,10 @@ form.popupform { overflow:hidden; } +.groupmanagementtable td { + vertical-align: top; +} + /*Accessibility: text 'seen' by screen readers but not visual users. Fixed for RTL languages, example Farsi. */ .accesshide { position:absolute; -- 2.39.5