2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

AttrTemplate.pm: enable dialog-input for multiple devices (Forum #123709)

git-svn-id: https://svn.fhem.de/fhem/trunk@25149 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-10-29 20:01:23 +00:00
parent e8325b7524
commit 374008b34a

View File

@ -292,12 +292,12 @@ AttrTemplate_Set($$@)
return
"<html>".
"<input type='hidden' value='set $name attrTemplate $entry'>".
"<p>Specify the unknown parameters for $entry:</p>".
"<p>Specify the unknown parameters for $name/$entry:</p>".
"<table class='block wide'><tr>".
join("</tr><tr>", map {
my @t=split("= with ",$_,2);
"<td>$t[1]</td><td>" .($t[0] =~ m/^RADIO_/ ?
"<input type='radio' name='s' value='$t[0]'>":
"<input type='radio' name='$name.s' value='$t[0]'>":
"<input type='text' name='$t[0]' size='20'></td>")
} @mComm)."</tr></table>".
'<script>
@ -306,10 +306,10 @@ AttrTemplate_Set($$@)
$("#FW_okDialog").parent().find("button").css("display","block");
$("#FW_okDialog").parent().find(".ui-dialog-buttonpane button")
.unbind("click").click(function(){
var cmd;
var cmd = "";
$("#FW_okDialog input").each(function(){
var t=$(this).attr("type");
if(t=="hidden") cmd = $(this).val();
if(t=="hidden")cmd +=";"+$(this).val();
if(t=="text") cmd +=" "+$(this).attr("name")+"="+$(this).val();
if(t=="radio") cmd +=" "+$(this).val()+"="+
($(this).prop("checked") ? 1:0);