mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-17 05:16:02 +00:00
01_FHEMWEB: nameDisplay variable names changed (Forum #37379)
git-svn-id: https://svn.fhem.de/fhem/trunk@8618 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7a3c9a40aa
commit
e54c6addd4
@ -1399,7 +1399,10 @@ FW_showRoom()
|
||||
|
||||
FW_pF "\n<tr class=\"%s\">", ($row&1)?"odd":"even";
|
||||
my $devName = AttrVal($d, "alias", $d);
|
||||
$devName = eval $nameDisplay if(defined($nameDisplay));
|
||||
if(defined($nameDisplay)) {
|
||||
my ($DEVICE, $ALIAS) = ($d, $devName);
|
||||
$devName = eval $nameDisplay;
|
||||
}
|
||||
my $icon = AttrVal($d, "icon", "");
|
||||
$icon = FW_makeImage($icon,$icon,"icon") . " " if($icon);
|
||||
|
||||
@ -3006,11 +3009,11 @@ FW_widgetOverride($$)
|
||||
<a name="nameDisplay"></a>
|
||||
<li>nameDisplay<br>
|
||||
The argument is perl code, which is executed for each single device in
|
||||
the room to determine the name displayed. $d is the name of the current
|
||||
device, and $devName is the value of the alias attribute or the name of
|
||||
the device, if no alias is set. E.g. you can add a a global userattr
|
||||
named alias_hu for the Hungarian translation, and specify nameDisplay
|
||||
for the hungarian FHEMWEB instance as
|
||||
the room to determine the name displayed. $DEVICE is the name of the
|
||||
current device, and $ALIAS is the value of the alias attribute or the
|
||||
name of the device, if no alias is set. E.g. you can add a a global
|
||||
userattr named alias_hu for the Hungarian translation, and specify
|
||||
nameDisplay for the hungarian FHEMWEB instance as
|
||||
<ul>
|
||||
AttrVal($d, "alias_hu", $devName)
|
||||
</ul>
|
||||
@ -3679,15 +3682,16 @@ FW_widgetOverride($$)
|
||||
Komma getrennte Liste; diese Links werden im linken Menü angezeigt.
|
||||
Beispiel:<br>
|
||||
attr WEB menuEntries fhem.de,http://fhem.de,culfw.de,http://culfw.de<br>
|
||||
attr WEB menuEntries AlarmOn,http://fhemhost:8083/fhem?cmd=set%20alarm%20on<br>
|
||||
attr WEB menuEntries
|
||||
AlarmOn,http://fhemhost:8083/fhem?cmd=set%20alarm%20on<br>
|
||||
</li><br>
|
||||
|
||||
<a name="nameDisplay"></a>
|
||||
<li>nameDisplay<br>
|
||||
Das Argument ist Perl-Code, was für jedes Gerät in der
|
||||
Raum-Übersicht ausgeführt wird, um den angezeigten Namen zu
|
||||
berechnen. Dabei kann man die Variable $d für den aktuellen
|
||||
Gerätenamen, und $devName für den aktuellen alias bzw. Name,
|
||||
berechnen. Dabei kann man die Variable $DEVICE für den aktuellen
|
||||
Gerätenamen, und $ALIAS für den aktuellen alias bzw. Name,
|
||||
falls alias nicht gesetzt ist, verwenden. Z.Bsp. für eine FHEMWEB
|
||||
Instanz mit ungarischer Anzeige fügt man ein global userattr
|
||||
alias_hu hinzu, und man setzt nameDisplay für diese FHEMWEB
|
||||
|
Loading…
x
Reference in New Issue
Block a user