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_post_options.php +32 -44 1.11.8 → 1.9.1 View file →
@@ -7,21 +7,14 @@
7 7 if ( ! function_exists( 'add_action' ) ) {
8 8 echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9 9 exit;
10 10 }
11 -
12 -if ( ! isset( $user_roles ) ) {
13 - $user_roles = _mw_adminimize_get_all_user_roles();
14 -}
15 -
16 -if ( ! isset( $user_roles_names ) ) {
17 - $user_roles_names = _mw_adminimize_get_all_user_roles_names();
18 -}
19 11 ?>
20 12
21 13 <div id="poststuff" class="ui-sortable meta-box-sortables">
22 14 <div class="postbox">
23 - <h3 class="hndle ui-sortable-handle" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>" id="config_edit_post" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><?php
15 + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div>
16 + <h3 class="hndle" id="config_edit_post" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><?php
24 17 esc_attr_e( 'Write options - Post', 'adminimize' ); ?></h3>
25 18
26 19 <div class="inside">
27 20 <br class="clear" />
@@ -26,31 +19,27 @@
26 19 <div class="inside">
27 20 <br class="clear" />
28 21
29 22 <table summary="config_edit_post" class="widefat">
30 - <colgroup>
31 - <?php
32 - $col = 0;
33 - foreach ( (array) $user_roles_names as $role_name ) {
34 - echo '<col class="col' . $col . '">' . "\n";
35 - $col ++;
36 - }
37 - ?>
38 - </colgroup>
39 23 <thead>
40 24 <tr>
41 25 <th><?php esc_attr_e( 'Write options - Post', 'adminimize' ); ?></th>
42 26 <?php
43 - foreach ( (array) $user_roles_names as $role_name ) { ?>
44 - <th><?php esc_attr_e( 'Deactivate for', 'adminimize' ); echo '<br/>' . $role_name; ?></th>
27 + foreach ( $user_roles_names as $role_name ) { ?>
28 + <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
29 + echo '<br/>' . $role_name; ?></th>
45 30 <?php } ?>
46 31 </tr>
47 32 <tr>
48 33 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
49 34 <?php
50 - foreach ( (array) $user_roles as $role_slug ) {
51 - echo '<td class="num"><input id="select_all" class="write_post_options_'
52 - . esc_attr( $role_slug ) . '" type="checkbox" name="" value="" /></td>' . "\n";
35 + foreach ( $user_roles_names as $role_name ) {
36 + $role_name = strtolower( $role_name );
37 + $role_name = preg_replace( '/[^a-z0-9]+/', '', $role_name );
38 + echo '<td class="num">';
39 + echo '<input id="select_all" class="write_post_options_' . $role_name
40 + . '" type="checkbox" name="" value="" />';
41 + echo '</td>' . "\n";
53 42 } ?>
54 43 </tr>
55 44 </thead>
56 45
@@ -58,9 +47,8 @@
58 47 <?php
59 48 $metaboxes = array(
60 49 '#contextual-help-link-wrap',
61 50 '#screen-options-link-wrap',
62 - '.page-title-action',
63 51 '#title, #titlediv, th.column-title, td.title',
64 52 '#pageslugdiv',
65 53 '#tags, #tagsdiv,#tagsdivsb,#tagsdiv-post_tag, th.column-tags, td.tags',
66 54 '#categories, #categorydiv, #categorydivsb, th.column-categories, td.categories',
@@ -74,9 +62,9 @@
74 62 '#wp-word-count',
75 63 '#slugdiv,#edit-slug-box',
76 64 '#misc-publishing-actions',
77 65 '#commentstatusdiv',
78 - '#editor-toolbar #edButtonHTML, #quicktags, #content-html, .wp-switch-editor.switch-html',
66 + '#editor-toolbar #edButtonHTML, #quicktags, #content-html, .wp-switch-editor.switch-html'
79 67 );
80 68
81 69 $post_type = 'post';
82 70 foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
@@ -83,8 +71,9 @@
83 71 if ( post_type_supports( $post_type, $post_type_support )
84 72 && 'excerpt' === $post_type_support
85 73 ) {
86 74 $post_type_support = $post_type . 'excerpt';
75 +
87 76 }
88 77 if ( 'page-attributes' === $post_type_support ) {
89 78 $post_type_support = 'pageparentdiv';
90 79 }
@@ -129,17 +118,16 @@
129 118 );
130 119 $metaboxes = array_merge( $metaboxes, $quickedit_areas );
131 120
132 121 $metaboxes_names = array(
133 - esc_attr__( 'Help', 'adminimize' ),
134 - esc_attr__( 'Screen Options', 'adminimize' ),
135 - esc_attr__( 'Add New', 'adminimize' ),
122 + esc_attr__( 'Help' ),
123 + esc_attr__( 'Screen Options' ),
136 124 esc_attr__( 'Title', 'adminimize' ),
137 125 esc_attr__( 'Permalink', 'adminimize' ),
138 126 esc_attr__( 'Tags', 'adminimize' ),
139 127 esc_attr__( 'Categories', 'adminimize' ),
140 128 esc_attr__( 'Add New Category', 'adminimize' ),
141 - esc_attr__( 'Date', 'adminimize' ),
129 + esc_attr__( 'Date' ),
142 130 esc_attr__( 'Password Protect This Post', 'adminimize' ),
143 131 esc_attr__( 'Related, Shortcuts', 'adminimize' ),
144 132 esc_attr__( 'Messages', 'adminimize' ),
145 133 esc_attr__( 'h2: Advanced Options', 'adminimize' ),
@@ -146,10 +134,10 @@
146 134 esc_attr__( 'Media Buttons (all)', 'adminimize' ),
147 135 esc_attr__( 'Word count', 'adminimize' ),
148 136 esc_attr__( 'Post Slug', 'adminimize' ),
149 137 esc_attr__( 'Publish Actions', 'adminimize' ),
150 - esc_attr__( 'Discussion', 'adminimize' ),
151 - esc_attr__( 'HTML Editor Button', 'adminimize' )
138 + esc_attr__( 'Discussion' ),
139 + esc_attr__( 'HTML Editor Button' )
152 140 );
153 141
154 142 foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
155 143 if ( post_type_supports( $post_type, $post_type_support ) ) {
@@ -168,17 +156,17 @@
168 156 // quick edit names
169 157 $quickedit_names = array(
170 158 '<strong>' . esc_attr__( 'Quick Edit Link', 'adminimize' ) . '</strong>',
171 159 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Left', 'adminimize' ),
172 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'All Labels', 'adminimize' ),
173 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Author' ),
174 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Password and Private', 'adminimize' ),
160 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'All Labels', 'adminimize' ),
161 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Author' ),
162 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Password and Private', 'adminimize' ),
175 163 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Center', 'adminimize' ),
176 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Categories Title', 'adminimize' ),
177 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Categories List', 'adminimize' ),
164 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Categories Title', 'adminimize' ),
165 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Categories List', 'adminimize' ),
178 166 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Right', 'adminimize' ),
179 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Tags' ),
180 - '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Status, Sticky', 'adminimize' ),
167 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Tags' ),
168 + '&emsp;QE &rArr;' . ' ' . esc_attr__( 'Status, Sticky', 'adminimize' ),
181 169 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Cancel/Save Button', 'adminimize' )
182 170 );
183 171 $metaboxes_names = array_merge( $metaboxes_names, $quickedit_names );
184 172
@@ -203,9 +191,9 @@
203 191 $checked_user_role_ = array();
204 192 foreach ( $user_roles as $role ) {
205 193 $checked_user_role_[ $role ] = ( isset( $disabled_metaboxes_post_[ $role ] )
206 194 && in_array(
207 - $metabox, $disabled_metaboxes_post_[ $role ], FALSE
195 + $metabox, $disabled_metaboxes_post_[ $role ]
208 196 ) ) ? ' checked="checked"' : '';
209 197 }
210 198 echo '<tr>' . "\n";
211 199 echo '<td>' . $metaboxes_names[ $index ] . ' <span>(' . $metabox . ')</span> </td>' . "\n";
@@ -211,9 +199,9 @@
211 199 echo '<td>' . $metaboxes_names[ $index ] . ' <span>(' . $metabox . ')</span> </td>' . "\n";
212 200 foreach ( $user_roles as $role ) {
213 201 echo '<td class="num">';
214 202 echo '<input id="check_post' . $role . $x . '" class="write_post_options_'
215 - . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox"'
203 + . preg_replace( '/[^a-z0-9]+/', '', $role ) . '" type="checkbox"'
216 204 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_metaboxes_post_'
217 205 . $role . '_items[]" value="' . $metabox . '" />';
218 206 echo '</td>' . "\n";
219 207 }
@@ -231,13 +219,13 @@
231 219 <br style="margin-top: 10px;" />
232 220 <table summary="config_own_post" class="widefat">
233 221 <thead>
234 222 <tr>
235 - <th><?php esc_attr_e( 'Your own options', 'adminimize' );
223 + <th><?php esc_attr_e( 'Your own post options', 'adminimize' );
236 224 echo '<br />';
237 - esc_attr_e( 'Option name', 'adminimize' ); ?></th>
225 + esc_attr_e( 'ID or class', 'adminimize' ); ?></th>
238 226 <th><?php echo '<br />';
239 - esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th>
227 + esc_attr_e( 'Option', 'adminimize' ); ?></th>
240 228 </tr>
241 229 </thead>
242 230
243 231 <tbody>
@@ -278,9 +266,9 @@
278 266 ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
279 267 </p>
280 268
281 269 <p>
282 - <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
270 + <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
283 271 'scroll to top', 'adminimize'
284 272 ); ?></a><br class="clear" /></p>
285 273
286 274 </div>