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 / write_page_options.php

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

289 lines 11.0 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 Page Options
5 * @author Frank Bültge
6 */
7 if ( ! function_exists( 'add_action' ) ) {
8 echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9 exit;
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 ?>
20
21 <div id="poststuff" class="ui-sortable meta-box-sortables">
22 <div class="postbox">
23 <h3 class="hndle ui-sortable-handle" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>" id="config_edit_page"><?php esc_attr_e( 'Write options - Page', 'adminimize' ); ?></h3>
24 <div class="inside">
25 <br class="clear" />
26
27 <table summary="config_edit_page" class="widefat">
28 <colgroup>
29 <?php
30 $col = 0;
31 foreach ( (array) $user_roles_names as $role_name ) {
32 echo '<col class="col' . (int) $col . '">' . "\n";
33 $col ++;
34 }
35 ?>
36 </colgroup>
37 <thead>
38 <tr>
39 <th><?php esc_attr_e( 'Write options - Page', 'adminimize' ); ?></th>
40 <?php
41
42 foreach ( (array) $user_roles_names as $role_name ) {
43 echo '<th>' . esc_attr__( 'Deactivate for', 'adminimize' )
44 . '<br />' . esc_attr( $role_name ) . '</th>';
45 } ?>
46 </tr>
47 <tr>
48 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
49 <?php
50 foreach ( (array) $user_roles as $role_slug ) {
51 echo '<td class="num"><input id="select_all" class="write_page_options_'
52 . esc_attr( $role_slug ) . '" type="checkbox" name="" value="" /></td>' . "\n";
53 } ?>
54 </tr>
55 </thead>
56
57 <tbody>
58 <?php
59 // pages
60 $metaboxes_page = array(
61 '#contextual-help-link-wrap',
62 '#screen-options-link-wrap',
63 '.page-title-action',
64 '#title, #titlediv, th.column-title, td.title',
65 '#pageslugdiv',
66 '#pagepostcustom, #pagecustomdiv, #postcustom',
67 '#pagecommentstatusdiv, #commentsdiv, #comments, th.column-comments, td.comments',
68 '#date, #datediv, th.column-date, td.date, div.curtime',
69 '#pagepassworddiv',
70 '#pageparentdiv',
71 '#pagetemplatediv',
72 '#pageorderdiv',
73 '#pageauthordiv, #author, #authordiv, th.column-author, td.author',
74 '#revisionsdiv',
75 '.side-info',
76 '#notice',
77 '#post-body h2',
78 '#media-buttons, #wp-content-media-buttons',
79 '#wp-word-count',
80 '#slugdiv,#edit-slug-box',
81 '#misc-publishing-actions',
82 '#commentstatusdiv',
83 '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
84 );
85
86 $post_type = 'page';
87 foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
88 if ( post_type_supports( $post_type, $post_type_support ) ) {
89 if ( 'excerpt' === $post_type_support ) {
90 $post_type_support = $post_type . 'excerpt';
91 }
92 }
93 if ( 'page-attributes' === $post_type_support ) {
94 $post_type_support = 'pageparentdiv';
95 }
96 if ( 'custom-fields' == $post_type_support ) {
97 $post_type_support = $post_type . 'custom';
98 }
99 if ( 'post-formats' === $post_type_support ) {
100 $post_type_support = 'format';
101 }
102 $metaboxes[] = '#' . $post_type_support
103 . ', #' . $post_type_support
104 . 'div, th.column-' . $post_type_support
105 . ', td.' . $post_type_support; // td for raw in edit screen
106 }
107
108 if ( function_exists( 'current_theme_supports' )
109 && current_theme_supports(
110 'post-thumbnails', 'page'
111 )
112 ) {
113 $metaboxes_page[] = '#postimagediv';
114 }
115
116 // quick edit areas, id and class
117 $quickedit_page_areas = array(
118 'div.row-actions, div.row-actions .inline',
119 'fieldset.inline-edit-col-left',
120 'fieldset.inline-edit-col-left label',
121 'fieldset.inline-edit-col-left div.inline-edit-date',
122 'fieldset.inline-edit-col-left label.inline-edit-author',
123 'fieldset.inline-edit-col-left .inline-edit-group',
124 'fieldset.inline-edit-col-right',
125 'fieldset.inline-edit-col-right .inline-edit-col',
126 'fieldset.inline-edit-col-right .inline-edit-group',
127 'tr.inline-edit-page p.inline-edit-save'
128 );
129 $metaboxes_page = array_merge( $metaboxes_page, $quickedit_page_areas );
130
131 $metaboxes_names_page = array(
132 esc_attr__( 'Help', 'adminimize' ),
133 esc_attr__( 'Screen Options', 'adminimize' ),
134 esc_attr__( 'Add New', 'adminimize' ),
135 esc_attr__( 'Title', 'adminimize' ),
136 esc_attr__( 'Permalink', 'adminimize' ),
137 esc_attr__( 'Custom Fields', 'adminimize' ),
138 esc_attr__( 'Comments &amp; Pings', 'adminimize' ),
139 esc_attr__( 'Date', 'adminimize' ),
140 esc_attr__( 'Password Protect This Page', 'adminimize' ),
141 esc_attr__( 'Attributes', 'adminimize' ),
142 esc_attr__( 'Page Template', 'adminimize' ),
143 esc_attr__( 'Page Order', 'adminimize' ),
144 esc_attr__( 'Page Author', 'adminimize' ),
145 esc_attr__( 'Page Revisions', 'adminimize' ),
146 esc_attr__( 'Related', 'adminimize' ),
147 esc_attr__( 'Messages', 'adminimize' ),
148 esc_attr__( 'h2: Advanced Options', 'adminimize' ),
149 esc_attr__( 'Media Buttons (all)', 'adminimize' ),
150 esc_attr__( 'Word count', 'adminimize' ),
151 esc_attr__( 'Page Slug', 'adminimize' ),
152 esc_attr__( 'Publish Actions', 'adminimize' ),
153 esc_attr__( 'Discussion', 'adminimize' ),
154 esc_attr__( 'HTML Editor Button', 'adminimize' )
155 );
156
157 foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
158 if ( post_type_supports( $post_type, $post_type_support ) ) {
159 $metaboxes_names[] = ucfirst( $post_type_support );
160 }
161 }
162
163 if ( function_exists( 'current_theme_supports' )
164 && current_theme_supports(
165 'post-thumbnails', 'page'
166 )
167 ) {
168 $metaboxes_names_page[] = esc_attr__( 'Page Image', 'adminimize' );
169 }
170
171 // quick edit names
172 $quickedit_page_names = array(
173 '<strong>' . esc_attr__( 'Quick Edit Link', 'adminimize' ) . '</strong>',
174 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Left', 'adminimize' ),
175 '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'All Labels', 'adminimize' ),
176 '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Date', 'adminimize' ),
177 '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Author' ),
178 '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Password and Private', 'adminimize' ),
179 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Inline Edit Right', 'adminimize' ),
180 '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Parent, Order, Template', 'adminimize' ),
181 '&emsp;' . esc_attr__( 'QE', 'adminimize' ) . ' &rArr;' . ' ' . esc_attr__( 'Status', 'adminimize' ),
182 esc_attr__( 'QE', 'adminimize' ) . ' ' . esc_attr__( 'Cancel/Save Button', 'adminimize' )
183 );
184 $metaboxes_names_page = array_merge( $metaboxes_names_page, $quickedit_page_names );
185
186 // add own page options
187 $_mw_adminimize_own_page_values = _mw_adminimize_get_option_value( '_mw_adminimize_own_page_values' );
188 $_mw_adminimize_own_page_values = preg_split( "/\r\n/", $_mw_adminimize_own_page_values );
189 foreach ( (array) $_mw_adminimize_own_page_values as $key => $_mw_adminimize_own_page_value ) {
190 $_mw_adminimize_own_page_value = trim( $_mw_adminimize_own_page_value );
191 $metaboxes_page[] = $_mw_adminimize_own_page_value;
192 }
193
194 $_mw_adminimize_own_page_options = _mw_adminimize_get_option_value( '_mw_adminimize_own_page_options' );
195 $_mw_adminimize_own_page_options = preg_split( "/\r\n/", $_mw_adminimize_own_page_options );
196 foreach ( (array) $_mw_adminimize_own_page_options as $key => $_mw_adminimize_own_page_option ) {
197 $_mw_adminimize_own_page_option = trim( $_mw_adminimize_own_page_option );
198 $metaboxes_names_page[] = $_mw_adminimize_own_page_option;
199 }
200
201 $x = 0;
202 foreach ( $metaboxes_page as $index => $metabox ) {
203 if ( $metabox != '' ) {
204 $checked_user_role_ = array();
205 foreach ( $user_roles as $role ) {
206 $checked_user_role_[ $role ] = ( isset( $disabled_metaboxes_page_[ $role ] )
207 && in_array(
208 $metabox, $disabled_metaboxes_page_[ $role ]
209 ) ) ? ' checked="checked"' : '';
210 }
211 echo '<tr>' . "\n";
212 echo '<td>' . $metaboxes_names_page[ $index ] . ' <span>(' . $metabox . ')</span> </td>' . "\n";
213 foreach ( $user_roles as $role ) {
214 echo '<td class="num">';
215 echo '<input id="check_page' . $role . $x . '" class="write_page_options_'
216 . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox"'
217 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_metaboxes_page_'
218 . $role . '_items[]" value="' . $metabox . '" />';
219 echo '</td>' . "\n";
220 }
221 echo '</tr>' . "\n";
222 $x ++;
223 }
224 }
225 ?>
226 </tbody>
227 </table>
228
229 <?php
230 //ypur own page options
231 ?>
232 <br style="margin-top: 10px;" />
233 <table summary="config_own_page" class="widefat">
234 <thead>
235 <tr>
236 <th><?php esc_attr_e( 'Your own options', 'adminimize' );
237 echo '<br />';
238 esc_attr_e( 'Option name', 'adminimize' ); ?></th>
239 <th><?php echo '<br />';
240 esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th>
241 </tr>
242 </thead>
243
244 <tbody>
245 <tr valign="top">
246 <td colspan="2"><?php esc_attr_e(
247 '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.',
248 'adminimize'
249 ); ?></td>
250 </tr>
251 <tr valign="top">
252 <td>
253 <textarea name="_mw_adminimize_own_page_options" cols="60" rows="3" id="_mw_adminimize_own_page_options" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
254 '_mw_adminimize_own_page_options'
255 ); ?></textarea>
256 <br />
257 <?php esc_attr_e(
258 'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
259 'adminimize'
260 ); ?>
261 </td>
262 <td>
263 <textarea class="code" name="_mw_adminimize_own_page_values" cols="60" rows="3" id="_mw_adminimize_own_page_values" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
264 '_mw_adminimize_own_page_values'
265 ); ?></textarea>
266 <br />
267 <?php esc_attr_e(
268 'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize'
269 ); ?>
270 </td>
271 </tr>
272 </tbody>
273 </table>
274
275 <p id="submitbutton">
276 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
277 <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
278 'Update Options', 'adminimize'
279 ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
280 </p>
281 <p>
282 <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
283 'scroll to top', 'adminimize'
284 ); ?></a><br class="clear" /></p>
285
286 </div>
287 </div>
288 </div>
289