PluginProbe
Adminimize / 1.11.11
Adminimize v1.11.11
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 / global_options.php

global_options.php in Adminimize 1.11.11, at inc-options/global_options.php

229 lines 6.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Global options area on the settings page.
4 *
5 * @package Adminimize
6 * @subpackage Global Options
7 * @author Frank Bültge
8 */
9
10 if ( ! function_exists( 'add_action' ) ) {
11 echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
12 exit;
13 }
14 ?>
15
16 <div id="poststuff" class="ui-sortable meta-box-sortables">
17 <div class="postbox">
18 <h3 class="hndle ui-sortable-handle" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>" id="global_options"><?php esc_attr_e( 'Global options', 'adminimize' ); ?></h3>
19
20 <div class="inside">
21 <br class="clear"/>
22
23 <table summary="config_edit_post" class="widefat">
24 <colgroup>
25 <?php
26 $col = 0;
27 if ( ! isset( $user_roles_names ) ) {
28 $user_roles_names = _mw_adminimize_get_all_user_roles_names();
29 }
30 foreach ( $user_roles_names as $role_name ) {
31 // phpcs:disable
32 echo '<col class="col' . $col . '">' . "\n";
33 $col ++;
34 }
35 ?>
36 </colgroup>
37 <thead>
38 <tr>
39 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
40 <?php
41 foreach ( $user_roles_names as $role_name ) {
42 ?>
43 <th>
44 <?php
45 esc_attr_e( 'Deactivate for', 'adminimize' );
46 echo '<br/>' . esc_html( $role_name );
47 ?>
48 </th>
49 <?php } ?>
50 </tr>
51 <tr>
52 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
53 <?php
54 if ( ! isset( $user_roles ) ) {
55 $user_roles = _mw_adminimize_get_all_user_roles();
56 }
57 foreach ( $user_roles as $role_slug ) {
58 echo '<td class="num">';
59 echo '<input id="select_all" class="global_options_' . esc_attr( $role_slug )
60 . '" type="checkbox" name="" value="" />';
61 echo '</td>' . "\n";
62 }
63 ?>
64 </tr>
65 </thead>
66
67 <tbody>
68 <?php
69 $disabled_global_option_ = array();
70 foreach ( $user_roles as $role ) {
71 $disabled_global_option_[ $role ] = _mw_adminimize_get_option_value(
72 'mw_adminimize_disabled_global_option_' . $role . '_items'
73 );
74 }
75
76 $global_options = array(
77 '.show-admin-bar',
78 '#favorite-actions',
79 '#screen-meta',
80 '#screen-options, #screen-options-link-wrap',
81 '#contextual-help-link-wrap',
82 '#your-profile .form-table fieldset',
83 '.admin-notices',
84 );
85
86 $global_options_names = array(
87 esc_attr__( 'Admin Bar', 'adminimize' ),
88 esc_attr__( 'Favorite Actions', 'adminimize' ),
89 esc_attr__( 'Screen-Meta', 'adminimize' ),
90 esc_attr__( 'Screen Options', 'adminimize' ),
91 esc_attr__( 'Contextual Help', 'adminimize' ),
92 esc_attr__( 'Admin Color Scheme', 'adminimize' ),
93 esc_attr__( 'Admin Notices', 'adminimize' ),
94 );
95
96 $_mw_adminimize_own_values = _mw_adminimize_get_option_value( '_mw_adminimize_own_values' );
97 $_mw_adminimize_own_values = preg_split( "/\r\n/", $_mw_adminimize_own_values );
98 foreach ( (array) $_mw_adminimize_own_values as $key => $_mw_adminimize_own_value ) {
99 $_mw_adminimize_own_value = trim( $_mw_adminimize_own_value );
100 $global_options[] = $_mw_adminimize_own_value;
101 }
102
103 $_mw_adminimize_own_options = _mw_adminimize_get_option_value( '_mw_adminimize_own_options' );
104 $_mw_adminimize_own_options = preg_split( "/\r\n/", $_mw_adminimize_own_options );
105 foreach ( (array) $_mw_adminimize_own_options as $key => $_mw_adminimize_own_option ) {
106 $_mw_adminimize_own_option = trim( $_mw_adminimize_own_option );
107 $global_options_names[] = $_mw_adminimize_own_option;
108 }
109
110 $x = 0;
111 foreach ( $global_options as $index => $global_option ) {
112
113 if ( empty( $global_option ) ) {
114 continue;
115 }
116
117 $global_option = esc_attr( $global_option );
118
119 $checked_user_role_ = array();
120 foreach ( (array) $user_roles as $role ) {
121 $checked_user_role_[ $role ] = _mw_adminimize_is_checked( $global_option, $disabled_global_option_[ $role ] );
122 }
123 echo '<tr>' . "\n";
124 echo '<td>' . $global_options_names[ $index ] . ' <span>(' . $global_option . ')</span> </td>' . "\n";
125 foreach ( (array) $user_roles as $role ) {
126 echo '<td class="num"><input id="check_post' . $role . $x . '" class="global_options_'
127 . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox" '
128 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_global_option_'
129 . $role . '_items[]" value="' . $global_option . '" /></td>' . "\n";
130 }
131 echo '</tr>' . "\n";
132 $x ++;
133
134 }
135 ?>
136 </tbody>
137 </table>
138
139 <?php
140 // your own global options.
141 ?>
142 <br style="margin-top: 10px;"/>
143 <table summary="config_edit_post" class="widefat">
144 <thead>
145 <tr>
146 <th>
147 <?php
148 esc_attr_e( 'Your own options', 'adminimize' );
149 echo '<br />';
150 esc_attr_e( 'Option name', 'adminimize' );
151 ?>
152 </th>
153 <th>
154 <?php
155 echo '<br />';
156 esc_attr_e( 'Selector, ID or class', 'adminimize' );
157 ?>
158 </th>
159 </tr>
160 </thead>
161
162 <tbody>
163 <tr valign="top">
164 <td colspan="2">
165 <?php
166 esc_attr_e(
167 'It is possible to add your own IDs or classes from elements and tags. You can find IDs and classes with the FireBug Add-on for Firefox. Assign a value and the associate name per line.',
168 'adminimize'
169 );
170 ?>
171 </td>
172 </tr>
173 <tr valign="top">
174 <td>
175 <label for="_mw_adminimize_own_options"></label>
176 <textarea name="_mw_adminimize_own_options" cols="60" rows="3"
177 id="_mw_adminimize_own_options" style="width: 95%;"><?php
178 echo _mw_adminimize_get_option_value('_mw_adminimize_own_options' ); ?></textarea>
179 <br/>
180 <?php
181 esc_attr_e(
182 'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
183 'adminimize'
184 );
185 ?>
186 </td>
187 <td>
188 <label for="_mw_adminimize_own_values"></label>
189 <textarea class="code" name="_mw_adminimize_own_values" cols="60" rows="3"
190 id="_mw_adminimize_own_values" style="width: 95%;"><?php
191 echo _mw_adminimize_get_option_value('_mw_adminimize_own_values' ); ?></textarea>
192 <br/>
193 <?php
194 esc_attr_e(
195 'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize'
196 );
197 ?>
198 </td>
199 </tr>
200 </tbody>
201 </table>
202
203 <p id="submitbutton">
204 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert"/>
205 <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="
206 <?php
207 esc_attr_e(
208 'Update Options', 'adminimize'
209 );
210 ?>
211 &raquo;"/><input type="hidden" name="page_options" value="'dofollow_timeout'"/>
212 </p>
213
214 <p>
215 <a class="alignright button adminimize-scroltop" href="#"
216 style="margin:3px 0 0 30px;">
217 <?php
218 esc_attr_e(
219 'scroll to top', 'adminimize'
220 );
221 ?>
222 </a>
223 <br class="clear"/>
224 </p>
225
226 </div>
227 </div>
228 </div>
229