forked from webmin/authentic-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buttons.pm
156 lines (144 loc) · 5.56 KB
/
buttons.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
#
# Authentic Theme 18.40 (https://github.com/qooob/authentic-theme)
# Copyright 2014-2017 Ilia Rostovtsev <[email protected]>
# Licensed under MIT (https://github.com/qooob/authentic-theme/blob/master/LICENSE)
#
our $user = $remote_user;
if ( $__settings{'settings_sysinfo_link_mini'} eq 'true'
&& dashboard_switch() ne '1' )
{
print '<li'
. get_button_tooltip( 'theme_xhred_titles_dashboard', 'settings_hotkey_sysinfo', 'auto top' )
. ' class="user-link">';
print '<a class="menu-exclude-link sidebar_sysinfo_link" target="page" href="'
. $gconfig{'webprefix'}
. '/sysinfo.cgi"><i class="fa fa-fw fa-dashboard"></i></a>';
print '</li>';
}
print '<li'
. get_button_tooltip( 'theme_tooltip_night_mode', 'settings_hotkey_toggle_key_night_mode', 'auto top' )
. ' class="user-link palette-toggle cursor-pointer'
. (
( $__settings{'settings_show_night_mode_link'} ne 'false'
&& $__settings{'settings_background_color'} ne "nightRider"
)
? ''
: ' hidden'
) . '">';
print '<span><i class="fa fa-fw '
. ( theme_night_mode() ? 'fa-sun vertical-align-middle' : 'fa-moon' )
. '"></i></span>';
print '</li>';
if ( $__settings{'settings_show_terminal_link'} ne 'false'
&& foreign_available("shell") )
{
print '<li'
. get_button_tooltip( 'theme_tooltip_terminal_link', 'settings_hotkey_shell', 'auto top' )
. ' class="user-link ported-console cursor-pointer">';
print '<span><i class="fa fa-fw fa-terminal"></i></span>';
print '</li>';
}
if ( $get_user_level eq '0'
&& foreign_available('webmin') )
{
print '<li'
. get_button_tooltip( 'left_favorites', 'settings_hotkey_favorites', 'auto top' )
. ' class="user-link favorites cursor-pointer'
. ( $__settings{'settings_favorites'} ne 'false' ? '' : ' hidden' ) . '">';
print '<span><i class="fa fa-fw fa-star"></i></span>';
print '</li>';
}
if ( $__settings{'settings_theme_options_button'} ne 'false' ) {
print '<li'
. get_button_tooltip( 'settings_title', undef, 'auto top' )
. ' class="user-link theme-options cursor-pointer">';
if ( $get_user_level eq '0' && foreign_available('webmin') ) {
print '<a class="menu-exclude-link" target="page" href="'
. $gconfig{'webprefix'}
. '/webmin/edit_themes.cgi" data-href="'
. $gconfig{'webprefix'}
. '/webmin/edit_themes.cgi"><i class="fa fa-fw fa-cogs"></i></a>';
}
else {
print '<a class="menu-exclude-link" target="page" href="'
. $gconfig{'webprefix'}
. '/settings-user.cgi" data-href="'
. $gconfig{'webprefix'}
. '/settings-user.cgi"><i class="fa fa-fw fa-cogs"></i></a>';
}
print '</li>';
}
print '<li class="user-link">';
if ( &foreign_available("acl") ) {
print '<a'
. get_button_tooltip( 'theme_tooltip_edit_user', undef, 'auto top' )
. ' class="menu-exclude-link" target="page" data-href="'
. $gconfig{'webprefix'}
. '/acl/edit_user.cgi" href="'
. $gconfig{'webprefix'}
. '/acl/edit_user.cgi?user='
. ( get_env('base_remote_user') eq "root" ? "root" : $user )
. '"><i class="fa fa-fw fa-user"></i> <span>'
. $user
. '</span></a>';
}
else {
print
'<a class="menu-exclude-link" style="pointer-events: none;"><i class="fa fa-fw fa-user"></i> <span>'
. $user
. '</span></a>';
}
print '</li>';
&get_miniserv_config( \%miniserv );
if ( $miniserv{'logout'}
&& !get_env('ssl_user')
&& !get_env('local_user')
&& get_env('http_user_agent') !~ /webmin/i )
{
print '<li class="user-link __logout-link">';
if ($main::session_id) {
print '<a'
. get_button_tooltip( 'theme_tooltip_logout', undef, 'auto top' )
. ' class="menu-exclude-link" href="'
. $gconfig{'webprefix'}
. '/session_login.cgi?logout=1"><i class="fa fa-fw fa-sign-out text-danger"></i></a>';
}
else {
print '<a'
. get_button_tooltip( 'theme_tooltip_switch_user', undef, 'auto top' )
. ' class="menu-exclude-link" href="'
. $gconfig{'webprefix'}
. '/switch_user.cgi"><i class="fa fa-fw fa-exchange text-danger"></i></a>';
}
print '</li>';
}
if ( -r "$root_directory/virtual-server/edit_lang.cgi"
&& $__settings{'settings_leftmenu_button_language'} eq 'true'
&& ( $t_uri_virtualmin != -1
|| $t_uri_cloudmin != -1
|| $in{'xhr-buttons-type'} eq '1' ) )
{
print '<li'
. get_button_tooltip( 'settings_tooltip_language_link', undef, 'auto top' )
. ' class="user-link">
<a class="menu-exclude-link" target="page" href="'
. $gconfig{'webprefix'} . '/virtual-server/edit_lang.cgi">
<i class="fa fa-fw fa-globe"></i>
</a>
</li>';
}
elsif ( &foreign_available("change-user")
&& $__settings{'settings_leftmenu_button_language'} eq 'true' )
{
print '<li'
. get_button_tooltip( 'settings_tooltip_language_link', undef, 'auto top' )
. ' class="user-link"><a class="menu-exclude-link" target="page" href="'
. $gconfig{'webprefix'}
. '/change-user"><i class="fa fa-fw fa-globe"></i></a></li>';
}
print '<li'
. get_button_tooltip( 'theme_xhred_filemanager_context_refresh', 'settings_hotkey_reload', 'auto top' )
. ' class="user-link'
. ( $__settings{'settings_leftmenu_button_refresh'} ne 'true' && ' hidden' )
. '"><a class="menu-exclude-link" data-refresh="true" style="cursor: pointer"><i class="fa fa-fw fa-refresh"></i></a></li>';
1;