Restored a glovbal declaration for SESSION (to make sortoder work again)

This commit is contained in:
moodler 2007-07-16 05:56:52 +00:00
parent 06954a036c
commit 63d6efa23e

View File

@ -250,6 +250,9 @@ class grade_report_grader extends grade_report {
* for displaying grades. * for displaying grades.
*/ */
function setup_sortitemid() { function setup_sortitemid() {
global $SESSION;
if ($this->sortitemid) { if ($this->sortitemid) {
if (!isset($SESSION->gradeuserreport->sort)) { if (!isset($SESSION->gradeuserreport->sort)) {
$this->sortorder = $SESSION->gradeuserreport->sort = 'ASC'; $this->sortorder = $SESSION->gradeuserreport->sort = 'ASC';
@ -500,16 +503,16 @@ class grade_report_grader extends grade_report {
if ($type == 'filler' or $type == 'fillerfirst' or $type == 'fillerlast') { if ($type == 'filler' or $type == 'fillerfirst' or $type == 'fillerlast') {
$headerhtml .= '<td class="'.$type.$catlevel.'" '.$colspan.'>&nbsp;</td>'; $headerhtml .= '<th class="'.$type.$catlevel.'" '.$colspan.'>&nbsp;</th>';
} else if ($type == 'category') { } else if ($type == 'category') {
$headerhtml .= '<td class="category'.$catlevel.'" '.$colspan.'>'.$element['object']->get_name(); $headerhtml .= '<th class="category'.$catlevel.'" '.$colspan.'>'.$element['object']->get_name();
// Print icons // Print icons
if ($USER->gradeediting) { if ($USER->gradeediting) {
$headerhtml .= $this->get_icons($element); $headerhtml .= $this->get_icons($element);
} }
$headerhtml .= '</td>'; $headerhtml .= '</th>';
} else { } else {
if ($element['object']->id == $this->sortitemid) { if ($element['object']->id == $this->sortitemid) {
if ($this->sortorder == 'ASC') { if ($this->sortorder == 'ASC') {