PluginProbe
Adminimize / 1.7.13
Adminimize v1.7.13
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 / adminimize_admin_bar.php.new

adminimize_admin_bar.php.new in Adminimize 1.7.13, at adminimize_admin_bar.php.new

105 lines 3.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * setup admin bar
4 */
5
6 // test
7 function _fb_filter_admin_bar() {
8 global $wp_admin_bar;
9
10 //get array with userroles
11 $user_roles = get_all_user_roles();
12 $user_roles_names = get_all_user_roles_names();
13 $disabled_item_adm = '';
14 $disabled_item_adm_hint = '';
15
16 foreach ($user_roles as $role) {
17 $disabled_menu_[$role] = _mw_adminimize_getOptionValue('mw_adminimize_disabled_menu_'. $role .'_items');
18 $disabled_submenu_[$role] = _mw_adminimize_getOptionValue('mw_adminimize_disabled_submenu_'. $role .'_items');
19 }
20 ?>
21 <div id="poststuff" class="ui-sortable meta-box-sortables">
22 <div class="postbox">
23 <div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br/></div>
24 <h3 class="hndle" id="config_menu"><?php _e('WP Admin Bar Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?></h3>
25 <div class="inside">
26 <br class="clear" />
27
28 <table summary="config_menu" class="widefat">
29 <thead>
30 <tr>
31 <th><?php _e('Admin Bar options - Menu, <span style=\"font-weight: 400;\">Submenu</span>', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th>
32 <?php foreach ($user_roles_names as $role_name) { ?>
33 <th><?php _e('Deactivate for', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br/>' . $role_name; ?></th>
34 <?php } ?>
35 </tr>
36 </thead>
37 <tbody>
38 <?php
39 foreach ($wp_admin_bar->menu as $menu_item_id => $item) {
40 if ( isset($item) && $item != '' ) {
41
42 $x = 0;
43 $class = '';
44
45 foreach($user_roles as $role) {
46 // checkbox checked
47 if ( isset( $disabled_menu_[$role]) && in_array($menu_item_id, $disabled_menu_[$role]) ) {
48 $checked_user_role_[$role] = ' checked="checked"';
49 } else {
50 $checked_user_role_[$role] = '';
51 }
52 }
53
54 echo '<tr class="form-invalid">' . "\n";
55 echo "\t" . '<th>' . $item['title'] . ' <span style="color:#ccc; font-weight:400;">(' . $menu_item_id . ')</span> </th>';
56 foreach ($user_roles as $role) {
57 echo "\t" . '<td class="num">' .
58 '<input id="check_menu'. $role . $x .'" type="checkbox"' . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_menu_'. $role .'_items[]" value="' . $item['title'] . '" />'
59 . '</td>' . "\n";
60 }
61 echo '</tr>';
62
63 if ( !isset($item['children']) )
64 continue;
65
66 // submenu items
67 foreach ( $item['children'] as $subitem ) {
68 $class = ( ' class="alternate"' == $class ) ? '' : ' class="alternate"';
69 echo '<tr' . $class . '>' . "\n";
70 foreach ($user_roles as $role) {
71 if ( isset($disabled_submenu_[$role]) )
72 $checked_user_role_[$role] = ( in_array($subitem['id'], $disabled_submenu_[$role] ) ) ? ' checked="checked"' : '';
73 }
74 echo '<td> &mdash; ' . $subitem['title'] . ' <span style="color:#ccc; font-weight: 400;">(' . $subitem['id'] . ')</span> </td>' . "\n";
75 foreach ($user_roles as $role) {
76 echo '<td class="num">
77 <input id="check_menu'. $role.$x .'" type="checkbox"' . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_submenu_'. $role .'_items[]" value="' . $subitem['id'] . '" />' .
78 '</td>' . "\n";
79 }
80 echo '</tr>' . "\n";
81 $x++;
82 }
83 $x++;
84 }
85 }
86 ?>
87 </tbody>
88 </table>
89
90 <p id="submitbutton">
91 <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'" />
92 </p>
93 <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>
94
95 </div>
96 </div>
97 </div>
98
99 <?php
100 //$wp_admin_bar->remove_menu('edit-my-profile');
101 }
102 add_action('wp_before_admin_bar_render', '_fb_filter_admin_bar');
103
104 ?>
105