Merge branch 'MDL-32649_ratings_sort_22' of git://github.com/andyjdavis/moodle into MOODLE_22_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2012-06-05 02:23:30 +02:00
+11 -6
View File
@@ -38,10 +38,16 @@ $popup = optional_param('popup', 0, PARAM_INT); //==1 if in a popup window?
list($context, $course, $cm) = get_context_info_array($contextid);
require_login($course, false, $cm);
$url = new moodle_url('/rating/index.php', array('contextid'=>$contextid,'itemid'=>$itemid,'scaleid'=>$scaleid));
if ($sort !== 0) {
$url = new moodle_url('/rating/index.php', array('contextid'=>$contextid,'component'=>$component,'itemid'=>$itemid,'scaleid'=>$scaleid));
if (!empty($ratingarea)) {
$url->param('ratingarea', $ratingarea);
}
if (!empty($sort)) {
$url->param('sort', $sort);
}
if (!empty($popup)) {
$url->param('popup', $popup);
}
$PAGE->set_url($url);
$PAGE->set_context($context);
@@ -84,10 +90,9 @@ if (!$ratings) {
$msg = get_string('noratings','rating');
echo html_writer::tag('div', $msg, array('class'=>'mdl-align'));
} else {
$sorturl = new moodle_url('/index.php', array('contextid' => $contextid, 'itemid' => $itemid, 'scaleid' => $scaleid));
if ($popup) {
$sorturl->param('popup', $popup);
}
// To get the sort URL, copy the current URL and remove any previous sort
$sorturl = new moodle_url($url);
$sorturl->remove_params('sort');
$table = new html_table;
$table->cellpadding = 3;