diff --git a/group/clientlib.js b/group/clientlib.js index 9e433a196c4..9bdb2bc8f80 100644 --- a/group/clientlib.js +++ b/group/clientlib.js @@ -169,7 +169,7 @@ UpdatableMembersCombo.prototype.refreshMembers = function () { document.getElementById("deletegroup").disabled = selectionCount == 0; if(singleSelection) { - var sUrl = this.wwwRoot+"/group/index.php?id="+this.courseId+"&group="+groupId+"&act_ajax_getmembersingroup"; + var sUrl = this.wwwRoot + "/group/index.php?id=" + this.courseId + "&group=" + groupId + "&action=ajax_getmembersingroup"; var self = this; YUI().use('io', function (Y) { Y.io(sUrl, { diff --git a/group/index.php b/group/index.php index ce3fd9e9d1a..b291c396eed 100644 --- a/group/index.php +++ b/group/index.php @@ -28,7 +28,8 @@ require_once('lib.php'); $courseid = required_param('id', PARAM_INT); $groupid = optional_param('group', false, PARAM_INT); $userid = optional_param('user', false, PARAM_INT); -$action = groups_param_action(); +$action = optional_param('action', false, PARAM_TEXT); + // Support either single group= parameter, or array groups[]. if ($groupid) { $groupids = array($groupid); @@ -249,35 +250,3 @@ $output = $PAGE->get_renderer('core_group'); echo $output->render($renderable); echo $OUTPUT->footer(); - -/** - * Returns the first button action with the given prefix, taken from - * POST or GET, otherwise returns false. - * @see /lib/moodlelib.php function optional_param(). - * @param string $prefix 'act_' as in 'action'. - * @return string The action without the prefix, or false if no action found. - */ -function groups_param_action($prefix = 'act_') { - $action = false; - - if ($_POST) { - $formvars = $_POST; - } else if ($_GET) { - $formvars = $_GET; - } - - if ($formvars) { - foreach ($formvars as $key => $value) { - if (preg_match("/$prefix(.+)/", $key, $matches)) { - $action = $matches[1]; - break; - } - } - } - if ($action && !preg_match('/^\w+$/', $action)) { - $action = false; - throw new \moodle_exception('unknowaction'); - } - - return $action; -} diff --git a/group/templates/index.mustache b/group/templates/index.mustache index 4a5b4d13220..ae9851ab463 100644 --- a/group/templates/index.mustache +++ b/group/templates/index.mustache @@ -92,22 +92,22 @@
- +
- +
- +
- +
- +
- +
@@ -127,7 +127,7 @@
- +