2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

01_FHEMWEB.pm: add $NAME to the sortby evaluation (Forum #59883)

git-svn-id: https://svn.fhem.de/fhem/trunk@13379 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-02-10 19:57:00 +00:00
parent 82e04ecbf4
commit 9f92772f80

View File

@ -1698,7 +1698,12 @@ FW_sortIndex($)
my $val = $attr{$d}{sortby}; my $val = $attr{$d}{sortby};
if($val) { if($val) {
return $val =~ m/^{.*}/ ? AnalyzePerlCommand($FW_chash, $val) : lc($val); if($val =~ m/^{.*}/) {
my %specials=("%NAME" => $d);
my $exec = EvalSpecials($val, %specials);
return AnalyzePerlCommand($FW_chash, $exec);
}
return lc($val);
} }
if($FW_room) { if($FW_room) {
@ -3663,7 +3668,7 @@ FW_widgetOverride($$)
Take the value of this attribute when sorting the devices in the room Take the value of this attribute when sorting the devices in the room
overview instead of the alias, or if that is missing the devicename overview instead of the alias, or if that is missing the devicename
itself. If the sortby value is enclosed in {} than it is evaluated as a itself. If the sortby value is enclosed in {} than it is evaluated as a
perl expression. perl expression. $NAME is set to the device name.
</li> </li>
<br> <br>
@ -4394,7 +4399,7 @@ FW_widgetOverride($$)
R&auml;umen verwendet, sonst w&auml;re es der Alias oder, wenn keiner R&auml;umen verwendet, sonst w&auml;re es der Alias oder, wenn keiner
da ist, der Ger&auml;tename selbst. Falls der Wert des sortby da ist, der Ger&auml;tename selbst. Falls der Wert des sortby
Attributes in {} eingeschlossen ist, dann wird er als ein perl Ausdruck Attributes in {} eingeschlossen ist, dann wird er als ein perl Ausdruck
evaluiert. evaluiert. $NAME wird auf dem Ger&auml;tenamen gesetzt.
</li><br> </li><br>
<a name="showUsedFiles"></a> <a name="showUsedFiles"></a>