PluginProbe
Adminimize / 1.11.4
Adminimize v1.11.4
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_frontend.php

admin_bar_frontend.php in Adminimize 1.11.4, at inc-options/admin_bar_frontend.php

151 lines 4.8 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 Front end Options, settings page
5 * @author Frank Bültge
6 * @since 2015-07-03
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 if ( ! isset( $wp_admin_bar ) ) {
13 $wp_admin_bar = '';
14 }
15
16 if ( ! isset( $user_roles ) ) {
17 $user_roles = _mw_adminimize_get_all_user_roles();
18 }
19
20 if ( ! isset( $user_roles_names ) ) {
21 $user_roles_names = _mw_adminimize_get_all_user_roles_names();
22 }
23 ?>
24 <div id="poststuff" class="ui-sortable meta-box-sortables">
25 <div class="postbox">
26 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
27 <h3 class="hndle" id="admin_bar_frontend_options" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><?php
28 esc_attr_e( 'Admin Bar Front end Options', 'adminimize' ); ?></h3>
29
30 <div class="inside">
31 <br class="clear" />
32
33 <table summary="config_widget" class="widefat">
34 <colgroup>
35 <?php
36 $col = 0;
37 foreach ( $user_roles_names as $role_name ) {
38 echo '<col class="col' . $col . '">' . "\n";
39 $col ++;
40 }
41 ?>
42 </colgroup>
43 <thead>
44 <tr>
45 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
46 <?php
47 foreach ( $user_roles_names as $role_name ) { ?>
48 <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
49 echo '<br/>' . $role_name; ?></th>
50 <?php } ?>
51 </tr>
52 <tr>
53 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
54 <?php
55 foreach ( $user_roles as $role_slug ) {
56 echo '<td class="num">';
57 echo '<input id="select_all" class="admin_bar_frontend_' . $role_slug
58 . '" type="checkbox" value="" />';
59 echo '</td>' . "\n";
60 } ?>
61 </tr>
62 </thead>
63
64 <tbody>
65 <?php
66 foreach ( $user_roles as $role ) {
67 $disabled_admin_bar_frontend_option_[ $role ] = _mw_adminimize_get_option_value(
68 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items'
69 );
70 }
71
72 $x = 0;
73 // add items to array for select
74 // Use the hook to enhance for custom items, there was not in the list
75 $admin_bar_frontend_items = apply_filters(
76 'adminimize_admin_bar_frontend_items',
77 _mw_adminimize_get_option_value( 'mw_adminimize_admin_bar_frontend_nodes' )
78 );
79
80 $message = '';
81 if ( ! empty( $admin_bar_frontend_items ) && is_array( $admin_bar_frontend_items ) ) {
82 foreach ( $admin_bar_frontend_items as $key => $value ) {
83
84 $is_parent = ! empty( $value->parent );
85 $has_link = ! empty( $value->href );
86 // No title on the item.
87 if ( ! $value->title ) {
88 $value->title = '<b><i>' . esc_attr__( 'No Title!', 'adminimize' ) . '</i></b>';
89 }
90
91 $item_string = '&bull; ';
92 $before_title = '<b>';
93 $after_title = '</b> <small>' . esc_attr__( 'Group', 'adminimize' ) . '</small>';
94 if ( $is_parent ) {
95 $item_string = '&mdash; ';
96 $before_title = '';
97 $after_title = '';
98 }
99
100 $checked_user_role_ = array();
101 foreach ( $user_roles as $role ) {
102 $checked_user_role_[ $role ] = ( isset( $disabled_admin_bar_frontend_option_[ $role ] )
103 && in_array(
104 $key, $disabled_admin_bar_frontend_option_[ $role ]
105 )
106 ) ? ' checked="checked"' : '';
107 }
108
109 echo '<tr>' . "\n";
110 echo '<td>'. $before_title . $item_string . strip_tags( $value->title, '<strong><b><em><i>' )
111 . $after_title . ' <span>(' . $key . ')</span> </td>' . "\n";
112 foreach ( $user_roles as $role ) {
113 echo '<td class="num"><input id="check_post' . $role . $x
114 . '" class="admin_bar_frontend_' . $role . '" type="checkbox"'
115 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_admin_bar_frontend_'
116 . $role . '_items[]" value="' . $key . '" /></td>' . "\n";
117 }
118 echo '</tr>' . "\n";
119 $x ++;
120 }
121 }
122 $message = '<span style="font-size: 35px;">&#x261D;</span>'
123 . esc_attr__(
124 'You must open the front end of the site in this browser in order for the plugin to discover the Admin Bar items that are currently not visible.',
125 'adminimize'
126 );
127
128 ?>
129 </tbody>
130 </table>
131
132 <p><?php echo $message; ?></p>
133
134 <p id="submitbutton">
135 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
136 <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
137 'Update Options', 'adminimize'
138 ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
139 </p>
140
141 <p>
142 <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
143 style="margin:3px 0 0 30px;"><?php esc_attr_e(
144 'scroll to top', 'adminimize'
145 ); ?></a>
146 <br class="clear" />
147 </p>
148
149 </div>
150 </div>
151 </div>