mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'wip-mdl-40400' of git://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
ef5fd5bf40
@ -532,93 +532,17 @@ class grade_report_grader extends grade_report {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds and returns a div with on/off toggles.
|
* @deprecated since Moodle 2.4 as it appears not to be used any more.
|
||||||
* @return string HTML code
|
|
||||||
* @deprecated since 2.4 as it appears not to be used any more.
|
|
||||||
*/
|
*/
|
||||||
public function get_toggles_html() {
|
public function get_toggles_html() {
|
||||||
global $CFG, $USER, $COURSE, $OUTPUT;
|
throw new coding_exception('get_toggles_html() can not be used any more');
|
||||||
debugging('Call to deprecated function grade_report_grader::get_toggles_html().', DEBUG_DEVELOPER);
|
|
||||||
$html = '';
|
|
||||||
if ($USER->gradeediting[$this->courseid]) {
|
|
||||||
if (has_capability('moodle/grade:manage', $this->context) or has_capability('moodle/grade:hide', $this->context)) {
|
|
||||||
$html .= $this->print_toggle('eyecons');
|
|
||||||
}
|
|
||||||
if (has_capability('moodle/grade:manage', $this->context)
|
|
||||||
or has_capability('moodle/grade:lock', $this->context)
|
|
||||||
or has_capability('moodle/grade:unlock', $this->context)) {
|
|
||||||
$html .= $this->print_toggle('locks');
|
|
||||||
}
|
|
||||||
if (has_capability('moodle/grade:manage', $this->context)) {
|
|
||||||
$html .= $this->print_toggle('quickfeedback');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (has_capability('moodle/grade:manage', $this->context)) {
|
|
||||||
$html .= $this->print_toggle('calculations');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->canviewhidden) {
|
|
||||||
$html .= $this->print_toggle('averages');
|
|
||||||
}
|
|
||||||
|
|
||||||
$html .= $this->print_toggle('ranges');
|
|
||||||
if (!empty($CFG->enableoutcomes)) {
|
|
||||||
$html .= $this->print_toggle('nooutcomes');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $OUTPUT->container($html, 'grade-report-toggles');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shortcut function for printing the grader report toggles.
|
* @deprecated since 2.4 as it appears not to be used any more.
|
||||||
* @param string $type The type of toggle
|
*/
|
||||||
* @param bool $return Whether to return the HTML string rather than printing it
|
|
||||||
* @return void
|
|
||||||
* @deprecated since 2.4 as it appears not to be used any more.
|
|
||||||
*/
|
|
||||||
public function print_toggle($type) {
|
public function print_toggle($type) {
|
||||||
global $CFG, $OUTPUT;
|
throw new coding_exception('print_toggle() can not be used any more');
|
||||||
debugging('Call to deprecated function grade_report_grader::print_toggle().', DEBUG_DEVELOPER);
|
|
||||||
$icons = array('eyecons' => 't/hide',
|
|
||||||
'calculations' => 't/calc',
|
|
||||||
'locks' => 't/lock',
|
|
||||||
'averages' => 't/mean',
|
|
||||||
'quickfeedback' => 't/feedback',
|
|
||||||
'nooutcomes' => 't/outcomes');
|
|
||||||
|
|
||||||
$prefname = 'grade_report_show' . $type;
|
|
||||||
|
|
||||||
if (array_key_exists($prefname, $CFG)) {
|
|
||||||
$showpref = get_user_preferences($prefname, $CFG->$prefname);
|
|
||||||
} else {
|
|
||||||
$showpref = get_user_preferences($prefname);
|
|
||||||
}
|
|
||||||
|
|
||||||
$strshow = $this->get_lang_string('show' . $type, 'grades');
|
|
||||||
$strhide = $this->get_lang_string('hide' . $type, 'grades');
|
|
||||||
|
|
||||||
$showhide = 'show';
|
|
||||||
$toggleaction = 1;
|
|
||||||
|
|
||||||
if ($showpref) {
|
|
||||||
$showhide = 'hide';
|
|
||||||
$toggleaction = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (array_key_exists($type, $icons)) {
|
|
||||||
$imagename = $icons[$type];
|
|
||||||
} else {
|
|
||||||
$imagename = "t/$type";
|
|
||||||
}
|
|
||||||
|
|
||||||
$string = ${'str' . $showhide};
|
|
||||||
|
|
||||||
$url = new moodle_url($this->baseurl, array('toggle' => $toggleaction, 'toggle_type' => $type));
|
|
||||||
|
|
||||||
$retval = $OUTPUT->container($OUTPUT->action_icon($url, new pix_icon($imagename, $string))); // TODO: this container looks wrong here
|
|
||||||
|
|
||||||
return $retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
This files describes API changes in /grade/report/*,
|
This files describes API changes in /grade/report/*,
|
||||||
information provided here is intended especially for developers.
|
information provided here is intended especially for developers.
|
||||||
|
|
||||||
|
=== 2.6 ===
|
||||||
|
* grade_report_grader::get_toggles_html() and grade_report_grader::print_toggle()
|
||||||
|
can not be used any more
|
||||||
|
|
||||||
=== 2.3.5, 2.4.2 ===
|
=== 2.3.5, 2.4.2 ===
|
||||||
* class_grade_report::showtotalsifcontainhidden has been switched from a single integer value to an array.
|
* class_grade_report::showtotalsifcontainhidden has been switched from a single integer value to an array.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user