From: moodler
Date: Mon, 28 Jul 2003 11:42:53 +0000 (+0000)
Subject: Cleaned up the remaining images:
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=67a63a306021138d877751d0fca588460e45c58c;p=moodle.git
Cleaned up the remaining images:
- moved user images to /pix/u folder, and changed format to .png to allow
transparent images etc. These can now be customised in themes.
- removed legacy madewithmoodle logos
---
diff --git a/lib/weblib.php b/lib/weblib.php
index e87e53ea64..f00c7e86fe 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -718,7 +718,7 @@ function print_footer ($course=NULL) {
if ($course) {
if ($course == "home") { // special case for site home page - please do not remove
$homelink = "release ($CFG->version)\" href=\"http://moodle.org/\" target=\"_blank\">";
- $homelink .= "

";
+ $homelink .= "

";
$course = get_site();
$homepage = true;
} else {
@@ -873,7 +873,7 @@ function print_file_picture($path, $courseid=0, $height="", $width="", $link="")
}
function print_user_picture($userid, $courseid, $picture, $large=false, $returnstring=false, $link=true) {
- global $CFG;
+ global $CFG, $THEME;
if ($link) {
$output = "wwwroot/user/view.php?id=$userid&course=$courseid\">";
@@ -881,20 +881,29 @@ function print_user_picture($userid, $courseid, $picture, $large=false, $returns
$output = "";
}
if ($large) {
- $file = "f1.jpg";
+ $file = "f1";
$size = 100;
} else {
- $file = "f2.jpg";
+ $file = "f2";
$size = 35;
}
- if ($picture) {
+ if ($picture) { // Print custom user picture
if ($CFG->slasharguments) { // Use this method if possible for better caching
- $output .= "
wwwroot/user/pix.php/$userid/$file\" border=0 width=$size height=$size alt=\"\">";
+ $output .= "
wwwroot/user/pix.php/$userid/$file.jpg\"".
+ " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
} else {
- $output .= "
wwwroot/user/pix.php?file=/$userid/$file\" border=0 width=$size height=$size alt=\"\">";
+ $output .= "
wwwroot/user/pix.php?file=/$userid/$file.jpg\"".
+ " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
}
- } else {
- $output .= "
wwwroot/user/default/$file\" border=0 width=$size height=$size alt=\"\">";
+ } else { // Print default user pictures (use theme version if available)
+ if (empty($THEME->custompix)) {
+ $output .= "
wwwroot/pix/u/$file.png\"".
+ " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
+ } else {
+ $output .= "
wwwroot/theme/$CFG->theme/pix/u/$file.png\"".
+ " border=\"0\" width=\"$size\" height=\"$size\" alt=\"\">";
+ }
+
}
if ($link) {
$output .= "";
diff --git a/pix/madewithmoodle2.gif b/pix/madewithmoodle2.gif
deleted file mode 100644
index e19dda39fd..0000000000
Binary files a/pix/madewithmoodle2.gif and /dev/null differ
diff --git a/pix/madewithmoodle3.gif b/pix/madewithmoodle3.gif
deleted file mode 100755
index 07a775485f..0000000000
Binary files a/pix/madewithmoodle3.gif and /dev/null differ
diff --git a/pix/u/f1.png b/pix/u/f1.png
new file mode 100755
index 0000000000..38a75495e3
Binary files /dev/null and b/pix/u/f1.png differ
diff --git a/pix/u/f2.png b/pix/u/f2.png
new file mode 100755
index 0000000000..f9f69d751b
Binary files /dev/null and b/pix/u/f2.png differ
diff --git a/theme/cordoroyblue/pix/u/f1.png b/theme/cordoroyblue/pix/u/f1.png
new file mode 100755
index 0000000000..38a75495e3
Binary files /dev/null and b/theme/cordoroyblue/pix/u/f1.png differ
diff --git a/theme/cordoroyblue/pix/u/f2.png b/theme/cordoroyblue/pix/u/f2.png
new file mode 100755
index 0000000000..f9f69d751b
Binary files /dev/null and b/theme/cordoroyblue/pix/u/f2.png differ
diff --git a/user/default/f1.jpg b/user/default/f1.jpg
deleted file mode 100755
index bf2b1772d8..0000000000
Binary files a/user/default/f1.jpg and /dev/null differ
diff --git a/user/default/f2.jpg b/user/default/f2.jpg
deleted file mode 100755
index 5580c6579b..0000000000
Binary files a/user/default/f2.jpg and /dev/null differ
diff --git a/user/pix.php b/user/pix.php
index fd06d3c40a..073ba4c6e9 100644
--- a/user/pix.php
+++ b/user/pix.php
@@ -24,8 +24,10 @@
$userid = (integer)$args[0];
$image = $args[1];
$pathname = "$CFG->dataroot/users/$userid/$image";
+ $filetype = "image/jpeg";
} else {
- $pathname = "$CFG->dirroot/user/default/f1.jpg";
+ $pathname = "$CFG->dirroot/pix/u/f1.png";
+ $filetype = "image/png";
}
$lastmodified = filemtime($pathname);
@@ -37,7 +39,7 @@
header("Pragma: ");
header("Content-disposition: inline; filename=$image");
header("Content-length: ".filesize($pathname));
- header("Content-type: image/jpeg");
+ header("Content-type: $filetype");
readfile("$pathname");
}