mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-13787 Updated get_pref() so that it looks up a short version of the config variable (grade_ instead of grade_report_) in case the first isn't set. It also returns null if no variable is found. Merging from MOODLE_19_STABLE
This commit is contained in:
parent
037a40f7dd
commit
54294d3b09
@ -170,14 +170,19 @@ class grade_report {
|
||||
function get_pref($pref, $objectid=null) {
|
||||
global $CFG;
|
||||
$fullprefname = 'grade_report_' . $pref;
|
||||
$shortprefname = 'grade_' . $pref;
|
||||
|
||||
$retval = null;
|
||||
|
||||
if (!isset($this) OR get_class($this) != 'grade_report') {
|
||||
if (!empty($objectid)) {
|
||||
$retval = get_user_preferences($fullprefname . $objectid, grade_report::get_pref($pref));
|
||||
} else {
|
||||
} elseif (isset($CFG->$fullprefname)) {
|
||||
$retval = get_user_preferences($fullprefname, $CFG->$fullprefname);
|
||||
} elseif (isset($CFG->$shortprefname)) {
|
||||
$retval = get_user_preferences($fullprefname, $CFG->$shortprefname);
|
||||
} else {
|
||||
$retval = null;
|
||||
}
|
||||
} else {
|
||||
if (empty($this->prefs[$pref.$objectid])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user