forked from webmin/authentic-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigation.pm
159 lines (138 loc) · 6.94 KB
/
navigation.pm
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# Authentic Theme (https://github.com/qooob/authentic-theme)
# Copyright Ilia Rostovtsev <[email protected]>
# Licensed under MIT (https://github.com/qooob/authentic-theme/blob/master/LICENSE)
#
if ((!%in) ||
($t_uri__i =~ /virtual-server/ || $t_uri__i =~ /server-manager/))
{
$in{$t_uri____i} = get_default_target();
}
my @leftitems = list_combined_webmin_menu($sects, \%in);
if (dashboard_switch()
||
( $in{'xhr-navigation-type'} ne 'virtualmin' &&
$in{'xhr-navigation-type'} ne 'cloudmin' &&
$in{'xhr-navigation-type'} ne 'webmail' &&
( (($__settings{'settings_right_default_tab_webmin'} eq '/' && get_product_name() eq 'webmin'))
||
(
(!$__settings{'settings_right_default_tab_usermin'} ||
$__settings{'settings_right_default_tab_usermin'} eq '/' ||
!foreign_available("mailbox")
) &&
get_product_name() eq 'usermin'))
) ||
$in{'xhr-navigation-type'} eq 'webmin')
{
print_search();
my @cats = &get_visible_modules_categories();
my @modules = map {@{ $_->{'modules'} }} @cats;
my $show_unused = $__settings{'settings_leftmenu_section_hide_unused_modules'} eq 'true' ? 0 : 1;
my $__custom_print = 0;
my $__print_hidden = 0;
foreach my $c (@cats) {
if ($gconfig{"notabs_${base_remote_user}"} ne '2' && $gconfig{"notabs"} ne '1' && ($c && !$c->{'unused'}) ||
($c && $c->{'unused'} && $show_unused))
{
&print_category($c->{'code'}, $c->{'desc'});
print '<li class="sub-wrapper"><ul class="sub" style="display: none;" id="' . $c->{'code'} . '">' . "\n";
foreach my $minfo (@{ $c->{'modules'} }) {
if (($minfo->{'dir'} eq 'webmin' && foreign_available("webmin")) &&
$__custom_print eq '0')
{
print_category_link($gconfig{'webprefix'} . "/webmin/edit_themes.cgi",
$Atext{'settings_right_theme_left_configuration_title'}, 1);
print_category_link($gconfig{'webprefix'} . "/settings-editor_read.cgi",
$Atext{'settings_right_theme_left_extensions_title'}, 1);
print_category_link($gconfig{'webprefix'} . "/settings-upload.cgi",
$Atext{'settings_right_theme_left_logo_title'}, 1);
$__custom_print++;
} elsif (!foreign_available("webmin") && $__custom_print eq '0') {
print_category_link($gconfig{'webprefix'} . "/settings-user.cgi", $Atext{'settings_title'}, 1);
$__custom_print++;
}
if ($__print_hidden eq '0') {
if (licenses('vm') eq '1') {
&print_category_link($gconfig{'webprefix'} . "/virtual-server/licence.cgi",
$Atext{'right_vlcheck'}, 1);
}
if (licenses('cm') eq '1') {
&print_category_link($gconfig{'webprefix'} . "/server-manager/licence.cgi",
$Atext{'right_slcheck'}, 1);
}
$__print_hidden++;
}
if ($minfo->{'dir'} ne 'mailbox') {
&print_category_link("$gconfig{'webprefix'}/$minfo->{'dir'}/"
.
( "/$minfo->{'dir'}/" =~ 'filemin' ? 'index.cgi?path=/' :
("/$minfo->{'dir'}/" =~ 'csf' ? 'index.cgi' : '')
),
$minfo->{'desc'},
undef);
}
}
print '</ul></li>' . "\n";
} elsif ($gconfig{"notabs_${base_remote_user}"} eq '2' || $gconfig{"notabs"} eq '1') {
foreach my $minfo (@{ $c->{'modules'} }) {
print '<li data-linked><a href="' . $gconfig{'webprefix'} . '/' . $minfo->{'dir'} .
'" class="navigation_module_trigger navigation_trigger_single_link"><i class="fa fa-fw fa-link"></i> <span>'
. $minfo->{'desc'}
. '</span></a></li>' . "\n";
}
}
}
if (&foreign_available("webmin") &&
$__settings{'settings_leftmenu_section_hide_refresh_modules'} ne 'true')
{
print '<li data-linked><a href="' . $gconfig{'webprefix'} .
'/webmin/refresh_modules.cgi" class="navigation_module_trigger"><i class="fa fa-fw fa-refresh"></i> <span>' .
$Atext{'left_refresh_modules'} . '</span></a></li>' . "\n";
}
print_sysinfo_link($get_user_level eq '3' ? 1 : undef);
print_netdata_link();
if (&get_product_name() eq 'webmin' &&
!get_env('anonymous_user') &&
$gconfig{'nofeedbackcc'} != 2 &&
$gaccess{'feedback'} &&
$gconfig{'feedback_to'} ||
&get_product_name() eq 'usermin' && !get_env('anonymous_user') && $gconfig{'feedback'})
{
print '<li data-linked><a href="' . $gconfig{'webprefix'} .
'/feedback_form.cgi" class="navigation_module_trigger"><i class="fa fa-fw fa-envelope"></i> <span>' .
$Atext{'left_feedback'} . '</span></a></li>' . "\n";
}
}
elsif (!$__settings{'settings_right_default_tab_webmin'} ||
(foreign_available("virtual-server") &&
$__settings{'settings_right_default_tab_webmin'} =~ /virtualmin/ &&
$in{'xhr-navigation-type'} ne 'cloudmin') ||
$in{'xhr-navigation-type'} eq 'virtualmin')
{
print_left_menu('virtual-server', \@leftitems, 0, 0, $in{'dom'}, $in{'xhr-navigation-type'});
print_sysinfo_link();
print_sysstat_link();
}
elsif (!$__settings{'settings_right_default_tab_webmin'} ||
(foreign_available("server-manager") &&
$__settings{'settings_right_default_tab_webmin'} =~ /cloudmin/ &&
$in{'xhr-navigation-type'} ne 'virtualmin') ||
$in{'xhr-navigation-type'} eq 'cloudmin')
{
print_left_menu('server-manager', \@leftitems, 0, 0, $in{'sid'}, $in{'xhr-navigation-type'});
print_sysinfo_link();
}
elsif (foreign_available("mailbox") &&
($__settings{'settings_right_default_tab_usermin'} =~ /mail/ || $in{'xhr-navigation-type'} eq 'webmail'))
{
print_left_menu('mailbox', \@leftitems, 0, 0, 0, $in{'xhr-navigation-type'});
print '<li data-linked><a href="' . $gconfig{'webprefix'} .
'/uconfig.cgi?mailbox" class="navigation_module_trigger"><i class="fa fa-fw fa-cog"></i> <span>' .
$Atext{'theme_left_mail_prefs'} . '</span></a></li>' . "\n";
print '<li data-linked><a href="' .
$gconfig{'webprefix'} . '/changepass" class="navigation_module_trigger"><i class="fa fa-fw fa-key"></i> <span>' .
$Atext{'theme_left_mail_change_password'} . '</span></a></li>' . "\n";
print_sysinfo_link(1);
}
1;