2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

98_SVG.pm: set poltEditor input to readonly for readinly .gplot (Forum #126561)

git-svn-id: https://svn.fhem.de/fhem/trunk@25782 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2022-03-05 12:00:08 +00:00
parent 82cc49142d
commit b845a57306

View File

@ -531,7 +531,7 @@ SVG_PEdit($$$$)
$ret .= "<tr class=\"".(($r++&1)?"odd":"even")."\"><td colspan=\"3\">";
$ret .= (exists($conf{readonly}) ?
FW_submit("readonly", '.gplot file is set readonly'):
'<span>.gplot file is "set readonly"</span>' :
FW_submit("submit", "Write .gplot file"))."&nbsp;".
FW_submit("showFileLogData", "Show preprocessed input").
"</td></tr>";
@ -542,6 +542,12 @@ SVG_PEdit($$$$)
if(defined($FW_pos{zoom}) && defined($FW_pos{off})) {
$sl .= "&pos=zoom=$FW_pos{zoom};off=$FW_pos{off}";
}
my $ro="";
if(exists($conf{readonly})) {
$ro = '$("table.plotEditor input").prop("readonly", true);
$("table.plotEditor input[type=checkbox]").prop("disabled", true);
$("table.plotEditor select").prop("disabled", true);';
}
$ret .= <<'EOF';
<script type="text/javascript">
@ -564,6 +570,7 @@ EOF
\$("table.internals div[informid=$gpfEsc-GPLOTFILE]")
.html("<a href='$link'>$gpf</a>");
}, 10);
$ro
</script>
EOF
return $ret;
@ -664,13 +671,6 @@ SVG_WriteGplot($)
FW_digestCgi($arg);
return if($FW_hiddenroom{detail});
if($FW_webArgs{readonly}) {
$FW_RET .=
'<div id="errmsg">'.
"gplot file marked as readonly: won't write!".
'</div>';
return 0;
}
return SVG_showData() if($FW_webArgs{showFileLogData});
if(!defined($FW_webArgs{par_0_0})) {