mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
sub FW_IconURL($) introduced as wrapper to help with icon stuff migration
git-svn-id: https://svn.fhem.de/fhem/trunk@1750 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
724ed8e61e
commit
12081a188e
@ -21,6 +21,7 @@ sub FW_makeEdit($$$);
|
||||
sub FW_makeTable($$@);
|
||||
sub FW_ReadIconsFrom($$);
|
||||
sub FW_ReadIcons();
|
||||
sub FW_IconURL($);
|
||||
sub FW_roomOverview($);
|
||||
sub FW_select($$$$@);
|
||||
sub FW_showLog($);
|
||||
@ -2060,6 +2061,10 @@ FW_ReadIcons()
|
||||
#}
|
||||
}
|
||||
|
||||
# returns the physical path relative to $FW_icondir for the logical path
|
||||
# examples:
|
||||
# FS20.on -> dark/FS20.on.png
|
||||
# weather/sunny -> default/weather/sunny.gif
|
||||
sub
|
||||
FW_getIcon($) {
|
||||
my ($name)= @_;
|
||||
@ -2067,6 +2072,16 @@ FW_getIcon($) {
|
||||
return $FW_icons{$icon} ? $icon : undef;
|
||||
}
|
||||
|
||||
# returns the URL for the logical path
|
||||
# examples:
|
||||
# FS20.on -> /icons/FS20.on
|
||||
# weather/sunny -> /icons/sunny
|
||||
sub FW_IconURL($) {
|
||||
my ($name)= @_;
|
||||
$name =~ s/\.(png)$//; # FIXME
|
||||
return "$FW_ME/icons/${name}.png"; # FIXME
|
||||
}
|
||||
|
||||
|
||||
sub
|
||||
FW_dev2image($)
|
||||
@ -2257,8 +2272,7 @@ FW_devState($$)
|
||||
my $icon;
|
||||
$icon = FW_dev2image($d);
|
||||
#Debug "Dev2Image returned $icon for $d";
|
||||
$txt = "<img src=\"$FW_ME/icons/$icon\" alt=\"$txt\"/>"
|
||||
if($icon);
|
||||
$txt = "<img src=\"" . FW_IconURL($icon) . "\" alt=\"$txt\"/>" if($icon);
|
||||
}
|
||||
|
||||
$txt = "<div id=\"$d\" align=\"center\" class=\"col2\">$txt</div>";
|
||||
|
Loading…
Reference in New Issue
Block a user