-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_menus_toggle.html
107 lines (93 loc) · 4.03 KB
/
admin_menus_toggle.html
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
<script>
function toggleMenuItem(name, menu, hide, current) {
$.ajax({
url: '{action}&toggle=' + hide + '&_ajax_=1&menu=' + menu + '&name=' + name + '&{H_FORM_KEYS_GET}',
dataType: 'json',
cache: false})
.done(function (data) {
if(data.content){
$('#pageErrors>span').html(data.content);
$('#pageErrors').removeClass('d-none alert-danger').addClass('alert-info');
} else {
this.fail();
}
})
.fail(function(data) {
var tryAgainLang = '{lang.ERROR_TRY_AGAIN}';
<IGNORE>$('#pageErrors>span').html((data.content ? data.content : (data.responseJSON ? data.responseJSON.content : tryAgainLang)));</IGNORE>
$('#pageErrors').removeClass('d-none alert-info').addClass('alert-danger');
var itemRemoveClass = current == 1 ? 'cb-disable' : 'cb-enable';
var itemAddClass = current == 0 ? 'cb-disable' : 'cb-enable';
$('#' + menu + '_menu_'+name + ' .' + itemRemoveClass).addClass('selected');
$('#' + menu + '_menu_'+name + ' .' + itemAddClass).removeClass('selected');
});
return false;
}
</script>
<div class="alert alert-info alert-dismissible fixed-top m-3 p-0 text-center small d-none" id="pageErrors">
<span>...</span>
<button type="button" class="close py-0" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true" class="small" style="cursor:pointer">×</span>
</button>
</div>
<!-- Breadcrumbs -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="./">{lang.R_CPINDEX}</a></li>
<li class="breadcrumb-item"><a href="./?cp=options">{lang.R_CONFIGS}</a></li>
<li class="breadcrumb-item active">{olang.R_MENUS_TOGGLE}</li>
</ol>
<div class="alert alert-light">{olang.MENU_TOGGLE_EXP}</div>
<div class="p-3">
<h4 class="mt-4">{olang.MENU_TOGGLE_TOP_MENU}</h4>
<ul class="list-group">
<LOOP NAME="top_menu_items">
<li class="list-group-item d-flex justify-content-between">
<div class="col col-md-auto">
<h5>{{title}}</h5>
</div>
<div class="col col-md-auto">
<p class="field switch" id="top_menu_{{name}}">
<label onclick="toggleMenuItem('{{name}}', 'top', 0, {{hidden}})" class="cb-enable<IF LOOP="hidden == 0"> selected</IF>"><span>{olang.MENU_TOGGLE_SHOW}</span></label>
<label onclick="toggleMenuItem('{{name}}', 'top', 1, {{hidden}})" class="cb-disable<IF LOOP="hidden == 1"> selected</IF>"><span>{olang.MENU_TOGGLE_HIDE}</span></label>
</p>
</div>
</li>
</LOOP>
</ul>
<h4 class="mt-5">{olang.MENU_TOGGLE_SIDE_MENU}</h4>
<ul class="list-group">
<LOOP NAME="side_menu_items">
<li class="list-group-item d-flex justify-content-between">
<div class="col col-md-auto">
<h5>{{title}}</h5>
</div>
<div class="col col-md-auto">
<p class="field switch" id="top_menu_{{name}}">
<label onclick="toggleMenuItem('{{name}}', 'side', 0, {{hidden}})" class="cb-enable<IF LOOP="hidden == 0"> selected</IF>"><span>{olang.MENU_TOGGLE_SHOW}</span></label>
<label onclick="toggleMenuItem('{{name}}', 'side', 1, {{hidden}})" class="cb-disable<IF LOOP="hidden == 1"> selected</IF>"><span>{olang.MENU_TOGGLE_HIDE}</span></label>
</p>
</div>
</li>
</LOOP>
</ul>
<h4 class="mt-5">{olang.MENU_TOGGLE_ADMIN_MENU}</h4>
<UNLESS NAME="is_founder_admin">
<div class="alert alert-light">{olang.MENU_TOGGLE_ADMIN_MENU_EXP}</div>
<ELSE>
<ul class="list-group">
<LOOP NAME="admin_menu_items">
<li class="list-group-item d-flex justify-content-between">
<div class="col col-md-auto">
<h5>{{title}}</h5>
</div>
<div class="col col-md-auto">
<p class="field switch" id="top_menu_{{name}}">
<label onclick="toggleMenuItem('{{name}}', 'admin', 0, {{hidden}})" class="cb-enable<IF LOOP="hidden == 0"> selected</IF>"><span>{olang.MENU_TOGGLE_SHOW}</span></label>
<label onclick="toggleMenuItem('{{name}}', 'admin', 1, {{hidden}})" class="cb-disable<IF LOOP="hidden == 1"> selected</IF>"><span>{olang.MENU_TOGGLE_HIDE}</span></label>
</p>
</div>
</li>
</LOOP>
</ul>
</UNLESS>
</div>