MDL-21198 improved/simplified $OUTPUT->user_picture() + regression fixes, performance fixes and detected performance problems when printing user avatars

This commit is contained in:
Petr Skoda
2009-12-27 19:47:21 +00:00
parent 3405956553
commit 812dbaf7d5
57 changed files with 188 additions and 269 deletions
+2 -8
View File
@@ -396,11 +396,7 @@ EOD;
$user->lastname = $c->lastname;
$user->imagealt = $c->imagealt;
$c->content = format_text($c->content, $c->format);
$userpic = moodle_user_picture::make($user, $this->course->id);
$userpic->link = true;
$userpic->size = 18;
$userpic->alttext = true;
$c->avatar = $OUTPUT->user_picture($userpic);
$c->avatar = $OUTPUT->user_picture($user, array('size'=>18));
if (($USER->id == $c->userid) || !empty($candelete)) {
$c->delete = true;
}
@@ -485,9 +481,7 @@ EOD;
$newcmt->time = userdate($now, get_string('strftimerecent', 'langconfig'));
$newcmt->username = fullname($USER);
$newcmt->content = format_text($newcmt->content);
$userpic = moodle_user_picture::make($USER, $this->course->id);
$userpic->size = 16;
$newcmt->avatar = $OUTPUT->user_picture($userpic);
$newcmt->avatar = $OUTPUT->user_picture($user, array('size'=>16));
return $newcmt;
} else {
throw new comment_exception('dbupdatefailed');