From 988f2a92ec9ad57d281e574da457638d1dcc8171 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Tue, 19 Dec 2006 08:36:56 +0000 Subject: new icons --- lib/ui.lib.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib/ui.lib.php') 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 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 = "\"$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 = "\"$name\""; return $string; -- cgit