From f4841f39d4a73bfe6ed9a21dbce19a75b7c8b4d8 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sun, 15 Jan 2017 19:38:54 +0000 Subject: [PATCH] 01_FHEMWEB.pm: set everywhere same content attributes (Forum #64541) git-svn-id: https://svn.fhem.de/fhem/trunk@13098 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 42 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index d84f9c940..15eaabb07 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -11,6 +11,7 @@ use Time::HiRes qw(gettimeofday); ######################### # Forward declaration sub FW_IconURL($); +sub FW_addContent(;$); sub FW_addToWritebuffer($$@); sub FW_answerCall($); sub FW_dev2image($;$); @@ -976,7 +977,7 @@ FW_answerCall($) $FW_cmdret = "
$FW_cmdret
" if($FW_cmdret =~ m/\n/); } - FW_pO "
"; + FW_addContent(); if($FW_ss) { FW_pO "
$FW_cmdret
"; } else { @@ -1007,7 +1008,7 @@ FW_answerCall($) my $motd = AttrVal("global","motd","none"); if($motd ne "none") { $motd =~ s/\n/
/g; - FW_pO "
$motd
"; + FW_addContent('>$motd"; +} + sub FW_addLinks($) { @@ -1263,10 +1274,7 @@ FW_doDetail($) my $h = $defs{$d}; my $t = $h->{TYPE}; $t = "MISSING" if(!defined($t)); - FW_pO "
"; + FW_addContent(); if($FW_ss) { # FS20MS2 special: on and off, is not the same as toggle my $webCmd = AttrVal($d, "webCmd", undef); @@ -1673,7 +1681,7 @@ FW_showRoom() FW_pO "
"; - FW_pO "
"; + FW_addContent("room='$FW_room'"); FW_pO ""; # Need for equal width of subtables # array of all device names in the room (exception weblinks without group @@ -2010,11 +2018,11 @@ FW_style($$) return if(!Authorized($FW_chash, "cmd", $a[0])); - my $start = "
"; + my $start = '>
" if($msg); $attr{global}{configfile} =~ m,([^/]*)$,; @@ -2045,7 +2053,8 @@ FW_style($$) } elsif($a[1] eq "select") { my @fl = grep { $_ !~ m/(floorplan|dashboard)/ } FW_fileList("$FW_cssdir/.*style.css"); - FW_pO "$start
"; + FW_addContent($start); + FW_pO "
"; my $row = 0; foreach my $file (@fl) { next if($file =~ m/svg_/); @@ -2066,7 +2075,8 @@ FW_style($$) } $FW_styleStamp = time(); $FW_RET =~ s,/style.css\?v=\d+,/style.css?v=$FW_styleStamp,; - FW_pO "${start}Reload the page in the browser.$end"; + FW_addContent($start); + FW_pO "Reload the page in the browser.$end"; } elsif($a[1] eq "edit") { my $fileName = $a[2]; @@ -2077,7 +2087,7 @@ FW_style($$) my $filePath = FW_fileNameToPath($fileName); my($err, @content) = FileRead({FileName=>$filePath, ForceType=>$forceType}); if($err) { - FW_pO "
$err
"; + FW_addContent(">$err"; + FW_addContent(); FW_pO ""; if($readOnly) { FW_pO "You can enable saving this file by setting the editConfig "; @@ -2130,7 +2140,7 @@ FW_style($$) } if($err) { - FW_pO "
$filePath: $!
"; + FW_addContent(">$filePath: $!". ""; - FW_pO "
"; + FW_addContent(); my $filter = $a[2] ? ($a[2] eq "log" ? "global" : $a[2]) : ".*"; FW_pO "Events (Filter: $filter) ". "  FHEM log ". @@ -2193,7 +2203,7 @@ FW_iconTable($$$$) } } - FW_pO "
"; + FW_addContent(); FW_pO ""; if($textfield) { FW_pO "$textfield: ".FW_textfieldv("data",20,"iconTable",".*")."
";