$navigation = build_navigation($navlinks);
return $navigation;
- }
+}
/**
* This class represents a complete tree of categories, grade_items and final grades,
and $element['children'][$sortorder]['object']->is_outcome_item()) {
unset($element['children'][$sortorder]);
- } else if ($element['children'][$sortorder]['type'] == 'category') {
+ } else if ($element['children'][$sortorder]['type'] == 'category') {
grade_tree::no_outcomes($element['children'][$sortorder]);
}
}
}
if ($element['object']->is_hidden()) {
- $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=show&sesskey='.sesskey().'&eid='.$element['eid'];
+ $icon = 'show';
+ $tooltip = '';
+
+ if ($element['object']->hidden > 1) { // Change the icon and add a tooltip showing the date
+ $icon = 'hiddenuntil';
+ $tooltip = userdate($element['object']->hidden);
+ }
+
+ $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=show&sesskey='.sesskey()
+ . '&eid='.$element['eid'];
$url = $gpr->add_url_params($url);
- $action = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/show.gif" class="iconsmall" alt="'.$strshow.'" title="'.$strshow.'"/></a>';
+ $action = '<a href="'.$url.'"><img title="' . $tooltip . '" src="'.$CFG->pixpath.'/t/' . $icon . '.gif" class="iconsmall" alt="'
+ . $strshow.'" title="'.$strshow.'"/></a>';
} else {
- $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=hide&sesskey='.sesskey().'&eid='.$element['eid'];
+ $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=hide&sesskey='.sesskey()
+ . '&eid='.$element['eid'];
$url = $gpr->add_url_params($url);
$action = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/hide.gif" class="iconsmall" alt="'.$strhide.'" title="'.$strhide.'"/></a>';
}
}
if ($element['object']->is_locked()) {
+ $icon = 'unlock';
+ $tooltip = '';
+
+ if ($element['object']->locktime > 1) { // Change the icon and add a tooltip showing the date
+ $icon = 'locktime';
+ $tooltip = userdate($element['object']->locktime);
+ }
+
if (!has_capability('moodle/grade:manage', $this->context) and !has_capability('moodle/grade:unlock', $this->context)) {
return '';
}
- $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=unlock&sesskey='.sesskey().'&eid='.$element['eid'];
+ $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=unlock&sesskey='.sesskey()
+ . '&eid='.$element['eid'];
$url = $gpr->add_url_params($url);
- $action = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/unlock.gif" class="iconsmall" alt="'.$strunlock.'" title="'.$strunlock.'"/></a>';
+ $action = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/' . $icon . '.gif" title="' . $tooltip
+ . '" class="iconsmall" alt="'.$strunlock
+ . '" title="'.$strunlock.'"/></a>';
} else {
if (!has_capability('moodle/grade:manage', $this->context) and !has_capability('moodle/grade:lock', $this->context)) {
return '';
}
- $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=lock&sesskey='.sesskey().'&eid='.$element['eid'];
+ $url = $CFG->wwwroot.'/grade/edit/tree/action.php?id='.$this->courseid.'&action=lock&sesskey='.sesskey()
+ . '&eid='.$element['eid'];
$url = $gpr->add_url_params($url);
- $action = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/lock.gif" class="iconsmall" alt="'.$strlock.'" title="'.$strlock.'"/></a>';
+ $action = '<a href="'.$url.'"><img src="'.$CFG->pixpath.'/t/lock.gif" class="iconsmall" alt="'.$strlock.'" title="'
+ . $strlock.'"/></a>';
}
return $action;
}
'calculations' => 't/calc.gif',
'locks' => 't/lock.gif',
'averages' => 't/sigma.gif',
- 'nooutcomes' => 'i/outcomes.gif');
+ 'nooutcomes' => 't/outcomes.gif');
$pref_name = 'grade_report_show' . $type;
if ($this->get_pref('quickgrading') and $grade->is_editable()) {
$oldval = empty($gradeval) ? -1 : $gradeval;
if (empty($item->outcomeid)) {
- $nogradestr = $this->get_lang_string('nograde');
+ $nogradestr = $this->get_lang_string('nograde');
} else {
- $nogradestr = $this->get_lang_string('nooutcome', 'grades');
+ $nogradestr = $this->get_lang_string('nooutcome', 'grades');
}
$studentshtml .= '<input type="hidden" name="oldgrade_'.$userid.'_'
.$item->id.'" value="'.$oldval.'"/>';