PluginProbe
Adminimize / 1.11.13
Adminimize v1.11.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 / inc-options / admin_bar_frontend.php

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