diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index 8dea9086b..98ea91405 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -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 = "\"$txt\"/" - if($icon); + $txt = "\"$txt\"/" if($icon); } $txt = "
$txt
";