From 4761ffd5a7fa52e19af69c957c7bbd3dc1daf8db Mon Sep 17 00:00:00 2001 From: betateilchen Date: Fri, 13 Feb 2015 19:13:29 +0000 Subject: [PATCH] 55_InfoPanel.pm: updated git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7958 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/55_InfoPanel.pm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/55_InfoPanel.pm b/fhem/FHEM/55_InfoPanel.pm index 960cc84a4..1a8dd63a7 100644 --- a/fhem/FHEM/55_InfoPanel.pm +++ b/fhem/FHEM/55_InfoPanel.pm @@ -11,7 +11,7 @@ package main; use strict; use warnings; -#use Data::Dumper; +use Data::Dumper; use feature qw/switch/; use vars qw(%data); @@ -160,8 +160,8 @@ sub btIP_readLayout { foreach my $ll (@layoutfile) { if($ll !~ m/^\@include/) { push(@layout2,$ll); - } else { - my ($cmd, $def)= split("[ \t]+", $ll, 2); + } elsif ($ll =~ m/^\@include/) { + my ($cmd, $def) = split("[ \t]+", $ll, 2); ($err,@include) = FileRead($def) if($def); splice(@layout2,-1,0,@include) unless $err; } @@ -170,6 +170,21 @@ sub btIP_readLayout { @layout2 = undef; $hash->{fhem}{layout} = join("\n",@layoutfile); } + while($hash->{fhem}{layout} =~ m/\@finclude/ ) { + my (@layout2,@include); + foreach my $ll (@layoutfile) { + if($ll !~ m/^\@finclude/) { + push(@layout2,$ll); + } else { + my ($cmd, $def) = split("[ \t]+", $ll, 2); + @include = split("\n",AnalyzePerlCommand(undef,$def)); + splice(@layout2,-1,0,@include); + } + } + @layoutfile = @layout2; + @layout2 = undef; + $hash->{fhem}{layout} = join("\n",@layoutfile); + } $hash->{fhem}{layout} =~ s/\n\n/\n/g; } return; @@ -680,6 +695,7 @@ sub btIP_returnSVG { my ($width,$height)= split(/x/, AttrVal($name,"size","800x600")); my $bgcolor = AnalyzePerlCommand(undef,AttrVal($name,'bgcolor','"000000"')); + $bgcolor = substr($bgcolor,0,6); my $output = ""; our $svg = "";