Allowed optional path usage in set_icon parameter
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 27 Sep 2010 09:43:01 +0000 (09:43 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 27 Sep 2010 09:43:01 +0000 (09:43 +0000)
includes/ui/ui_input.inc

index 272d515b9965283b1770fc8ce02f65ba077b0b00..1e29770487deff359a401b9349dbb170cbc89398 100644 (file)
@@ -257,7 +257,9 @@ function submit_js_confirm($name, $msg) {
 function set_icon($icon, $title=false)
 {
        global $path_to_root;
-       return "<img src='$path_to_root/themes/".user_theme()."/images/$icon' width='12' height='12' border='0'".($title ? " title='$title'" : "")." />\n";     
+       if (basename($icon) === $icon) // standard icons does not contain path separator
+               $icon = "$path_to_root/themes/".user_theme()."/images/$icon";
+       return "<img src='$icon' width='12' height='12' border='0'".($title ? " title='$title'" : "")." />\n";  
 }
 
 function button($name, $value, $title=false, $icon=false,  $aspect='')