MDL-21676 user: minor gravatar fixes
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ class user_edit_form extends moodleform {
|
||||
if (!empty($CFG->gdversion)) {
|
||||
$context = get_context_instance(CONTEXT_USER, $user->id, MUST_EXIST);
|
||||
$fs = get_file_storage();
|
||||
$hasuploadedpicture = (!$fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.png') && !$fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.jpg'));
|
||||
$hasuploadedpicture = ($fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.png') || $fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.jpg'));
|
||||
if (!empty($user->picture) && $hasuploadedpicture) {
|
||||
$imagevalue = $OUTPUT->user_picture($user, array('courseid' => SITEID, 'size'=>64));
|
||||
} else {
|
||||
|
||||
@@ -104,7 +104,7 @@ class user_editadvanced_form extends moodleform {
|
||||
if ($user) {
|
||||
$context = get_context_instance(CONTEXT_USER, $user->id, MUST_EXIST);
|
||||
$fs = get_file_storage();
|
||||
$hasuploadedpicture = (!$fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.png') && !$fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.jpg'));
|
||||
$hasuploadedpicture = ($fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.png') || $fs->file_exists($context->id, 'user', 'icon', 0, '/', 'f2.jpg'));
|
||||
if (!empty($user->picture) && $hasuploadedpicture) {
|
||||
$imagevalue = $OUTPUT->user_picture($user, array('courseid' => SITEID, 'size'=>64));
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ function useredit_shared_definition(&$mform, $editoroptions = null) {
|
||||
$mform->addElement('header', 'moodle_picture', get_string('pictureofuser'));
|
||||
|
||||
if (!empty($CFG->enablegravatar)) {
|
||||
$mform->addElement('static', 'gravatarenabled', get_string('gravatarenabled'));
|
||||
$mform->addElement('html', html_writer::tag('p', get_string('gravatarenabled')));
|
||||
}
|
||||
|
||||
$mform->addElement('static', 'currentpicture', get_string('currentpicture'));
|
||||
|
||||
Reference in New Issue
Block a user