2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

98_help.pm: add support for "help global"

git-svn-id: https://svn.fhem.de/fhem/trunk@8045 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2015-02-20 16:50:20 +00:00
parent 06fa9ef3de
commit 6a2c2a8af3
3 changed files with 61 additions and 33 deletions

View File

@ -21,10 +21,15 @@ sub CommandHelp {
$lang = (lc($lang) eq 'de') ? '_DE' : '';
if($mod) {
$mod = lc($mod);
my %mods;
my $modPath = AttrVal('global','modpath','.');
my $output = "";
if($mod ne 'global') {
my %mods;
my @modDir = ("$modPath/FHEM");
foreach my $modDir (@modDir) {
opendir(DH, $modDir) || die "Cant open $modDir: $!\n";
while(my $l = readdir DH) {
@ -38,7 +43,6 @@ sub CommandHelp {
return "Module $mod not found" unless defined($mods{$mod});
my $output = "";
my $skip = 1;
my ($err,@text) = FileRead({FileName => $mods{$mod}, ForceType => 'file'});
return $err if $err;
@ -52,6 +56,27 @@ sub CommandHelp {
}
}
} else {
$output = '';
my $i;
my $f = "$modPath/docs/commandref_frame$lang.html";
my $skip = 1;
my ($err,@text) = FileRead({FileName => $f, ForceType => 'file'});
return $err if $err;
foreach my $l (@text) {
if($l =~ m/name=.global./) {
$skip = 0;
} elsif($l =~ m/^<!-- global.end/) {
$skip = 1;
} elsif (!$skip) {
$output .= $l;
}
}
}
$output = "Keine deutsche Hilfe gefunden!\n\n".
CommandHelp(undef, "$mod en") unless $output;
@ -86,7 +111,7 @@ sub CommandHelp {
return "<html>$output</html>";
} else {
} else { # mod
my $str = "\n" .
"Possible commands:\n\n" .

View File

@ -1413,7 +1413,7 @@ The following local attributes are used by a wider range of devices:
hidden, and will only be visible, if this attribute is set to 1.
The attribute is checked by the list command, by the FHEMWEB room
overview and by xmllist.
</li>
</li><br/>
<a name="stacktrace"></a>
<li>stacktrace<br>
@ -1421,6 +1421,8 @@ The following local attributes are used by a wider range of devices:
</li>
</ul>
</ul>
<!-- global end - do not remove this line! -->
<a name="perl"></a>
<h3>Perl specials</h3>

View File

@ -1501,7 +1501,7 @@ Die folgenden lokalen Attribute werden von mehreren Ger&auml;ten verwendet:
werden nicht angezeigt, es sei denn das globale Attribut
showInternalValues ist gesetzt. Diese Variable wird bei dem list und
xmllist Befehl, und bei der FHEMWEB Raumansicht gepr&uuml;ft.
</li>
</li><br/>
<a name="stacktrace"></a>
<li>stacktrace<br>
@ -1510,6 +1510,7 @@ Die folgenden lokalen Attribute werden von mehreren Ger&auml;ten verwendet:
</li>
</ul>
</ul>
<!-- global end - diese Zeile nicht entfernen! -->
<a name="perl"></a>