summaryrefslogtreecommitdiffstats
path: root/lib/ui.lib.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-19 08:36:56 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-19 08:36:56 +0000
commit988f2a92ec9ad57d281e574da457638d1dcc8171 (patch)
treeb20b3e42d0e1e882a01bda0fa38f4b02b32f15dc /lib/ui.lib.php
parent70df9d795a112c52fede9a3f86c0dc7f889a6326 (diff)
downloadampache-988f2a92ec9ad57d281e574da457638d1dcc8171.tar.gz
ampache-988f2a92ec9ad57d281e574da457638d1dcc8171.tar.bz2
ampache-988f2a92ec9ad57d281e574da457638d1dcc8171.zip
new icons
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r--lib/ui.lib.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 4f8cb3aa..169ce48b 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -1273,10 +1273,11 @@ function show_box_bottom() {
* this function takes a name and a returns either a text representation
* or an <img /> tag
*/
-function get_user_icon($name) {
+function get_user_icon($name,$hover_name='') {
$icon_name = 'icon_' . $name . '.png';
+ /* Build the image url */
if (file_exists(conf('prefix') . '/themes/' . $GLOBALS['theme']['path'] . '/images/' . $icon_name)) {
$img_url = conf('web_path') . conf('theme_path') . '/images/' . $icon_name;
}
@@ -1284,7 +1285,20 @@ function get_user_icon($name) {
$img_url = conf('web_path') . '/images/' . $icon_name;
}
- $string = "<img style=\"cursor: pointer;\" src=\"$img_url\" border=\"0\" alt=\"$name\" title=\"$name\" />";
+ /* If Hover, then build its url */
+ if (!empty($hover_name)) {
+ $hover_icon = 'icon_' . $hover_name . '.png';
+ if (file_exists(conf('prefix') . '/themes/' . $GLOBALS['theme']['path'] . '/images/' . $icon_name)) {
+ $hov_url = conf('web_path') . conf('theme_path') . '/images/' . $hover_icon;
+ }
+ else {
+ $hov_url = conf('web_path') . '/images/' . $hover_icon;
+ }
+
+ $hov_txt = "onMouseOver=\"this.src='$hov_url'; return true;\" onMouseOut=\"this.src='$img_url'; return true;\"";
+ }
+
+ $string = "<img style=\"cursor: pointer;\" src=\"$img_url\" border=\"0\" alt=\"$name\" title=\"$name\" $hov_txt/>";
return $string;