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 / metabox.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
metabox.php
205 lines
1 <?php /** @version 7.0.0 **/ ?>
2
3 <?php if (defined('AAM_KEY')) { ?>
4 <?php $service = AAM_Backend_AccessLevel::get_instance()->metaboxes(); ?>
5 <div class="aam-feature" id="metabox-content">
6 <?php if (AAM::api()->config->get('core.settings.ui.tips')) { ?>
7 <div class="row">
8 <div class="col-xs-12">
9 <p class="aam-info">
10 <?php echo AAM_Backend_View::replace_aam_urls(
11 __('Manage access to WordPress classical metaboxes on the content-edit screens. This service does not define access controls to Gutenberg blocks. The premium %sadd-on%s also allows defining default visibility for metaboxes.', 'advanced-access-manager'),
12 '/premium'
13 ); ?>
14 </p>
15 </div>
16 </div>
17 <?php } ?>
18
19 <div class="aam-feature-top-actions text-right">
20 <a
21 href="#"
22 class="btn btn-xs btn-primary"
23 id="refresh-metabox-list"
24 ><i class="icon-arrows-cw"></i> <?php echo __('Refresh', 'advanced-access-manager'); ?></a>
25 <a
26 href="#init-url-modal"
27 class="btn btn-xs btn-primary"
28 data-toggle="modal"><i class="icon-link"
29 ></i> <?php echo __('Init URL', 'advanced-access-manager'); ?></a>
30 </div>
31
32 <div class="row">
33 <div class="col-xs-12">
34 <div class="aam-overwrite" id="aam-metabox-overwrite" style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>">
35 <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span>
36 <span><a href="#" id="metabox-reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span>
37 </div>
38 </div>
39 </div>
40
41 <?php
42 global $wp_post_types;
43
44 $first = false;
45 $list = $service->get_items();
46
47 // Group all the metaboxes by post type
48 $grouped = [];
49
50 foreach($list as $item) {
51 $screen_id = $item['screen_id'];
52
53 if (!isset($grouped[$screen_id])) {
54 $grouped[$screen_id] = [];
55 }
56
57 array_push($grouped[$screen_id], $item);
58 }
59 ?>
60
61 <?php if (!empty($list)) { ?>
62 <div class="panel-group" id="metabox-list" role="tablist">
63 <?php foreach ($grouped as $screen_id => $metaboxes) { ?>
64 <div class="panel panel-default">
65 <div class="panel-heading" role="tab" id="group_<?php echo esc_attr($screen_id); ?>_heading">
66 <h4 class="panel-title">
67 <a
68 role="button"
69 data-toggle="collapse"
70 data-parent="#metabox-list"
71 href="#group_<?php echo esc_attr($screen_id); ?>"
72 aria-controls="group_<?php echo esc_attr($screen_id); ?>"
73 <?php if (!$first) { echo 'aria-expanded="true"'; } ?>
74 >
75 <?php echo $wp_post_types[$screen_id]->labels->name; ?>
76 </a>
77 </h4>
78 </div>
79 <div
80 id="group_<?php echo esc_attr($screen_id); ?>"
81 class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>"
82 role="tabpanel"
83 aria-labelledby="group_<?php echo esc_js($screen_id); ?>_heading"
84 >
85 <div class="panel-body">
86 <div class="row">
87 <?php foreach ($metaboxes as $metabox) { ?>
88 <div class="col-xs-12 col-md-6 aam-submenu-item">
89 <div class="aam-menu-details">
90 <?php echo esc_js($metabox['title']); ?>
91 <small><a
92 href="#metabox-details-modal"
93 data-toggle="modal"
94 data-title="<?php echo esc_attr($metabox['title']); ?>"
95 data-screen="<?php echo esc_attr($screen_id); ?>"
96 data-id="<?php echo esc_attr($metabox['slug']); ?>"
97 class="aam-metabox-item"><?php echo __('more details', 'advanced-access-manager'); ?>
98 </a></small>
99 </div>
100
101 <?php if ($metabox['is_restricted']) { ?>
102 <i
103 class="aam-accordion-action icon-lock text-danger"
104 id="metabox_<?php echo esc_attr($metabox['slug']); ?>"
105 data-metabox="<?php echo esc_attr($metabox['slug']); ?>"
106 data-screen="<?php echo esc_attr($metabox['screen_id']); ?>"
107 ></i>
108 <?php } else { ?>
109 <i
110 class="aam-accordion-action icon-lock-open text-success"
111 id="metabox_<?php echo esc_attr($metabox['slug']); ?>"
112 data-metabox="<?php echo esc_attr($metabox['slug']); ?>"
113 data-screen="<?php echo esc_attr($metabox['screen_id']); ?>"
114 ></i>
115 <?php } ?>
116
117 <label
118 for="metabox_<?php echo esc_attr($metabox['slug']); ?>"
119 data-toggle="tooltip"
120 title="<?php echo ($metabox['is_restricted'] ? __('Uncheck to show', 'advanced-access-manager') : __('Check to hide', 'advanced-access-manager')); ?>"
121 ></label>
122 </div>
123 <?php } ?>
124 </div>
125
126 <?php echo apply_filters(
127 'aam_ui_metaboxes_screen_mode_filter',
128 '',
129 AAM_Backend_AccessLevel::get_instance(),
130 $screen_id
131 ); ?>
132 </div>
133 </div>
134 </div>
135 <?php } ?>
136 </div>
137 <?php } else { ?>
138 <div class="row">
139 <div class="col-xs-12 text-center">
140 <p class="alert alert-info text-larger">
141 <?php echo __('The list is not initialized. Select the "Refresh" button above.', 'advanced-access-manager'); ?>
142 </p>
143 </div>
144 </div>
145 <?php } ?>
146
147 <div class="hidden" id="aam_screen_list"><?php echo json_encode($this->get_screen_urls()); ?></div>
148
149 <div class="modal fade" id="init-url-modal" tabindex="-1" role="dialog">
150 <div class="modal-dialog" role="document">
151 <div class="modal-content">
152 <div class="modal-header">
153 <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">&times;</span></button>
154 <h4 class="modal-title"><?php echo __('Initialize URL', 'advanced-access-manager'); ?></h4>
155 </div>
156 <div class="modal-body">
157 <p class="aam-info">
158 <?php echo __('Some metaboxes are "conditional" and appear on the edit screen when certain conditions are met. For example metabox "Comments" appears only for existing page and not for new page. If you do not see a desired metabox, try to copy & paste the full URL to the backend page where that metabox appears.', 'advanced-access-manager'); ?>
159 </p>
160 <div class="form-group">
161 <label><?php echo __('Backend page URL', 'advanced-access-manager'); ?></label>
162 <input type="text" class="form-control" id="init-url" placeholder="<?php echo __('Insert valid URL', 'advanced-access-manager'); ?>" />
163 </div>
164 </div>
165 <div class="modal-footer">
166 <button type="button" class="btn btn-success" id="init-url-btn"><?php echo __('Initialize', 'advanced-access-manager'); ?></button>
167 <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', 'advanced-access-manager'); ?></button>
168 </div>
169 </div>
170 </div>
171 </div>
172
173 <div class="modal fade" id="metabox-details-modal" tabindex="-1" role="dialog">
174 <div class="modal-dialog" role="document">
175 <div class="modal-content">
176 <div class="modal-header">
177 <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">&times;</span></button>
178 <h4 class="modal-title"><?php echo __('Metabox Details', 'advanced-access-manager'); ?></h4>
179 </div>
180 <div class="modal-body">
181 <table class="table table-striped table-bordered">
182 <tbody>
183 <tr>
184 <th width="20%"><?php echo __('Title', 'advanced-access-manager'); ?></th>
185 <td id="metabox-title"></td>
186 </tr>
187 <tr>
188 <th width="20%"><?php echo __('Screen ID', 'advanced-access-manager'); ?></th>
189 <td id="metabox-screen-id"></td>
190 </tr>
191 <tr>
192 <th width="20%"><?php echo __('Slug', 'advanced-access-manager'); ?></th>
193 <td id="metabox-id"></td>
194 </tr>
195 </tbody>
196 </table>
197 </div>
198 <div class="modal-footer">
199 <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', 'advanced-access-manager'); ?></button>
200 </div>
201 </div>
202 </div>
203 </div>
204 </div>
205 <?php }