PluginProbe
Adminimize / 1.11.3
Adminimize v1.11.3
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.3, at inc-options/global_options.php

189 lines 6.2 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 Global 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
13 <div id="poststuff" class="ui-sortable meta-box-sortables">
14 <div class="postbox">
15 <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
16 <h3 class="hndle" id="global_options"><?php esc_attr_e( 'Global options', 'adminimize' ); ?></h3>
17
18 <div class="inside">
19 <br class="clear" />
20
21 <table summary="config_edit_post" class="widefat">
22 <colgroup>
23 <?php
24 $col = 0;
25 foreach ( $user_roles_names as $role_name ) {
26 echo '<col class="col' . $col . '">' . "\n";
27 $col ++;
28 }
29 ?>
30 </colgroup>
31 <thead>
32 <tr>
33 <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
34 <?php
35 foreach ( $user_roles_names as $role_name ) { ?>
36 <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
37 echo '<br/>' . $role_name; ?></th>
38 <?php } ?>
39 </tr>
40 <tr>
41 <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
42 <?php
43 foreach ( $user_roles as $role_slug ) {
44 echo '<td class="num">';
45 echo '<input id="select_all" class="global_options_' . $role_slug
46 . '" type="checkbox" name="" value="" />';
47 echo '</td>' . "\n";
48 } ?>
49 </tr>
50 </thead>
51
52 <tbody>
53 <?php
54 foreach ( $user_roles as $role ) {
55 $disabled_global_option_[ $role ] = _mw_adminimize_get_option_value(
56 'mw_adminimize_disabled_global_option_' . $role . '_items'
57 );
58 }
59
60 $global_options = array(
61 '.show-admin-bar',
62 '#favorite-actions',
63 '#screen-meta',
64 '#screen-options, #screen-options-link-wrap',
65 '#contextual-help-link-wrap',
66 '#your-profile .form-table fieldset',
67 '.admin-notices',
68 );
69
70 $global_options_names = array(
71 esc_attr__( 'Admin Bar', 'adminimize' ),
72 esc_attr__( 'Favorite Actions', 'adminimize' ),
73 esc_attr__( 'Screen-Meta', 'adminimize' ),
74 esc_attr__( 'Screen Options', 'adminimize' ),
75 esc_attr__( 'Contextual Help', 'adminimize' ),
76 esc_attr__( 'Admin Color Scheme', 'adminimize' ),
77 esc_attr__( 'Admin Notices', 'adminimize' ),
78 );
79
80 $_mw_adminimize_own_values = _mw_adminimize_get_option_value( '_mw_adminimize_own_values' );
81 $_mw_adminimize_own_values = preg_split( "/\r\n/", $_mw_adminimize_own_values );
82 foreach ( (array) $_mw_adminimize_own_values as $key => $_mw_adminimize_own_value ) {
83 $_mw_adminimize_own_value = trim( $_mw_adminimize_own_value );
84 $global_options[] = $_mw_adminimize_own_value;
85 }
86
87 $_mw_adminimize_own_options = _mw_adminimize_get_option_value( '_mw_adminimize_own_options' );
88 $_mw_adminimize_own_options = preg_split( "/\r\n/", $_mw_adminimize_own_options );
89 foreach ( (array) $_mw_adminimize_own_options as $key => $_mw_adminimize_own_option ) {
90 $_mw_adminimize_own_option = trim( $_mw_adminimize_own_option );
91 $global_options_names[] = $_mw_adminimize_own_option;
92 }
93
94 $x = 0;
95 foreach ( $global_options as $index => $global_option ) {
96
97 if ( empty( $global_option ) ) {
98 continue;
99 }
100
101 $checked_user_role_ = array();
102 foreach ( (array) $user_roles as $role ) {
103 $checked_user_role_[ $role ] = ( isset( $disabled_global_option_[ $role ] )
104 && in_array( $global_option, $disabled_global_option_[ $role ], true ) ) ? ' checked="checked"'
105 : '';
106 }
107 echo '<tr>' . "\n";
108 echo '<td>' . $global_options_names[ $index ] . ' <span>(' . $global_option . ')</span> </td>' . "\n";
109 foreach ( (array) $user_roles as $role ) {
110 echo '<td class="num"><input id="check_post' . $role . $x . '" class="global_options_'
111 . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox"'
112 . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_global_option_'
113 . $role . '_items[]" value="' . $global_option . '" /></td>' . "\n";
114 }
115 echo '</tr>' . "\n";
116 $x ++;
117
118 }
119 ?>
120 </tbody>
121 </table>
122
123 <?php
124 //your own global options
125 ?>
126 <br style="margin-top: 10px;" />
127 <table summary="config_edit_post" class="widefat">
128 <thead>
129 <tr>
130 <th><?php esc_attr_e( 'Your own options', 'adminimize' );
131 echo '<br />';
132 esc_attr_e( 'Option name', 'adminimize' ); ?></th>
133 <th><?php echo '<br />';
134 esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th>
135 </tr>
136 </thead>
137
138 <tbody>
139 <tr valign="top">
140 <td colspan="2"><?php esc_attr_e(
141 '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.',
142 'adminimize'
143 ); ?></td>
144 </tr>
145 <tr valign="top">
146 <td>
147 <textarea name="_mw_adminimize_own_options" cols="60" rows="3"
148 id="_mw_adminimize_own_options" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
149 '_mw_adminimize_own_options'
150 ); ?></textarea>
151 <br />
152 <?php esc_attr_e(
153 'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
154 'adminimize'
155 ); ?>
156 </td>
157 <td>
158 <textarea class="code" name="_mw_adminimize_own_values" cols="60" rows="3"
159 id="_mw_adminimize_own_values" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
160 '_mw_adminimize_own_values'
161 ); ?></textarea>
162 <br />
163 <?php esc_attr_e(
164 'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize'
165 ); ?>
166 </td>
167 </tr>
168 </tbody>
169 </table>
170
171 <p id="submitbutton">
172 <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
173 <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
174 'Update Options', 'adminimize'
175 ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
176 </p>
177
178 <p>
179 <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
180 style="margin:3px 0 0 30px;"><?php esc_attr_e(
181 'scroll to top', 'adminimize'
182 ); ?></a>
183 <br class="clear" />
184 </p>
185
186 </div>
187 </div>
188 </div>
189