diff --git a/CHANGED b/CHANGED index 29badb9c8..dc037af8b 100644 --- a/CHANGED +++ b/CHANGED @@ -15,6 +15,7 @@ - feature: CUL_TX minsecs attribute (by Arno) - feature: webCmd in smallScreen added - feature: TRX modules by Willi + - feature: FHEMWEB icons (by Joerg) - 2011-12-31 (5.2) - bugfix: applying smallscreen attributes to firefox/opera diff --git a/docs/commandref.html b/docs/commandref.html index f7acd4134..987897f57 100644 --- a/docs/commandref.html +++ b/docs/commandref.html @@ -7665,6 +7665,14 @@ AB600, Duewi, DomiaLite, COCO) and others.

+ +
  • icon
    + Set the icon for a device in the room overview. There is an + icon-chooser in FHEMWEB to ease this task. Setting icons for the room + itself is indirect: there must exist an icon with the name + ico.png in the modpath/fwmodpath directory. +
  • +
    diff --git a/webfrontend/pgm2/01_FHEMWEB.pm b/webfrontend/pgm2/01_FHEMWEB.pm index 978bc032c..15636ee28 100755 --- a/webfrontend/pgm2/01_FHEMWEB.pm +++ b/webfrontend/pgm2/01_FHEMWEB.pm @@ -100,6 +100,7 @@ FHEMWEB_Initialize($) %FW_zoom = map { $_, $n++ } @FW_zoom; addToAttrList("webCmd"); + addToAttrList("icon"); } ##################################### @@ -660,7 +661,7 @@ FW_makeSelect($$$$) { my ($d, $cmd, $list,$class) = @_; return if(!$list || $FW_hiddenroom{input}); - my @al = map { s/[:;].*//;$_ } split(" ", $list); + my @al = sort map { s/[:;].*//;$_ } split(" ", $list); FW_pO "
    "; FW_pO FW_hidden("detail", $d); @@ -712,9 +713,12 @@ FW_doDetail($) FW_pO ""; - FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE}, 1) if($t eq "weblink"); + if($t eq "weblink") { + FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE}, 1); + FW_pO "

    "; + } - FW_pO "

    "; + FW_pH "cmd=style iconFor $d", "Select icon"; FW_pH "$FW_reldoc#${t}", "Device specific help"; FW_pO "

    "; FW_pO ""; @@ -832,6 +836,7 @@ FW_roomOverview($) } else { + FW_ReadIcons(); foreach(my $idx = 0; $idx < @list1; $idx++) { my ($l1, $l2) = ($list1[$idx], $list2[$idx]); if(!$l1) { @@ -840,10 +845,14 @@ FW_roomOverview($) if($idx", $l1 eq $FW_room ? " class=\"sel\"" : ""; + my $icon = ""; + $icon = " " + if($FW_icons{"ico$l1"}); + if($l2 =~ m/.html$/ || $l2 =~ m/^http/) { - FW_pO "$l1"; + FW_pO "$icon$l1"; } else { - FW_pH $l2, $l1, 1; + FW_pH $l2, "$icon$l1", 1; } FW_pO ""; } @@ -857,12 +866,19 @@ FW_roomOverview($) ######################## # Show the overview of devices in one room - -# API v1.0 sub -FW_showRoom1($) { - my $rf= shift; +FW_showRoom() +{ + return if(!$FW_room); + # (re-) list the icons + FW_ReadIcons(); + + FW_pO ""; + FW_pO "
    "; + FW_pO ""; # Need for equal width of subtables + + my $rf = ($FW_room ? "&room=$FW_room" : ""); # stay in the room my $row=1; foreach my $type (sort keys %FW_types) { @@ -884,14 +900,14 @@ FW_showRoom1($) { pF "\n", ($row&1)?"odd":"even"; my $devName = AttrVal($d, "alias", $d); + my $icon = AttrVal($d, "icon", ""); + $icon = " " if($icon); + if($FW_hiddenroom{detail}) { - FW_pO ""; - + FW_pO ""; } else { - FW_pH "detail=$d", $devName, 1, "col1"; - + FW_pH "detail=$d", "$icon$devName", 1, "col1"; } - $row++; my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf); @@ -930,39 +946,6 @@ FW_showRoom1($) { } FW_pO "
    $devName
    $icon$devName

    "; -} - -# API v1.0 -sub -FW_showRoom2($) { - my $rf= shift; - FW_pO "API v2

    "; -} - - - -sub -FW_showRoom() -{ - return if(!$FW_room); - - # (re-) list the icons - FW_ReadIcons(); - - FW_pO ""; - FW_pO "

    "; - FW_pO ""; # Need for equal width of subtables - - my $rf = ($FW_room ? "&room=$FW_room" : ""); # stay in the room - - my $apiversion= AttrVal("global", "apiversion", 1); - if($apiversion==1) { - FW_showRoom1($rf); - } else { - FW_showRoom2($rf); - }; - - # Now the weblinks my $buttons = 1; my @list = ($FW_room eq "all" ? keys %defs : keys %{$FW_rooms{$FW_room}}); @@ -1580,6 +1563,19 @@ FW_style($$) $ret = ($ret ? "

    ERROR:

    $ret" : "Saved the file $fName"); FW_style("style list", $ret); $ret = ""; + + } elsif($a[1] eq "iconFor") { + FW_ReadIcons(); + FW_pO "
    "; + foreach my $i (sort grep {/^ico/} keys %FW_icons) { + FW_pO ""; + } + FW_pO "
    "; + FW_pO "$i"; + FW_pO ""; + FW_pO ""; + FW_pO "
    "; + } } diff --git a/webfrontend/pgm2/darkstyle.css b/webfrontend/pgm2/darkstyle.css index 630a1624d..0d7766257 100644 --- a/webfrontend/pgm2/darkstyle.css +++ b/webfrontend/pgm2/darkstyle.css @@ -32,7 +32,7 @@ right:10px; } body>div#left { position:fixed; } div#block { border:1px solid gray; background: #F8F8E0; padding:0.7em; } div#dist { padding-top:0.3em; } -h2,h3,h4 { color:#EEE; line-height:1.3; margin-top:1.5em; -font-family:Verdana; } +h2,h3,h4 { color:#EEE; line-height:1.3; margin-top:1.5em; font-family:Verdana; } select.attr,input.attr,select.set,input.set { margin-bottom:10px; } +a img { border-style:none; } diff --git a/webfrontend/pgm2/icoAUSSEN.png b/webfrontend/pgm2/icoAUSSEN.png new file mode 100644 index 000000000..4abfd2e42 Binary files /dev/null and b/webfrontend/pgm2/icoAUSSEN.png differ diff --git a/webfrontend/pgm2/icoAUSSENBEREICH.png b/webfrontend/pgm2/icoAUSSENBEREICH.png new file mode 100644 index 000000000..21ca82ce8 Binary files /dev/null and b/webfrontend/pgm2/icoAUSSENBEREICH.png differ diff --git a/webfrontend/pgm2/icoBELEUCHTUNG.png b/webfrontend/pgm2/icoBELEUCHTUNG.png new file mode 100644 index 000000000..7490c9df7 Binary files /dev/null and b/webfrontend/pgm2/icoBELEUCHTUNG.png differ diff --git a/webfrontend/pgm2/icoBaum.png b/webfrontend/pgm2/icoBaum.png new file mode 100644 index 000000000..4abfd2e42 Binary files /dev/null and b/webfrontend/pgm2/icoBaum.png differ diff --git a/webfrontend/pgm2/icoBlitz.png b/webfrontend/pgm2/icoBlitz.png new file mode 100644 index 000000000..8ee4cc2a6 Binary files /dev/null and b/webfrontend/pgm2/icoBlitz.png differ diff --git a/webfrontend/pgm2/icoEverything.png b/webfrontend/pgm2/icoEverything.png new file mode 100644 index 000000000..1c079ff59 Binary files /dev/null and b/webfrontend/pgm2/icoEverything.png differ diff --git a/webfrontend/pgm2/icoGraph.png b/webfrontend/pgm2/icoGraph.png new file mode 100644 index 000000000..7e14d864e Binary files /dev/null and b/webfrontend/pgm2/icoGraph.png differ diff --git a/webfrontend/pgm2/icoHEIZUNG.png b/webfrontend/pgm2/icoHEIZUNG.png new file mode 100644 index 000000000..f1533dd1d Binary files /dev/null and b/webfrontend/pgm2/icoHEIZUNG.png differ diff --git a/webfrontend/pgm2/icoHISTORIE.png b/webfrontend/pgm2/icoHISTORIE.png new file mode 100644 index 000000000..7e14d864e Binary files /dev/null and b/webfrontend/pgm2/icoHISTORIE.png differ diff --git a/webfrontend/pgm2/icoHaus.png b/webfrontend/pgm2/icoHaus.png new file mode 100644 index 000000000..30036358c Binary files /dev/null and b/webfrontend/pgm2/icoHaus.png differ diff --git a/webfrontend/pgm2/icoHeizungAn.png b/webfrontend/pgm2/icoHeizungAn.png new file mode 100644 index 000000000..033cedaed Binary files /dev/null and b/webfrontend/pgm2/icoHeizungAn.png differ diff --git a/webfrontend/pgm2/icoHeizungReg.png b/webfrontend/pgm2/icoHeizungReg.png new file mode 100644 index 000000000..562e4f30f Binary files /dev/null and b/webfrontend/pgm2/icoHeizungReg.png differ diff --git a/webfrontend/pgm2/icoHouse.png b/webfrontend/pgm2/icoHouse.png new file mode 100644 index 000000000..21ca82ce8 Binary files /dev/null and b/webfrontend/pgm2/icoHouse.png differ diff --git a/webfrontend/pgm2/icoKLIMA.png b/webfrontend/pgm2/icoKLIMA.png new file mode 100644 index 000000000..f89a1ebfd Binary files /dev/null and b/webfrontend/pgm2/icoKLIMA.png differ diff --git a/webfrontend/pgm2/icoLicht.png b/webfrontend/pgm2/icoLicht.png new file mode 100644 index 000000000..7490c9df7 Binary files /dev/null and b/webfrontend/pgm2/icoLicht.png differ diff --git a/webfrontend/pgm2/icoLichtBaum.png b/webfrontend/pgm2/icoLichtBaum.png new file mode 100644 index 000000000..4e39706b0 Binary files /dev/null and b/webfrontend/pgm2/icoLichtBaum.png differ diff --git a/webfrontend/pgm2/icoLichtHaus.png b/webfrontend/pgm2/icoLichtHaus.png new file mode 100644 index 000000000..788e478ef Binary files /dev/null and b/webfrontend/pgm2/icoLichtHaus.png differ diff --git a/webfrontend/pgm2/icoLog.png b/webfrontend/pgm2/icoLog.png new file mode 100644 index 000000000..d230daf0c Binary files /dev/null and b/webfrontend/pgm2/icoLog.png differ diff --git a/webfrontend/pgm2/icoMail.png b/webfrontend/pgm2/icoMail.png new file mode 100644 index 000000000..ecc1a19fa Binary files /dev/null and b/webfrontend/pgm2/icoMail.png differ diff --git a/webfrontend/pgm2/icoPfeil.png b/webfrontend/pgm2/icoPfeil.png new file mode 100644 index 000000000..0296c018d Binary files /dev/null and b/webfrontend/pgm2/icoPfeil.png differ diff --git a/webfrontend/pgm2/icoPirBaum.png b/webfrontend/pgm2/icoPirBaum.png new file mode 100644 index 000000000..37d64a9dc Binary files /dev/null and b/webfrontend/pgm2/icoPirBaum.png differ diff --git a/webfrontend/pgm2/icoSYSTEM.png b/webfrontend/pgm2/icoSYSTEM.png new file mode 100644 index 000000000..02f2b43de Binary files /dev/null and b/webfrontend/pgm2/icoSYSTEM.png differ diff --git a/webfrontend/pgm2/icoTemp.png b/webfrontend/pgm2/icoTemp.png new file mode 100644 index 000000000..f89a1ebfd Binary files /dev/null and b/webfrontend/pgm2/icoTemp.png differ diff --git a/webfrontend/pgm2/icoTempBaum.png b/webfrontend/pgm2/icoTempBaum.png new file mode 100644 index 000000000..5c904b4be Binary files /dev/null and b/webfrontend/pgm2/icoTempBaum.png differ diff --git a/webfrontend/pgm2/icoTempHausEG.png b/webfrontend/pgm2/icoTempHausEG.png new file mode 100644 index 000000000..4bd744d3e Binary files /dev/null and b/webfrontend/pgm2/icoTempHausEG.png differ diff --git a/webfrontend/pgm2/icoTempHausOG.png b/webfrontend/pgm2/icoTempHausOG.png new file mode 100644 index 000000000..ce8efbacf Binary files /dev/null and b/webfrontend/pgm2/icoTempHausOG.png differ diff --git a/webfrontend/pgm2/icoTempHausReg.png b/webfrontend/pgm2/icoTempHausReg.png new file mode 100644 index 000000000..4299570f6 Binary files /dev/null and b/webfrontend/pgm2/icoTempHausReg.png differ diff --git a/webfrontend/pgm2/icoTempHausRegEG.png b/webfrontend/pgm2/icoTempHausRegEG.png new file mode 100644 index 000000000..14c078b8e Binary files /dev/null and b/webfrontend/pgm2/icoTempHausRegEG.png differ diff --git a/webfrontend/pgm2/icoTempHausRegOG.png b/webfrontend/pgm2/icoTempHausRegOG.png new file mode 100644 index 000000000..49ab24057 Binary files /dev/null and b/webfrontend/pgm2/icoTempHausRegOG.png differ diff --git a/webfrontend/pgm2/icoTempHeizung.png b/webfrontend/pgm2/icoTempHeizung.png new file mode 100644 index 000000000..f25ee7aa0 Binary files /dev/null and b/webfrontend/pgm2/icoTempHeizung.png differ diff --git a/webfrontend/pgm2/icoTempWasser.png b/webfrontend/pgm2/icoTempWasser.png new file mode 100644 index 000000000..0b4faa87c Binary files /dev/null and b/webfrontend/pgm2/icoTempWasser.png differ diff --git a/webfrontend/pgm2/icoTermHaus.png b/webfrontend/pgm2/icoTermHaus.png new file mode 100644 index 000000000..b5a0a3713 Binary files /dev/null and b/webfrontend/pgm2/icoTermHaus.png differ diff --git a/webfrontend/pgm2/icoTool.png b/webfrontend/pgm2/icoTool.png new file mode 100644 index 000000000..02f2b43de Binary files /dev/null and b/webfrontend/pgm2/icoTool.png differ diff --git a/webfrontend/pgm2/icoUhr.png b/webfrontend/pgm2/icoUhr.png new file mode 100644 index 000000000..f7bab2bfd Binary files /dev/null and b/webfrontend/pgm2/icoUhr.png differ diff --git a/webfrontend/pgm2/icoWelt.png b/webfrontend/pgm2/icoWelt.png new file mode 100644 index 000000000..1c079ff59 Binary files /dev/null and b/webfrontend/pgm2/icoWelt.png differ diff --git a/webfrontend/pgm2/style.css b/webfrontend/pgm2/style.css index d73804d41..56ca3e45b 100644 --- a/webfrontend/pgm2/style.css +++ b/webfrontend/pgm2/style.css @@ -30,3 +30,4 @@ div#block { border:1px solid gray; background: #F8F8E0; padding:0.7em; } div#dist { padding-top:0.3em; } select.attr,input.attr,select.set,input.set { margin-bottom:5px; } +a img { border-style:none; }