PluginProbe
Adminimize / 1.7.19
Adminimize v1.7.19
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
adminimize / inc-options / menu_options.php

menu_options.php in Adminimize 1.7.19, at inc-options/menu_options.php

158 lines 6.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 _e('Click to toggle'); ?>"><br/></div>
16 <h3 class="hndle" id="config_menu"><?php _e('Menu Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?></h3>
17 <div class="inside">
18 <br class="clear" />
19
20 <table summary="config_menu" class="widefat">
21 <thead>
22 <tr>
23 <th><?php _e('Menu options - Menu, <span style=\"font-weight: 400;\">Submenu</span>', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th>
24
25 <?php foreach ($user_roles_names as $role_name) { ?>
26 <th><?php _e('Deactivate for', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br/>' . $role_name; ?></th>
27 <?php } ?>
28
29 </tr>
30 </thead>
31 <tbody>
32 <?php
33 $wp_menu = _mw_adminimize_get_option_value('mw_adminimize_default_menu');
34 $wp_submenu = _mw_adminimize_get_option_value('mw_adminimize_default_submenu');
35
36 if ( empty($wp_menu) ) {
37 global $menu;
38
39 $wp_menu = $menu;
40 }
41 if ( !isset($wp_submenu) ) {
42 global $submenu;
43
44 $wp_submenu = $submenu;
45 }
46
47 foreach ($user_roles as $role) {
48 $disabled_metaboxes_post_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_metaboxes_post_'. $role .'_items');
49 $disabled_metaboxes_page_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_metaboxes_page_'. $role .'_items');
50 }
51
52 // print menu, submenu
53 if ( isset($wp_menu) && '' != $wp_menu ) {
54
55 $i = 0;
56 $x = 0;
57 $class = '';
58
59 $users = array( 0 => 'Profile', 1 => 'edit_users', 2 => 'profile.php', 3 => '', 4 => 'menu-top', 5 => 'menu-users', 6 => 'div' );
60 //array_push( $menu, $users );
61
62 foreach ($wp_menu as $item) {
63
64 // non checked items
65 if ( $item[2] === 'options-general.php' ) {
66 //$disabled_item_adm = ' disabled="disabled"';
67 $disabled_item_adm_hint = '<abbr title="' . __( 'After activate the check box it heavy attitudes will change.', FB_ADMINIMIZE_TEXTDOMAIN ) . '" style="cursor:pointer;"> ! </acronym>';
68 } else {
69 $disabled_item_adm = '';
70 $disabled_item_adm_hint = '';
71 }
72
73 if ( $item[0] != '' ) {
74 foreach($user_roles as $role) {
75 // checkbox checked
76 if ( isset( $disabled_menu_[$role]) && in_array($item[2], $disabled_menu_[$role]) ) {
77 $checked_user_role_[$role] = ' checked="checked"';
78 } else {
79 $checked_user_role_[$role] = '';
80 }
81 }
82
83 echo '<tr class="form-invalid">' . "\n";
84 echo "\t" . '<th>' . $item[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $item[2] . ')</span> </th>';
85 foreach ($user_roles as $role) {
86 if ( $role != 'administrator' ) { // only admin disable items
87 $disabled_item_adm = '';
88 $disabled_item_adm_hint = '';
89 }
90 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";
91 }
92 echo '</tr>';
93
94 // only for user smaller administrator, change user-Profile-File
95 if ( 'users.php' === $item[2] ) {
96 $x++;
97 echo '<tr class="form-invalid">' . "\n";
98 echo "\t" . '<th>' . __('Profile') . ' <span style="color:#ccc; font-weight: 400;">(profile.php)</span> </th>';
99 foreach ($user_roles as $role) {
100 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";
101 }
102 echo '</tr>';
103 }
104
105 $x++;
106
107 if ( !isset($wp_submenu[$item[2]]) )
108 continue;
109
110 // submenu items
111 foreach ( $wp_submenu[ $item[2] ] as $subitem ) {
112 $class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
113 if ( $subitem[2] === 'adminimize/adminimize.php' ) {
114 //$disabled_subitem_adm = ' disabled="disabled"';
115 $disabled_subitem_adm_hint = '<abbr title="' . __( 'After activate the check box it heavy attitudes will change.', FB_ADMINIMIZE_TEXTDOMAIN ) . '" style="cursor:pointer;"> ! </acronym>';
116 } else {
117 $disabled_subitem_adm = '';
118 $disabled_subitem_adm_hint = '';
119 }
120
121 echo '<tr' . $class . '>' . "\n";
122 foreach ($user_roles as $role) {
123 if ( isset($disabled_submenu_[$role]) )
124 $checked_user_role_[$role] = ( in_array($subitem[2], $disabled_submenu_[$role] ) ) ? ' checked="checked"' : '';
125 }
126 echo '<td> &mdash; ' . $subitem[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $subitem[2] . ')</span> </td>' . "\n";
127 foreach ($user_roles as $role) {
128 if ( $role != 'administrator' ) { // only admin disable items
129 $disabled_subitem_adm = '';
130 $disabled_subitem_adm_hint = '';
131 }
132 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";
133 }
134 echo '</tr>' . "\n";
135 $x++;
136 }
137 $i++;
138 $x++;
139 }
140 }
141
142 } else {
143 $myErrors = new _mw_adminimize_message_class();
144 $myErrors = '<tr><td style="color: red;">' . $myErrors->get_error('_mw_adminimize_get_option') . '</td></tr>';
145 echo $myErrors;
146 } ?>
147 </tbody>
148 </table>
149
150 <p id="submitbutton">
151 <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'" />
152 </p>
153 <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>
154
155 </div>
156 </div>
157 </div>
158