PluginProbe
Adminimize / 1.9.1
Adminimize v1.9.1
1.11.14 1.11.13 1.11.1 1.11.10 1.11.11 1.11.12 1.11.2 1.11.3 1.11.4 1.11.5 1.11.6 1.11.7 1.11.8 1.11.9 1.3 1.4.7 1.6 1.7.12 1.7.13 1.7.14 1.7.15 1.7.16 1.7.17 1.7.18 1.7.19 All 53 releases
← All changes | inc-options/menu_options.php +259 -342 1.7.17 → 1.9.1 View file →
@@ -1,343 +1,260 @@
1 -<?php
2 -// options for menu, submenu
3 -?>
4 -
5 - <div id="poststuff" class="ui-sortable meta-box-sortables">
6 - <div class="postbox">
7 - <div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br/></div>
8 - <h3 class="hndle" id="config_menu"><?php _e('Menu Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?></h3>
9 - <div class="inside">
10 - <br class="clear" />
11 -
12 - <table summary="config_menu" class="widefat">
13 - <thead>
14 - <tr>
15 - <th><?php _e('Menu options - Menu, <span style=\"font-weight: 400;\">Submenu</span>', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th>
16 -
17 - <?php foreach ($user_roles_names as $role_name) { ?>
18 - <th><?php _e('Deactivate for', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br/>' . $role_name; ?></th>
19 - <?php } ?>
20 -
21 - </tr>
22 - </thead>
23 - <tbody>
24 - <?php
25 - $wp_menu = _mw_adminimize_getOptionValue('mw_adminimize_default_menu');
26 - $wp_submenu = _mw_adminimize_getOptionValue('mw_adminimize_default_submenu');
27 -
28 - if ( empty($wp_menu) ) {
29 - global $menu;
30 -
31 - $wp_menu = $menu;
32 - }
33 - if ( !isset($wp_submenu) ) {
34 - global $submenu;
35 -
36 - $wp_submenu = $submenu;
37 - }
38 -
39 - foreach ($user_roles as $role) {
40 - $disabled_metaboxes_post_[$role] = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_post_'. $role .'_items');
41 - $disabled_metaboxes_page_[$role] = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_page_'. $role .'_items');
42 - }
43 -
44 - $metaboxes = array(
45 - '#contextual-help-link-wrap',
46 - '#screen-options-link-wrap',
47 - '#titlediv',
48 - '#pageslugdiv',
49 - '#tagsdiv,#tagsdivsb,#tagsdiv-post_tag',
50 - '#formatdiv',
51 - '#categorydiv,#categorydivsb',
52 - '#category-add-toggle',
53 - '#postexcerpt',
54 - '#trackbacksdiv',
55 - '#postcustom',
56 - '#commentsdiv',
57 - '#passworddiv',
58 - '#authordiv',
59 - '#revisionsdiv',
60 - '.side-info',
61 - '#notice',
62 - '#post-body h2',
63 - '#media-buttons',
64 - '#wp-word-count',
65 - '#slugdiv,#edit-slug-box',
66 - '#misc-publishing-actions',
67 - '#commentstatusdiv',
68 - '#editor-toolbar #edButtonHTML, #quicktags'
69 - );
70 -
71 - if ( function_exists('current_theme_supports') && current_theme_supports( 'post-thumbnails', 'post' ) )
72 - array_push($metaboxes, '#postimagediv');
73 - if (class_exists('SimpleTagsAdmin'))
74 - array_push($metaboxes, '#suggestedtags');
75 - if (function_exists('tc_post'))
76 - array_push($metaboxes, '#textcontroldiv');
77 - if (class_exists('HTMLSpecialCharactersHelper'))
78 - array_push($metaboxes, '#htmlspecialchars');
79 - if (class_exists('All_in_One_SEO_Pack'))
80 - array_push($metaboxes, '#postaiosp, #aiosp');
81 - if (function_exists('tdomf_edit_post_panel_admin_head'))
82 - array_push($metaboxes, '#tdomf');
83 - if (function_exists('post_notification_form'))
84 - array_push($metaboxes, '#post_notification');
85 - if (function_exists('sticky_add_meta_box'))
86 - array_push($metaboxes, '#poststickystatusdiv');
87 -
88 - $metaboxes_names = array(
89 - __('Help'),
90 - __('Screen Options'),
91 - __('Title', FB_ADMINIMIZE_TEXTDOMAIN),
92 - __('Permalink', FB_ADMINIMIZE_TEXTDOMAIN ),
93 - __('Tags', FB_ADMINIMIZE_TEXTDOMAIN ),
94 - __('Format'),
95 - __('Categories', FB_ADMINIMIZE_TEXTDOMAIN ),
96 - __('Add New Category', FB_ADMINIMIZE_TEXTDOMAIN ),
97 - __('Excerpt', FB_ADMINIMIZE_TEXTDOMAIN ),
98 - __('Trackbacks', FB_ADMINIMIZE_TEXTDOMAIN ),
99 - __('Custom Fields'),
100 - __('Comments', FB_ADMINIMIZE_TEXTDOMAIN ),
101 - __('Password Protect This Post', FB_ADMINIMIZE_TEXTDOMAIN ),
102 - __('Post Author'),
103 - __('Post Revisions'),
104 - __('Related, Shortcuts', FB_ADMINIMIZE_TEXTDOMAIN ),
105 - __('Messages', FB_ADMINIMIZE_TEXTDOMAIN ),
106 - __('h2: Advanced Options', FB_ADMINIMIZE_TEXTDOMAIN ),
107 - __('Media Buttons (all)', FB_ADMINIMIZE_TEXTDOMAIN ),
108 - __('Word count', FB_ADMINIMIZE_TEXTDOMAIN ),
109 - __('Post Slug'),
110 - __('Publish Actions', FB_ADMINIMIZE_TEXTDOMAIN ),
111 - __('Discussion'),
112 - __('HTML Editor Button')
113 - );
114 -
115 - if ( function_exists('current_theme_supports') && current_theme_supports( 'post-thumbnails', 'post' ) )
116 - array_push($metaboxes_names, __('Post Thumbnail') );
117 - if (class_exists('SimpleTagsAdmin'))
118 - array_push($metaboxes_names, __('Suggested tags from'));
119 - if (function_exists('tc_post'))
120 - array_push($metaboxes_names, __('Text Control'));
121 - if (class_exists('HTMLSpecialCharactersHelper'))
122 - array_push($metaboxes_names, __('HTML Special Characters'));
123 - if (class_exists('All_in_One_SEO_Pack'))
124 - array_push($metaboxes_names, __('All in One SEO Pack'));
125 - if (function_exists('tdomf_edit_post_panel_admin_head'))
126 - array_push($metaboxes_names, 'TDOMF');
127 - if (function_exists('post_notification_form'))
128 - array_push($metaboxes_names, 'Post Notification');
129 - if (function_exists('sticky_add_meta_box'))
130 - array_push($metaboxes, 'Post Sticky Status');
131 -
132 - // add own post options
133 - $_mw_adminimize_own_post_values = _mw_adminimize_getOptionValue('_mw_adminimize_own_post_values');
134 - $_mw_adminimize_own_post_values = preg_split( "/\r\n/", $_mw_adminimize_own_post_values );
135 - foreach ( (array) $_mw_adminimize_own_post_values as $key => $_mw_adminimize_own_post_value ) {
136 - $_mw_adminimize_own_post_value = trim($_mw_adminimize_own_post_value);
137 - array_push($metaboxes, $_mw_adminimize_own_post_value);
138 - }
139 -
140 - $_mw_adminimize_own_post_options = _mw_adminimize_getOptionValue('_mw_adminimize_own_post_options');
141 - $_mw_adminimize_own_post_options = preg_split( "/\r\n/", $_mw_adminimize_own_post_options );
142 - foreach ( (array) $_mw_adminimize_own_post_options as $key => $_mw_adminimize_own_post_option ) {
143 - $_mw_adminimize_own_post_option = trim($_mw_adminimize_own_post_option);
144 - array_push($metaboxes_names, $_mw_adminimize_own_post_option);
145 - }
146 -
147 - // pages
148 - $metaboxes_page = array(
149 - '#contextual-help-link-wrap',
150 - '#screen-options-link-wrap',
151 - '#titlediv',
152 - '#pageslugdiv',
153 - '#pagepostcustom, #pagecustomdiv, #postcustom',
154 - '#pagecommentstatusdiv, #commentsdiv',
155 - '#pagepassworddiv',
156 - '#pageparentdiv',
157 - '#pagetemplatediv',
158 - '#pageorderdiv',
159 - '#pageauthordiv, #authordiv',
160 - '#revisionsdiv',
161 - '.side-info',
162 - '#notice',
163 - '#post-body h2',
164 - '#media-buttons',
165 - '#wp-word-count',
166 - '#slugdiv,#edit-slug-box',
167 - '#misc-publishing-actions',
168 - '#commentstatusdiv',
169 - '#editor-toolbar #edButtonHTML, #quicktags'
170 - );
171 -
172 - if ( function_exists('current_theme_supports') && current_theme_supports( 'post-thumbnails', 'page' ) )
173 - array_push($metaboxes_page, '#postimagediv' );
174 - if (class_exists('SimpleTagsAdmin'))
175 - array_push($metaboxes_page, '#suggestedtags');
176 - if (class_exists('HTMLSpecialCharactersHelper'))
177 - array_push($metaboxes_page, '#htmlspecialchars');
178 - if (class_exists('All_in_One_SEO_Pack'))
179 - array_push($metaboxes_page, '#postaiosp, #aiosp');
180 - if (function_exists('tdomf_edit_post_panel_admin_head'))
181 - array_push($metaboxes_page, '#tdomf');
182 - if (function_exists('post_notification_form'))
183 - array_push($metaboxes_page, '#post_notification');
184 -
185 - $metaboxes_names_page = array(
186 - __('Help'),
187 - __('Screen Options'),
188 - __('Title', FB_ADMINIMIZE_TEXTDOMAIN),
189 - __('Permalink', FB_ADMINIMIZE_TEXTDOMAIN ),
190 - __('Custom Fields'),
191 - __('Comments &amp; Pings', FB_ADMINIMIZE_TEXTDOMAIN ),
192 - __('Password Protect This Page', FB_ADMINIMIZE_TEXTDOMAIN ),
193 - __('Attributes'),
194 - __('Page Template', FB_ADMINIMIZE_TEXTDOMAIN ),
195 - __('Page Order', FB_ADMINIMIZE_TEXTDOMAIN ),
196 - __('Page Author'),
197 - __('Page Revisions'),
198 - __('Related', FB_ADMINIMIZE_TEXTDOMAIN ),
199 - __('Messages', FB_ADMINIMIZE_TEXTDOMAIN ),
200 - __('h2: Advanced Options', FB_ADMINIMIZE_TEXTDOMAIN ),
201 - __('Media Buttons (all)', FB_ADMINIMIZE_TEXTDOMAIN ),
202 - __('Word count', FB_ADMINIMIZE_TEXTDOMAIN ),
203 - __('Page Slug'),
204 - __('Publish Actions', FB_ADMINIMIZE_TEXTDOMAIN ),
205 - __('Discussion'),
206 - __('HTML Editor Button')
207 - );
208 -
209 - if ( function_exists('current_theme_supports') && current_theme_supports( 'post-thumbnails', 'page' ) )
210 - array_push($metaboxes_names_page, __('Page Image') );
211 - if (class_exists('SimpleTagsAdmin'))
212 - array_push($metaboxes_names_page, __('Suggested tags from', FB_ADMINIMIZE_TEXTDOMAIN ));
213 - if (class_exists('HTMLSpecialCharactersHelper'))
214 - array_push($metaboxes_names_page, __('HTML Special Characters'));
215 - if (class_exists('All_in_One_SEO_Pack'))
216 - array_push($metaboxes_names_page, 'All in One SEO Pack');
217 - if (function_exists('tdomf_edit_post_panel_admin_head'))
218 - array_push($metaboxes_names_page, 'TDOMF');
219 - if (function_exists('post_notification_form'))
220 - array_push($metaboxes_names_page, 'Post Notification');
221 -
222 - // add own page options
223 - $_mw_adminimize_own_page_values = _mw_adminimize_getOptionValue('_mw_adminimize_own_page_values');
224 - $_mw_adminimize_own_page_values = preg_split( "/\r\n/", $_mw_adminimize_own_page_values );
225 - foreach ( (array) $_mw_adminimize_own_page_values as $key => $_mw_adminimize_own_page_value ) {
226 - $_mw_adminimize_own_page_value = trim($_mw_adminimize_own_page_value);
227 - array_push($metaboxes_page, $_mw_adminimize_own_page_value);
228 - }
229 -
230 - $_mw_adminimize_own_page_options = _mw_adminimize_getOptionValue('_mw_adminimize_own_page_options');
231 - $_mw_adminimize_own_page_options = preg_split( "/\r\n/", $_mw_adminimize_own_page_options );
232 - foreach ( (array) $_mw_adminimize_own_page_options as $key => $_mw_adminimize_own_page_option ) {
233 - $_mw_adminimize_own_page_option = trim($_mw_adminimize_own_page_option);
234 - array_push($metaboxes_names_page, $_mw_adminimize_own_page_option);
235 - }
236 -
237 - // print menu, submenu
238 - if ( isset($wp_menu) && '' != $wp_menu ) {
239 -
240 - $i = 0;
241 - $x = 0;
242 - $class = '';
243 -
244 - $users = array( 0 => 'Profile', 1 => 'edit_users', 2 => 'profile.php', 3 => '', 4 => 'menu-top', 5 => 'menu-users', 6 => 'div' );
245 - //array_push( $menu, $users );
246 -
247 - foreach ($wp_menu as $item) {
248 -
249 - // non checked items
250 - if ( $item[2] === 'options-general.php' ) {
251 - //$disabled_item_adm = ' disabled="disabled"';
252 - $disabled_item_adm_hint = '<abbr title="' . __( 'After activate the check box it heavy attitudes will change.', FB_ADMINIMIZE_TEXTDOMAIN ) . '" style="cursor:pointer;"> ! </acronym>';
253 - } else {
254 - $disabled_item_adm = '';
255 - $disabled_item_adm_hint = '';
256 - }
257 -
258 - if ( $item[0] != '' ) {
259 - foreach($user_roles as $role) {
260 - // checkbox checked
261 - if ( isset( $disabled_menu_[$role]) && in_array($item[2], $disabled_menu_[$role]) ) {
262 - $checked_user_role_[$role] = ' checked="checked"';
263 - } else {
264 - $checked_user_role_[$role] = '';
265 - }
266 - }
267 -
268 - echo '<tr class="form-invalid">' . "\n";
269 - echo "\t" . '<th>' . $item[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $item[2] . ')</span> </th>';
270 - foreach ($user_roles as $role) {
271 - if ( $role != 'administrator' ) { // only admin disable items
272 - $disabled_item_adm = '';
273 - $disabled_item_adm_hint = '';
274 - }
275 - echo "\t" . '<td class="num">' . $disabled_item_adm_hint . '<input id="check_menu'. $role . $x .'" type="checkbox"' . $disabled_item_adm . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_menu_'. $role .'_items[]" value="' . $item[2] . '" />' . $disabled_item_adm_hint . '</td>' . "\n";
276 - }
277 - echo '</tr>';
278 -
279 - // only for user smaller administrator, change user-Profile-File
280 - if ( 'users.php' === $item[2] ) {
281 - $x++;
282 - echo '<tr class="form-invalid">' . "\n";
283 - echo "\t" . '<th>' . __('Profile') . ' <span style="color:#ccc; font-weight: 400;">(profile.php)</span> </th>';
284 - foreach ($user_roles as $role) {
285 - echo "\t" . '<td class="num"><input disabled="disabled" id="check_menu'. $role . $x .'" type="checkbox"' . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_menu_'. $role .'_items[]" value="profile.php" /></td>' . "\n";
286 - }
287 - echo '</tr>';
288 - }
289 -
290 - $x++;
291 -
292 - if ( !isset($wp_submenu[$item[2]]) )
293 - continue;
294 -
295 - // submenu items
296 - foreach ( $wp_submenu[ $item[2] ] as $subitem ) {
297 - $class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
298 - if ( $subitem[2] === 'adminimize/adminimize.php' ) {
299 - //$disabled_subitem_adm = ' disabled="disabled"';
300 - $disabled_subitem_adm_hint = '<abbr title="' . __( 'After activate the check box it heavy attitudes will change.', FB_ADMINIMIZE_TEXTDOMAIN ) . '" style="cursor:pointer;"> ! </acronym>';
301 - } else {
302 - $disabled_subitem_adm = '';
303 - $disabled_subitem_adm_hint = '';
304 - }
305 -
306 - echo '<tr' . $class . '>' . "\n";
307 - foreach ($user_roles as $role) {
308 - if ( isset($disabled_submenu_[$role]) )
309 - $checked_user_role_[$role] = ( in_array($subitem[2], $disabled_submenu_[$role] ) ) ? ' checked="checked"' : '';
310 - }
311 - echo '<td> &mdash; ' . $subitem[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $subitem[2] . ')</span> </td>' . "\n";
312 - foreach ($user_roles as $role) {
313 - if ( $role != 'administrator' ) { // only admin disable items
314 - $disabled_subitem_adm = '';
315 - $disabled_subitem_adm_hint = '';
316 - }
317 - echo '<td class="num">' . $disabled_subitem_adm_hint . '<input id="check_menu'. $role.$x .'" type="checkbox"' . $disabled_subitem_adm . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_submenu_'. $role .'_items[]" value="' . $subitem[2] . '" />' . $disabled_subitem_adm_hint . '</td>' . "\n";
318 - }
319 - echo '</tr>' . "\n";
320 - $x++;
321 - }
322 - $i++;
323 - $x++;
324 - }
325 - }
326 -
327 - } else {
328 - $myErrors = new _mw_adminimize_message_class();
329 - $myErrors = '<tr><td style="color: red;">' . $myErrors->get_error('_mw_adminimize_get_option') . '</td></tr>';
330 - echo $myErrors;
331 - } ?>
332 - </tbody>
333 - </table>
334 -
335 - <p id="submitbutton">
336 - <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
337 - </p>
338 - <p><a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php _e('scroll to top', FB_ADMINIMIZE_TEXTDOMAIN); ?></a><br class="clear" /></p>
339 -
340 - </div>
341 - </div>
342 - </div>
1 +<?php
2 +/**
3 + * @package Adminimize
4 + * @subpackage Menu, Submenu Options
5 + * @author Frank Bültge
6 + */
7 +if ( ! function_exists( 'add_action' ) ) {
8 + echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9 + exit;
10 +}
11 +?>
12 +
13 +<div id="poststuff" class="ui-sortable meta-box-sortables">
14 + <div class="postbox">
15 + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
16 + <h3 class="hndle" id="config_menu"><?php esc_attr_e( 'Menu Options', 'adminimize' ); ?></h3>
17 +
18 + <div class="inside">
19 + <br class="clear" />
20 +
21 + <table summary="config_menu" class="widefat">
22 + <thead>
23 + <tr>
24 + <th><?php esc_attr_e( 'Menu options - Menu, Submenu', 'adminimize' ); ?></th>
25 +
26 + <?php foreach ( $user_roles_names as $role_name ) { ?>
27 + <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
28 + echo '<br/>' . $role_name; ?></th>
29 + <?php } ?>
30 +
31 + </tr>
32 + <tr>
33 + <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
34 + <?php
35 + foreach ( $user_roles_names as $role_name ) {
36 + $role_name = strtolower( $role_name );
37 + $role_name = preg_replace( '/[^a-z0-9]+/', '', $role_name );
38 + echo '<td class="num">';
39 + echo '<span class="form-invalid">';
40 + echo '<input id="select_all" class="menu_options_' . $role_name
41 + . '" type="checkbox" name="" value="" />';
42 + echo '</span>';
43 + echo '<input id="select_all" class="submenu_options_' . $role_name
44 + . '" type="checkbox" name="" value="" />';
45 + echo '</td>' . "\n";
46 + } ?>
47 + </tr>
48 + </thead>
49 + <tbody>
50 + <?php
51 + $wp_menu = _mw_adminimize_get_option_value( 'mw_adminimize_default_menu' );
52 + $wp_submenu = _mw_adminimize_get_option_value( 'mw_adminimize_default_submenu' );
53 +
54 + // Object to array
55 + if ( is_object( $wp_submenu ) ) {
56 + $wp_submenu = get_object_vars( $wp_submenu );
57 + }
58 +
59 + if ( ! isset( $wp_menu ) || empty( $wp_menu ) ) {
60 + global $menu;
61 +
62 + $wp_menu = $menu;
63 + }
64 + if ( ! isset( $wp_submenu ) || empty( $wp_submenu ) ) {
65 + global $submenu;
66 +
67 + $wp_submenu = $submenu;
68 + }
69 +
70 + foreach ( $user_roles as $role ) {
71 + $disabled_metaboxes_post_[ $role ] = _mw_adminimize_get_option_value(
72 + 'mw_adminimize_disabled_metaboxes_post_' . $role . '_items'
73 + );
74 + $disabled_metaboxes_page_[ $role ] = _mw_adminimize_get_option_value(
75 + 'mw_adminimize_disabled_metaboxes_page_' . $role . '_items'
76 + );
77 + }
78 +
79 + // print menu, submenu
80 + if ( isset( $wp_menu ) && '' !== $wp_menu ) {
81 +
82 + $i = 0;
83 + $x = 0;
84 +
85 + $users = array(
86 + 0 => 'Profile',
87 + 1 => 'edit_users',
88 + 2 => 'profile.php',
89 + 3 => '',
90 + 4 => 'menu-top',
91 + 5 => 'menu-users',
92 + 6 => 'div'
93 + );
94 +
95 + foreach ( $wp_menu as $key => $item ) {
96 +
97 + // non checked items
98 + if ( $item[ 2 ] === 'options-general.php' ) {
99 + $disabled_item_adm_hint = '<abbr title="' . esc_attr__(
100 + 'After activate the check box it heavy attitudes will change.', 'adminimize'
101 + ) . '" style="cursor:pointer;"> ! </acronym>';
102 + } else {
103 + $disabled_item_adm = '';
104 + $disabled_item_adm_hint = '';
105 + }
106 +
107 + if ( '' !== $item[ 2 ] ) {
108 +
109 + if ( 'wp-menu-separator' === $item[ 4 ] ) {
110 + $item[ 0 ] = 'Separator';
111 + }
112 +
113 + foreach ( $user_roles as $role ) {
114 +
115 + // checkbox checked
116 + $checked_user_role_[ $role ] = '';
117 + if ( isset( $disabled_menu_[ $role ] )
118 + // @since 2015-11-11
119 + // Switch to the key and url of menu item.
120 + && _mw_adminimize_in_arrays( array( $key, $item[ 2 ] ), $disabled_menu_[ $role ] )
121 + ) {
122 + $checked_user_role_[ $role ] = ' checked="checked"';
123 + }
124 + }
125 +
126 + echo '<tr class="form-invalid">' . "\n";
127 + echo "\t";
128 + echo '<th>';
129 + echo '<b>&bull; ' . $item[ 0 ] . '</b> <small>' . esc_attr__(
130 + 'Group', 'adminimize'
131 + ) . '</small>';
132 + echo '<span>'
133 + . $key . '('
134 + . preg_replace(
135 + "#[%2].*#",
136 + '...',
137 + htmlentities( $item[ 2 ] )
138 + ) . ')</span>';
139 + echo '</th>';
140 +
141 + foreach ( $user_roles as $role ) {
142 + if ( $role !== 'administrator' ) { // only admin disable items
143 + $disabled_item_adm = '';
144 + $disabled_item_adm_hint = '';
145 + }
146 + echo "\t" . '<td class="num">' . $disabled_item_adm_hint . '<input id="check_menu'
147 + . $role . $x . '" class="menu_options_'
148 + . preg_replace( '/[^a-z0-9]+/', '', $role ) . '" type="checkbox"'
149 + . $disabled_item_adm . $checked_user_role_[ $role ]
150 + . ' name="mw_adminimize_disabled_menu_' . $role . '_items[]" value="'
151 + . htmlentities( $item[ 2 ] ) . '" />' . $disabled_item_adm_hint . '</td>' . "\n";
152 + }
153 + echo '</tr>';
154 +
155 + // Only for user smaller administrator, change user-Profile-File.
156 + if ( 'users.php' === $item[ 2 ] ) {
157 + $x ++;
158 + echo '<tr class="form-invalid">' . "\n";
159 + echo "\t" . '<th>' . esc_attr__( 'Profile' ) . ' <span>(profile.php)</span> </th>';
160 + foreach ( $user_roles as $role ) {
161 + echo "\t" . '<td class="num"><input disabled="disabled" id="check_menu'
162 + . $role . $x . '" class="menu_options_'
163 + . preg_replace( '/[^a-z0-9]+/', '', $role )
164 + . '" type="checkbox"' . $checked_user_role_[ $role ]
165 + . ' name="mw_adminimize_disabled_menu_' . $role
166 + . '_items[]" value="profile.php" /></td>' . "\n";
167 + }
168 + echo '</tr>';
169 + }
170 +
171 + $x ++;
172 +
173 + if ( ! isset( $wp_submenu[ $item[ 2 ] ] ) ) {
174 + continue;
175 + }
176 +
177 + // Loop about submenu items.
178 + foreach ( $wp_submenu[ $item[ 2 ] ] as $subkey => $subitem ) {
179 +
180 + // Special solutions for the Adminimize link, that it not works on settings site.
181 + if ( $subitem[ 2 ] === 'adminimize/adminimize.php' ) {
182 + //$disabled_subitem_adm = ' disabled="disabled"';
183 + $disabled_subitem_adm_hint = '<abbr title="'
184 + . esc_attr__(
185 + 'After activate the check box it heavy attitudes will change.', 'adminimize'
186 + )
187 + . '" style="cursor:pointer;"> ! </acronym>';
188 + } else {
189 + $disabled_subitem_adm = '';
190 + $disabled_subitem_adm_hint = '';
191 + }
192 +
193 + echo '<tr>' . "\n";
194 + foreach ( $user_roles as $role ) {
195 + // checkbox checked
196 + $checked_user_role_[ $role ] = '';
197 + if ( isset( $disabled_submenu_[ $role ] )
198 + // @since 2015-11-11
199 + // Switch to custom key and url of menu item.
200 + && _mw_adminimize_in_arrays(
201 + array( $item[ 2 ] . '__' . $subkey, $subitem[ 2 ] ),
202 + $disabled_submenu_[ $role ]
203 + )
204 + ) {
205 + $checked_user_role_[ $role ] = ' checked="checked"';
206 + }
207 + }
208 + echo '<td> &mdash; ' . $subitem[ 0 ] . ' <span>['
209 + . $subkey . ']('
210 + . preg_replace(
211 + "#[%2].*#",
212 + '...',
213 + htmlentities( $subitem[ 2 ] )
214 + ) . ')</span> </td>' . "\n";
215 +
216 + foreach ( $user_roles as $role ) {
217 + if ( $role !== 'administrator' ) { // only admin disable items
218 + $disabled_subitem_adm = '';
219 + $disabled_subitem_adm_hint = '';
220 + }
221 + echo '<td class="num">' . $disabled_subitem_adm_hint . '<input id="check_menu' . $role . $x
222 + . '" class="submenu_options_'
223 + . preg_replace( '/[^a-z0-9]+/', '', $role ) . '" type="checkbox"'
224 + . $disabled_subitem_adm . $checked_user_role_[ $role ]
225 + . ' name="mw_adminimize_disabled_submenu_' . $role . '_items[]" value="'
226 + . $item[ 2 ] . '__' . $subkey . '" />' . $disabled_subitem_adm_hint . '</td>' . "\n";
227 + }
228 + echo '</tr>' . "\n";
229 + $x ++;
230 + }
231 + $i ++;
232 + $x ++;
233 + }
234 + }
235 +
236 + } else {
237 + $myErrors = new _mw_adminimize_message_class();
238 + $myErrors = '<tr><td style="color: red;">' . $myErrors->get_error(
239 + '_mw_adminimize_get_option'
240 + ) . '</td></tr>';
241 + echo $myErrors;
242 + } ?>
243 + </tbody>
244 + </table>
245 +
246 + <p id="submitbutton">
247 + <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
248 + 'Update Options', 'adminimize'
249 + ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
250 + </p>
251 +
252 + <p>
253 + <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
254 + 'scroll to top', 'adminimize'
255 + ); ?></a><br class="clear" /></p>
256 +
257 + </div>
258 + </div>
259 +</div>
343 260