2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

Revert "98_help.pm: support ModuleName to find help text"

This reverts commit 6c1591ae2b60f28a979a88f668102cfa8e38bc2d.

git-svn-id: https://svn.fhem.de/fhem/trunk@8140 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2015-03-02 19:53:59 +00:00
parent f3d5a4cb4f
commit 219defc0c5

View File

@ -1,4 +1,4 @@
# $Id: 98_help.pm 8129 2015-03-01 20:29:21Z betateilchen $ # $Id$
# #
package main; package main;
use strict; use strict;
@ -37,8 +37,6 @@ sub CommandHelp {
my %mods; my %mods;
my @modDir = ("$modPath/FHEM"); my @modDir = ("$modPath/FHEM");
$mod = $cmds{$mod}{ModuleName} if defined($cmds{$mod}{ModuleName});
foreach my $modDir (@modDir) { foreach my $modDir (@modDir) {
eval { opendir(DH, $modDir); }; # || die "Cant open $modDir: $!\n"; eval { opendir(DH, $modDir); }; # || die "Cant open $modDir: $!\n";
while(my $l = readdir DH) { while(my $l = readdir DH) {
@ -86,6 +84,12 @@ sub CommandHelp {
if( $cl && $cl->{TYPE} eq 'telnet' ) { if( $cl && $cl->{TYPE} eq 'telnet' ) {
$output =~ s/<br>/\n/g; $output =~ s/<br>/\n/g;
$output =~ s/<br\/>/\n/g; $output =~ s/<br\/>/\n/g;
$output =~ s/<table>//g;
$output =~ s/<\/table>//g;
$output =~ s/<t.>//g;
$output =~ s/<\/t.>//g;
$output =~ s/<h.>//g;
$output =~ s/<\/h.>//g;
$output =~ s/<a href.*\/a>//g; $output =~ s/<a href.*\/a>//g;
$output =~ s/<a name.*\/a>//g; $output =~ s/<a name.*\/a>//g;
$output =~ s/<ul>/\n/g; $output =~ s/<ul>/\n/g;
@ -129,8 +133,8 @@ sub CommandHelp {
next if($cl && $cmds{$cmd}{ClientFilter} && next if($cl && $cmds{$cmd}{ClientFilter} &&
$cl->{TYPE} !~ m/$cmds{$cmd}{ClientFilter}/); $cl->{TYPE} !~ m/$cmds{$cmd}{ClientFilter}/);
my @a = split(",", $cmds{$cmd}{Hlp}, 2); my @a = split(",", $cmds{$cmd}{Hlp}, 2);
$a[0] =~ s/</&lt;/g; # $a[0] =~ s/</&lt;/g;
$a[0] =~ s/>/&gt;/g; # $a[0] =~ s/>/&gt;/g;
$a[1] //= ""; $a[1] //= "";
$a[1] = " $a[1]"; $a[1] = " $a[1]";
$a[1] =~ s/</&lt;/g; $a[1] =~ s/</&lt;/g;
@ -140,27 +144,6 @@ sub CommandHelp {
return $str; return $str;
# my $str = "<html><pre>Possible commands:<br/><br/>" .
# "Command Parameter<br/>" .
# " Description<br/>" .
# "----------------------------------------------------------------------<br/>";
#
# for my $cmd (sort keys %cmds) {
# next if(!$cmds{$cmd}{Hlp});
# next if($cl && $cmds{$cmd}{ClientFilter} &&
# $cl->{TYPE} !~ m/$cmds{$cmd}{ClientFilter}/);
# my @a = split(",", $cmds{$cmd}{Hlp}, 2);
# $a[0] =~ s/</&lt;/g;
# $a[0] =~ s/>/&gt;/g;
# $a[1] //= "";
# $a[1] = " $a[1]";
# $a[1] =~ s/</&lt;/g;
# $a[1] =~ s/>/&gt;/g;
# $str .= sprintf("%-15s%-50s<br/>%s<br/>", $cmd, $a[0], $a[1]);
# }
#
# return "$str</pre></html>";
} }
} }