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
adminimize / inc-options / global_options.php

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

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