Merge branch 'MDL-68931-master' of git://github.com/rezaies/moodle

This commit is contained in:
Jun Pataleta 2020-06-09 22:53:04 +08:00
commit 1495cf837e
3 changed files with 49 additions and 2 deletions

View file

@ -96,7 +96,7 @@ class core_userfeedback {
public static function should_display_reminder(): bool {
global $CFG;
if ($CFG->enableuserfeedback && isloggedin() && !isguestuser()) {
if (static::can_give_feedback()) {
$give = get_user_preferences('core_userfeedback_give');
$remind = get_user_preferences('core_userfeedback_remind');
@ -145,6 +145,17 @@ class core_userfeedback {
return $url;
}
/**
* Whether the current can give feedback.
*
* @return bool
*/
public static function can_give_feedback(): bool {
global $CFG;
return $CFG->enableuserfeedback && isloggedin() && !isguestuser();
}
/**
* Returns the last major upgrade time
*