forked from webmin/webmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathman-lib.pl
executable file
·50 lines (43 loc) · 972 Bytes
/
man-lib.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# man-lib.pl
BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
if ($module_info{'usermin'}) {
&switch_to_remote_user();
}
$google_host = "www.google.com";
$google_port = 80;
$google_page = "/search";
%access = &get_module_acl();
# Get the paths to perl and perldoc
$perl_path = &get_perl_path();
if (&has_command("perldoc")) {
$perl_doc = "perldoc";
}
else {
$perl_path =~ /^(.*)\/[^\/]+$/;
if (-x "$1/perldoc") {
$perl_doc = "$1/perldoc";
}
}
if ($perl_doc && $] >= 5.006) {
$perl_doc = "$perl_doc -U";
}
# set_manpath(extra)
sub set_manpath
{
$ENV{'MANPATH'} = join(":", split(/:/, $config{'man_dir'}),
split(/:/, $_[0]),
"/usr/man",
"/usr/share/man");
}
# show_view_table(heading, html)
# Prints a block showing the contents of a documentation page
sub show_view_table
{
local ($heading, $html) = @_;
print &ui_table_start($heading, "width=100%", 2);
print &ui_table_row(undef, $html, 2);
print &ui_table_end();
}
1;