PluginProbe
Adminimize / 1.11.6
Adminimize v1.11.6
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 / admin_bar.php

admin_bar.php in Adminimize 1.11.6, at inc-options/admin_bar.php

147 lines 4.7 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 Admin Bar Options, settings page
5 * @author Frank Bültge
6 * @since 1.8.1 01/10/2013
7 */
8 if ( ! function_exists( 'add_action' ) ) {
9 die( "Hi there! I'm just a part of plugin, not much I can do when called directly." );
10 }
11
12 /** @var $wp_admin_bar WP_Admin_Bar */
13 if ( ! isset( $wp_admin_bar ) ) {
14 $wp_admin_bar = '';
15 }
16
17 if ( ! isset( $user_roles ) ) {
18 $user_roles = _mw_adminimize_get_all_user_roles();
19 }
20
21 if ( ! isset( $user_roles_names ) ) {
22 $user_roles_names = _mw_adminimize_get_all_user_roles_names();
23 }
24 ?>
25 <div id="poststuff" class="ui-sortable meta-box-sortables">
26 <div class="postbox">
27 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
28 <h3 class="hndle" id="admin_bar_options" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><?php
29 esc_attr_e( 'Admin Bar Back end Options', 'adminimize' ); ?></h3>
30
31 <div class="inside">
32 <br class="clear" />
33
34 <table summary="config_widget" class="widefat">
35 <colgroup>
36 <?php
37 $col = 0;
38 foreach ( $user_roles_names as $role_name ) {
39 echo '<col class="col' . $col . '">' . "\n";
40 $col ++;
41 }
42 ?>
43 </colgroup>
44 <thead>
45 <tr>
46 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
47 <?php
48 foreach ( $user_roles_names as $role_name ) { ?>
49 <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
50 echo '<br/>' . $role_name; ?></th>
51 <?php } ?>
52 </tr>
53 <tr>
54 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
55 <?php
56 foreach ( $user_roles as $role_slug ) {
57 echo '<td class="num">';
58 echo '<input id="select_all" class="admin_bar_' . $role_slug
59 . '" type="checkbox" name="" value="" />';
60 echo '</td>' . "\n";
61 } ?>
62 </tr>
63 </thead>
64
65 <tbody>
66 <?php
67 foreach ( $user_roles as $role ) {
68 $disabled_admin_bar_option_[ $role ] = _mw_adminimize_get_option_value(
69 'mw_adminimize_disabled_admin_bar_' . $role . '_items'
70 );
71 }
72
73 $x = 0;
74 // add items to array for select
75 // Use the hook to enhance for custom items, there are not in the list
76 $admin_bar_items = apply_filters(
77 'adminimize_admin_bar_items', _mw_adminimize_get_option_value( 'mw_adminimize_admin_bar_nodes' )
78 );
79
80 $message = '';
81 if ( ! empty( $admin_bar_items ) && is_array( $admin_bar_items ) ) {
82 foreach ( $admin_bar_items as $key => $value ) {
83
84 $is_parent = ! empty( $value->parent );
85 $has_link = ! empty( $value->href );
86
87 // No title on the item.
88 if ( ! $value->title ) {
89 $value->title = '<b><i>' . esc_attr__( 'No Title!', 'adminimize' ) . '</i></b>';
90 }
91
92 $item_string = '&bull; ';
93 $before_title = '<b>';
94 $after_title = '</b> <small>' . esc_attr__( 'Group', 'adminimize' ) . '</small>';
95 if ( $is_parent ) {
96 $item_string = '&mdash; ';
97 $before_title = '';
98 $after_title = '';
99 }
100
101 $checked_user_role_ = array();
102 foreach ( $user_roles as $role ) {
103 $checked_user_role_[ $role ] = ( isset( $disabled_admin_bar_option_[ $role ] )
104 && in_array(
105 $key, $disabled_admin_bar_option_[ $role ], FALSE
106 )
107 ) ? ' checked="checked"' : '';
108 }
109
110 echo '<tr>' . "\n";
111 echo '<td>'. $before_title . $item_string . strip_tags( $value->title, '<strong><b><em><i>' )
112 . $after_title . ' <span>(' . $key . ')</span> </td>' . "\n";
113 foreach ( $user_roles as $role ) {
114 echo '<td class="num"><input id="check_post' . $role . $x . '" class="admin_bar_'
115 . $role . '" type="checkbox"'
116 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_admin_bar_'
117 . $role . '_items[]" value="' . $key . '" /></td>' . "\n";
118 }
119 echo '</tr>' . "\n";
120 $x ++;
121 }
122 }
123 $message = '<span style="font-size: 35px;">&#x261D;</span>'
124 . esc_attr__( 'Switch to another back-end page and come back to update the options to get all items of the admin bar in the back end area.', 'adminimize' );
125 ?>
126 </tbody>
127 </table>
128
129 <p><?php echo $message; ?></p>
130 <p id="submitbutton">
131 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
132 <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
133 'Update Options', 'adminimize'
134 ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
135 </p>
136
137 <p>
138 <a class="alignright button adminimize-scroltop" href="#"
139 style="margin:3px 0 0 30px;"><?php esc_attr_e(
140 'scroll to top', 'adminimize'
141 ); ?></a>
142 <br class="clear" />
143 </p>
144
145 </div>
146 </div>
147 </div>