PluginProbe
Adminimize / 1.9.1
Adminimize v1.9.1
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.9.1, at inc-options/admin_bar_frontend.php

150 lines 4.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 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_names ) ) {
17 $user_roles_names = _mw_adminimize_get_all_user_roles_names();
18 }
19 ?>
20 <div id="poststuff" class="ui-sortable meta-box-sortables">
21 <div class="postbox">
22 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
23 <h3 class="hndle" id="admin_bar_frontend_options" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><?php
24 esc_attr_e( 'Admin Bar Front end Options', 'adminimize' ); ?></h3>
25
26 <div class="inside">
27 <br class="clear" />
28
29 <table summary="config_widget" class="widefat">
30 <colgroup>
31 <?php
32 $col = 0;
33 foreach ( $user_roles_names as $role_name ) {
34 echo '<col class="col' . $col . '">' . "\n";
35 $col ++;
36 }
37 ?>
38 </colgroup>
39 <thead>
40 <tr>
41 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
42 <?php
43 foreach ( $user_roles_names as $role_name ) { ?>
44 <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
45 echo '<br/>' . $role_name; ?></th>
46 <?php } ?>
47 </tr>
48 <tr>
49 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
50 <?php
51 foreach ( $user_roles_names as $role_name ) {
52 $role_name = strtolower( $role_name );
53 echo '<td class="num">';
54 echo '<input id="select_all" class="admin_bar_frontend_' . $role_name
55 . '" type="checkbox" name="mw_adminimize_select_all' . $role_name . '" value="" />';
56 echo '</td>' . "\n";
57 } ?>
58 </tr>
59 </thead>
60
61 <tbody>
62 <?php
63 foreach ( $user_roles as $role ) {
64 $disabled_admin_bar_frontend_option_[ $role ] = _mw_adminimize_get_option_value(
65 'mw_adminimize_disabled_admin_bar_frontend_' . $role . '_items'
66 );
67 }
68
69 $x = 0;
70 // add items to array for select
71 // Use the hook to enhance for custom items, there was not in the list
72 $admin_bar_frontend_items = apply_filters(
73 'adminimize_admin_bar_frontend_items',
74 _mw_adminimize_get_option_value( 'mw_adminimize_admin_bar_frontend_nodes' )
75 );
76
77 $message = '';
78 if ( ! empty( $admin_bar_frontend_items ) && is_array( $admin_bar_frontend_items ) ) {
79 foreach ( $admin_bar_frontend_items as $key => $value ) {
80
81 $is_parent = ! empty( $value->parent );
82 $has_link = ! empty( $value->href );
83 // No title on the item.
84 if ( ! $value->title ) {
85 $value->title = '<b><i>' . esc_attr__( 'No Title!', 'adminimize' ) . '</i></b>';
86 }
87
88 $item_class = ' class="form-invalid"';
89 $item_string = '&bull; ';
90 $before_title = '<b>';
91 $after_title = '</b> <small>' . esc_attr__( 'Group', 'adminimize' ) . '</small>';
92 if ( $is_parent ) {
93 $item_class = '';
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' . $item_class . '>' . "\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 } else {
121 $message = '<span style="font-size: 35px;">&#x261D;</span>'
122 . esc_attr__(
123 'Display the front end include load or refresh of the site to get all items of the admin bar in the front end area.',
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" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
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>