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
← All changes | inc-options/write_cp_options.php +44 -66 1.11.2 → 1.9.1 View file →
@@ -16,9 +16,9 @@
16 16 ?>
17 17
18 18 <div id="poststuff" class="ui-sortable meta-box-sortables">
19 19 <div class="postbox">
20 - <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
20 + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
21 21 <h3 class="hndle" id="config_edit_<?php echo $post_type; ?>">
22 22 <?php esc_attr_e( 'Write options', 'adminimize' );
23 23 echo ' - ' . $post_type_object->label; ?>
24 24 </h3>
@@ -26,17 +26,8 @@
26 26 <div class="inside">
27 27 <br class="clear" />
28 28
29 29 <table summary="config_edit_post" 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 30 <thead>
40 31 <tr>
41 32 <th><?php esc_attr_e( 'Write options', 'adminimize' );
42 33 echo ' - ' . $post_type_object->label ?></th>
@@ -48,12 +39,13 @@
48 39 </tr>
49 40 <tr>
50 41 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
51 42 <?php
52 - foreach ( $user_roles as $role_slug ) {
43 + foreach ( $user_roles_names as $role_name ) {
44 + $role_name = strtolower( $role_name );
45 + $role_name = preg_replace( '/[^a-z0-9]+/', '', $role_name );
53 46 echo '<td class="num">';
54 - echo '<input id="select_all" class="write_cp_options_' . $post_type .
55 - '_' . $role_slug
47 + echo '<input id="select_all" class="write_cp_options_' . $role_name
56 48 . '" type="checkbox" name="" value="" />';
57 49 echo '</td>' . "\n";
58 50 } ?>
59 51 </tr>
@@ -80,30 +72,26 @@
80 72 '#commentstatusdiv',
81 73 '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
82 74 );
83 75
84 - if ( ! empty( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] ) ) {
85 - foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
86 -
87 - if ( post_type_supports( $post_type, $post_type_support ) && 'excerpt' === $post_type_support ) {
76 + foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
77 + if ( post_type_supports( $post_type, $post_type_support ) ) {
78 + if ( 'excerpt' === $post_type_support ) {
88 79 $post_type_support = 'postexcerpt';
89 80 }
81 + }
82 + if ( 'page-attributes' === $post_type_support ) {
83 + $post_type_support = 'pageparentdiv';
84 + }
85 + if ( 'custom-fields' == $post_type_support ) {
86 + $post_type_support = 'postcustom';
87 + }
90 88
91 - if ( 'page-attributes' === $post_type_support ) {
92 - $post_type_support = 'pageparentdiv';
93 - }
94 -
95 - if ( 'custom-fields' === $post_type_support ) {
96 - $post_type_support = 'postcustom';
97 - }
98 -
99 - $metaboxes[] = '#' . $post_type_support
100 - . ', #' . $post_type_support
101 - . 'div, th.column-' . $post_type_support
102 - . ', td.' . $post_type_support; // td for raw in edit screen
103 - }
89 + $metaboxes[] = '#' . $post_type_support
90 + . ', #' . $post_type_support
91 + . 'div, th.column-' . $post_type_support
92 + . ', td.' . $post_type_support; // td for raw in edit screen
104 93 }
105 -
106 94 if ( function_exists( 'current_theme_supports' )
107 95 && current_theme_supports(
108 96 'post-thumbnails', $post_type
109 97 )
@@ -150,16 +138,13 @@
150 138 esc_attr__( 'Discussion' ),
151 139 esc_attr__( 'HTML Editor Button' ),
152 140 );
153 141
154 - if ( ! empty( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] ) ) {
155 - foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
156 - if ( post_type_supports( $post_type, $post_type_support ) ) {
157 - $metaboxes_names[] = ucfirst( $post_type_support );
158 - }
142 + foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
143 + if ( post_type_supports( $post_type, $post_type_support ) ) {
144 + $metaboxes_names[] = ucfirst( $post_type_support );
159 145 }
160 146 }
161 -
162 147 if ( function_exists( 'current_theme_supports' )
163 148 && current_theme_supports(
164 149 'post-thumbnails', 'post'
165 150 )
@@ -165,9 +150,8 @@
165 150 )
166 151 ) {
167 152 $metaboxes_names[] = esc_attr__( 'Post Thumbnail', 'adminimize' );
168 153 }
169 -
170 154 if ( function_exists( 'sticky_add_meta_box' ) ) {
171 155 $metaboxes_names[] = 'Post Sticky Status';
172 156 }
173 157
@@ -174,17 +158,17 @@
174 158 // quick edit names
175 159 $quickedit_names = array(
176 160 '<strong>' . esc_attr__( 'Quick Edit Link', 'adminimize' ) . '</strong>',
177 161 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Left', 'adminimize' ),
178 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'All Labels', 'adminimize' ),
179 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Author' ),
180 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Password and Private', 'adminimize' ),
162 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'All Labels', 'adminimize' ),
163 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Author' ),
164 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Password and Private', 'adminimize' ),
181 165 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Center', 'adminimize' ),
182 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Categories Title', 'adminimize' ),
183 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Categories List', 'adminimize' ),
166 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Categories Title', 'adminimize' ),
167 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Categories List', 'adminimize' ),
184 168 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Right', 'adminimize' ),
185 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Tags' ),
186 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Status, Sticky', 'adminimize' ),
169 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Tags' ),
170 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Status, Sticky', 'adminimize' ),
187 171 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Cancel/Save Button', 'adminimize' ),
188 172 );
189 173 $metaboxes_names = array_merge( $metaboxes_names, $quickedit_names );
190 174
@@ -221,9 +205,9 @@
221 205 );
222 206 $checked_user_role_[ $post_type . '_' . $role ] = (
223 207 isset( $disabled_metaboxes_[ $post_type . '_' . $role ] )
224 208 && in_array(
225 - $metabox, $disabled_metaboxes_[ $post_type . '_' . $role ], FALSE
209 + $metabox, $disabled_metaboxes_[ $post_type . '_' . $role ]
226 210 )
227 211 ) ? ' checked="checked"' : '';
228 212 }
229 213 echo '<tr>' . "\n";
@@ -228,17 +212,16 @@
228 212 }
229 213 echo '<tr>' . "\n";
230 214 echo '<td>' . $metaboxes_names[ $index ] .
231 215 ' <span>(' . $metabox . ')</span> </td>' . "\n";
232 - foreach ( $user_roles as $role_slug ) {
216 + foreach ( $user_roles as $role ) {
233 217 echo '<td class="num">';
234 218 echo '<input id="check_' .
235 - $post_type . $role_slug . $x . '" class="write_cp_options_'
236 - . $post_type .
237 - '_' . $role_slug . '" type="checkbox"' .
238 - $checked_user_role_[ $post_type . '_' . $role_slug ] .
219 + $post_type . $role . $x . '" class="write_cp_options_'
220 + . preg_replace( '/[^a-z0-9]+/', '', $role ) . '" type="checkbox"' .
221 + $checked_user_role_[ $post_type . '_' . $role ] .
239 222 ' name="mw_adminimize_disabled_metaboxes_' . $post_type .
240 - '_' . $role_slug . '_items[]" value="' . $metabox . '" />';
223 + '_' . $role . '_items[]" value="' . $metabox . '" />';
241 224 echo '</td>' . "\n";
242 225 }
243 226 echo '</tr>' . "\n";
244 227 $x ++;
@@ -256,16 +239,15 @@
256 239 <thead>
257 240 <tr>
258 241 <th>
259 242 <?php echo sprintf(
260 - esc_attr__( 'Your own %s options', 'adminimize' ),
261 - $post_type_object->label
243 + esc_attr__( 'Your own %s options', 'adminimize' ), $post_type_object->label
262 244 );
263 245 echo '<br />';
264 - esc_attr_e( 'Option name', 'adminimize' ); ?>
246 + esc_attr_e( 'ID or class', 'adminimize' ); ?>
265 247 </th>
266 248 <th><?php echo '<br />';
267 - esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th>
249 + esc_attr_e( 'Option', 'adminimize' ); ?></th>
268 250 </tr>
269 251 </thead>
270 252
271 253 <tbody>
@@ -285,29 +267,25 @@
285 267 style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
286 268 '_mw_adminimize_own_options_' . $post_type
287 269 ); ?></textarea>
288 270 <br />
289 - <label for="_mw_adminimize_own_options_<?php echo $post_type; ?>">
290 271 <?php esc_attr_e(
291 272 'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
292 273 'adminimize'
293 274 ); ?>
294 - </label>
295 275 </td>
296 276 <td>
297 - <textarea class="code" name="_mw_adminimize_own_values_<?php echo $post_type; ?>"
298 - cols="60" rows="3"
299 - id="_mw_adminimize_own_values_<?php echo $post_type; ?>"
300 - style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
301 - '_mw_adminimize_own_values_' . $post_type
302 - ); ?></textarea>
277 + <textarea class="code" name="_mw_adminimize_own_values_<?php echo $post_type; ?>"
278 + cols="60" rows="3"
279 + id="_mw_adminimize_own_values_<?php echo $post_type; ?>"
280 + style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
281 + '_mw_adminimize_own_values_' . $post_type
282 + ); ?></textarea>
303 283 <br />
304 - <label for="_mw_adminimize_own_values_<?php echo $post_type; ?>">
305 284 <?php esc_attr_e(
306 285 'Possible IDs or classes. Separate multiple values through a carriage return.',
307 286 'adminimize'
308 287 ); ?>
309 - </label>
310 288 </td>
311 289 </tr>
312 290 </tbody>
313 291 </table>