fp_setbutton patch for FLOORPLAN from Ulli

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3222 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2013-05-27 09:29:21 +00:00
parent b1fe8b91fc
commit d9d6735c96

View File

@@ -2532,13 +2532,23 @@ FW_dropdownFn()
$txt = Value($d);
$txt =~ s/$cmd //;
}
my $fpname = $FW_wname;
$fpname =~ s/.*floorplan\/(\w+)$/$1/; #allow usage of attr fp_setbutton
my $fwsel;
if(AttrVal($fpname,'fp_setbutton',1)) {
$fwsel = FW_select("$d-$cmd","val.$d", \@tv, $txt, "dropdown").
FW_submit("cmd.$d", "set");
} else {
$fwsel = FW_select("$d-$cmd","val.$d", \@tv, $txt,"dropdown","submit()").
FW_hidden("cmd.$d", "set");
}
return "<td colspan='2'><form>".
FW_hidden("arg.$d", $cmd) .
FW_hidden("dev.$d", $d) .
($FW_room ? FW_hidden("room", $FW_room) : "") .
FW_select("$d-$cmd","val.$d", \@tv, $txt, "dropdown").
FW_submit("cmd.$d", "set").
"</form></td>";
"$fwsel</form></td>";
}
return undef;
}