Permalink
Browse files

rolling back some functionality changes I made to user image routine,…

… but

 keeping the clean up of code that makes it clearer what's happening.
  • Loading branch information...
1 parent 8b5e8ea commit 113a79e2b31a9bc3ffd57c62c6276b6602781e1d bawjaws committed Jul 22, 2005
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/weblib.php
View
@@ -2479,7 +2479,6 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring
}
if (empty($size)) {
$file = 'f2';
- $size = 35;
} else if ($size === true or $size == 1) {
$file = 'f1';
$size = 100;
@@ -2488,18 +2487,19 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $returnstring
} else {
$file = 'f2';
}
+ $class = "userpicture";
if ($picture) { // Print custom user picture
if ($CFG->slasharguments) { // Use this method if possible for better caching
- $output .= '<img class="userpicture defaultuserpic" align="middle" src="'. $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg"'.
- ' border="0" width="'. $size .'" height="'. $size .'" alt="" />';
+ $src = $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg"';
} else {
- $output .= '<img class="userpicture defaultuserpic" align="middle" src="'. $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg"'.
- ' border="0" width="'. $size .'" height="'. $size .'" alt="" />';
+ $src = $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg"';
}
} else { // Print default user pictures (use theme version if available)
- $output .= "<img class=\"userpicture defaultuserpic\" align=\"middle\" src=\"$CFG->pixpath/u/$file.png\"".
- " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
+ $class .= " defaultuserpic";
+ $src = "$CFG->pixpath/u/$file.png\"";
}
+ $output .= "<img class=\"$class\" align=\"middle\" src=\"$src".
+ " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\" />";
if ($link) {
$output .= '</a>';
}

0 comments on commit 113a79e

Please sign in to comment.