PluginProbe ʕ •ᴥ•ʔ
Advanced Access Manager – Access Governance for WordPress / trunk
Advanced Access Manager – Access Governance for WordPress vtrunk
6.8.4 6.8.5 6.9.0 6.9.1 6.9.10 6.9.11 6.9.12 6.9.13 6.9.14 6.9.15 6.9.16 6.9.17 6.9.18 6.9.19 6.9.2 6.9.20 6.9.21 6.9.22 6.9.23 6.9.24 6.9.25 6.9.26 6.9.27 6.9.28 6.9.29 6.9.3 6.9.30 6.9.31 6.9.32 6.9.33 6.9.34 6.9.35 6.9.36 6.9.37 6.9.38 6.9.39 6.9.4 6.9.41 6.9.42 6.9.43 6.9.44 6.9.45 6.9.46 6.9.47 6.9.48 6.9.49 6.9.5 6.9.51 6.9.6 6.9.7 6.9.8 6.9.9 7.0.0 7.0.0-alpha.6 7.0.0-alpha.7 7.0.0-beta.1 7.0.0-rc1 7.0.0-rc2 7.0.0-rc3 7.0.1 7.0.10 7.0.11 7.0.2 7.0.3 7.0.4 7.0.5 7.0.6 7.0.7 7.0.8 7.0.9 7.1.0 7.1.1 trunk 3.0 4.0 4.0.1 4.1 4.2 4.3 4.4 4.4.1 4.5 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2 4.7.5 4.7.6 4.8 4.8.1 4.9 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.5.1 4.9.5.2 5.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1 5.1.1 5.10 5.11 5.2 5.2.1 5.2.5 5.2.6 5.2.7 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.4 5.4.1 5.4.2 5.4.3 5.4.3.1 5.4.3.2 5.5 5.5.1 5.5.2 5.6 5.6.1 5.6.1.1 5.7 5.7.1 5.7.2 5.7.3 5.8 5.8.1 5.8.2 5.8.3 5.9 5.9.1 5.9.1.1 5.9.2 5.9.2.1 5.9.3 5.9.4 5.9.5 5.9.6 5.9.6.1 5.9.6.2 5.9.6.3 5.9.7 5.9.7.1 5.9.7.2 5.9.7.3 5.9.8 5.9.8.1 5.9.9 5.9.9.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.2.0 6.2.1 6.2.2 6.3.0 6.3.1 6.3.2 6.3.3 6.4.0 6.4.1 6.4.2 6.4.3 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.6.0 6.6.1 6.6.2 6.6.3 6.6.4 6.7.0 6.7.1 6.7.2 6.7.3 6.7.4 6.7.5 6.7.6 6.7.7 6.7.8 6.7.9 6.8.0 6.8.1 6.8.2 6.8.3
advanced-access-manager / application / Backend / tmpl / service / widget.php
advanced-access-manager / application / Backend / tmpl / service Last commit date
access-denied-redirect.php 1 year ago admin-toolbar.php 1 year ago api-route.php 1 year ago backend-menu.php 1 year ago capability.php 1 year ago content.php 1 year ago identity.php 1 year ago jwt.php 5 months ago login-redirect.php 1 year ago logout-redirect.php 1 year ago metabox.php 1 year ago not-found-redirect.php 1 year ago policy.php 1 year ago url.php 1 year ago welcome.php 1 year ago widget.php 1 year ago
widget.php
187 lines
1 <?php /** @version 7.0.0 **/ ?>
2
3 <?php if (defined('AAM_KEY')) { ?>
4 <?php
5 $access_level = AAM_Backend_AccessLevel::get_instance();
6 $service = $access_level->widgets();
7 ?>
8 <div class="aam-feature" id="widget-content">
9 <?php if (AAM::api()->config->get('core.settings.ui.tips')) { ?>
10 <div class="row">
11 <div class="col-xs-12">
12 <p class="aam-info">
13 <?php echo AAM_Backend_View::replace_aam_urls(
14 __('Manage access to WordPress widgets on both admin dashboard and frontend. The premium %sadd-on%s also allows defining default visibility for all widgets.', 'advanced-access-manager'),
15 '/premium'
16 ); ?>
17 </p>
18 </div>
19 </div>
20 <?php } ?>
21
22 <div class="aam-feature-top-actions text-right">
23 <a
24 href="#"
25 class="btn btn-xs btn-primary"
26 id="refresh_widget_list"
27 ><i class="icon-arrows-cw"></i> <?php echo __('Refresh', 'advanced-access-manager'); ?></a>
28 </div>
29
30 <div class="row">
31 <div class="col-xs-12">
32 <div class="aam-overwrite" id="aam-widget-overwrite" style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>">
33 <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span>
34 <span><a href="#" id="widget_reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span>
35 </div>
36 </div>
37 </div>
38
39 <?php
40 $first = false;
41 $list = AAM_Service_Widgets::get_instance()->get_widget_list($service);
42
43 // Group all the components by screen
44 $grouped = [
45 'dashboard' => [],
46 'frontend' => []
47 ];
48
49 foreach($list as $item) {
50 $screen = $item['area'];
51
52 array_push($grouped[$screen], $item);
53 }
54 ?>
55
56 <?php if (!empty($list)) { ?>
57 <div class="panel-group" id="widget-list" role="tablist">
58 <?php foreach ($grouped as $area => $widgets) { ?>
59 <div class="panel panel-default">
60 <div class="panel-heading" role="tab" id="group-<?php echo esc_js($area); ?>-heading">
61 <h4 class="panel-title">
62 <a
63 role="button"
64 data-toggle="collapse"
65 data-parent="#widget-list"
66 href="#group-<?php echo esc_js($area); ?>"
67 aria-controls="group-<?php echo esc_js($area); ?>"
68 <?php if (!$first) { echo 'aria-expanded="true"'; } ?>
69 >
70 <?php
71 switch ($area) {
72 case 'dashboard':
73 echo __('Dashboard Widgets', 'advanced-access-manager');
74 break;
75
76 case 'frontend':
77 echo AAM_Backend_View_Helper::preparePhrase('Frontend Widgets [(including Appearance->Widgets)]', 'small');
78 break;
79
80 default:
81 break;
82 }
83 ?>
84 </a>
85 </h4>
86 </div>
87 <div
88 id="group-<?php echo esc_js($area); ?>"
89 class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>"
90 role="tabpanel"
91 aria-labelledby="group-<?php echo esc_js($area); ?>-heading"
92 >
93 <div class="panel-body">
94 <div class="row">
95 <?php foreach ($widgets as $widget) { ?>
96 <div class="col-xs-12 col-md-6 aam-submenu-item">
97 <div class="aam-menu-details">
98 <?php echo esc_js($widget['title']); ?>
99 <small><a
100 href="#widget_details_modal"
101 data-toggle="modal"
102 data-title="<?php echo esc_attr($widget['title']); ?>"
103 data-screen="<?php echo esc_attr($area); ?>"
104 data-id="<?php echo esc_attr($widget['slug']); ?>"
105 class="aam-widget-item"><?php echo __('more details', 'advanced-access-manager'); ?>
106 </a></small>
107 </div>
108
109 <?php if ($widget['is_restricted']) { ?>
110 <i
111 class="aam-accordion-action icon-lock text-danger"
112 id="widget_<?php echo esc_attr($widget['slug']); ?>"
113 data-widget="<?php echo esc_attr($widget['slug']); ?>"
114 ></i>
115 <?php } else { ?>
116 <i
117 class="aam-accordion-action icon-lock-open text-success"
118 id="widget_<?php echo esc_attr($widget['slug']); ?>"
119 data-widget="<?php echo esc_attr($widget['slug']); ?>"
120 ></i>
121 <?php } ?>
122
123 <label
124 for="widget_<?php echo esc_attr($widget['slug']); ?>"
125 data-toggle="tooltip"
126 title="<?php echo ($widget['is_restricted'] ? __('Uncheck to show', 'advanced-access-manager') : __('Check to hide', 'advanced-access-manager')); ?>"
127 ></label>
128 </div>
129 <?php } ?>
130 </div>
131
132 <?php echo apply_filters(
133 'aam_ui_widgets_screen_mode_filter',
134 '',
135 AAM_Backend_AccessLevel::get_instance(),
136 $area
137 ); ?>
138 </div>
139 </div>
140 </div>
141 <?php } ?>
142 </div>
143 <?php } else { ?>
144 <div class="row">
145 <div class="col-xs-12 text-center">
146 <p class="alert alert-info text-larger">
147 <?php echo __('The list is not initialized. Select the "Refresh" button above.', 'advanced-access-manager'); ?>
148 </p>
149 </div>
150 </div>
151 <?php } ?>
152
153 <div class="hidden" id="aam_widget_screen_list"><?php echo json_encode($this->get_screen_urls()); ?></div>
154
155 <div class="modal fade" id="widget_details_modal" tabindex="-1" role="dialog">
156 <div class="modal-dialog" role="document">
157 <div class="modal-content">
158 <div class="modal-header">
159 <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">&times;</span></button>
160 <h4 class="modal-title"><?php echo __('Widget Details', 'advanced-access-manager'); ?></h4>
161 </div>
162 <div class="modal-body">
163 <table class="table table-striped table-bordered">
164 <tbody>
165 <tr>
166 <th width="20%"><?php echo __('Title', 'advanced-access-manager'); ?></th>
167 <td id="widget_title"></td>
168 </tr>
169 <tr>
170 <th width="20%"><?php echo __('Area', 'advanced-access-manager'); ?></th>
171 <td id="widget_screen_id"></td>
172 </tr>
173 <tr>
174 <th width="20%"><?php echo __('Widget Slug', 'advanced-access-manager'); ?></th>
175 <td id="widget_id"></td>
176 </tr>
177 </tbody>
178 </table>
179 </div>
180 <div class="modal-footer">
181 <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', 'advanced-access-manager'); ?></button>
182 </div>
183 </div>
184 </div>
185 </div>
186 </div>
187 <?php }