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/global_options.php +181 -128 1.7.18 → 1.9.1 View file →
@@ -1,128 +1,181 @@
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 _e('Click to toggle'); ?>"><br/></div>
16 - <h3 class="hndle" id="global_options"><?php _e('Global options', FB_ADMINIMIZE_TEXTDOMAIN ); ?></h3>
17 - <div class="inside">
18 - <br class="clear" />
19 -
20 - <table summary="config_edit_post" class="widefat">
21 - <thead>
22 - <tr>
23 - <th><?php _e('Option', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th>
24 - <?php
25 - foreach ($user_roles_names as $role_name) { ?>
26 - <th><?php _e('Deactivate for', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br/>' . $role_name; ?></th>
27 - <?php } ?>
28 - </tr>
29 - </thead>
30 -
31 - <tbody>
32 - <?php
33 - foreach ($user_roles as $role) {
34 - $disabled_global_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_global_option_'. $role .'_items');
35 - }
36 -
37 - $global_options = array(
38 - '.show-admin-bar',
39 - '#favorite-actions',
40 - '#screen-meta',
41 - '#screen-options, #screen-options-link-wrap',
42 - '#contextual-help-link-wrap',
43 - '#your-profile .form-table fieldset'
44 - );
45 -
46 - $global_options_names = array(
47 - __('Admin Bar', FB_ADMINIMIZE_TEXTDOMAIN),
48 - __('Favorite Actions', FB_ADMINIMIZE_TEXTDOMAIN),
49 - __('Screen-Meta', FB_ADMINIMIZE_TEXTDOMAIN),
50 - __('Screen Options', FB_ADMINIMIZE_TEXTDOMAIN),
51 - __('Contextual Help', FB_ADMINIMIZE_TEXTDOMAIN),
52 - __('Admin Color Scheme', FB_ADMINIMIZE_TEXTDOMAIN)
53 - );
54 -
55 - $_mw_adminimize_own_values = _mw_adminimize_get_option_value('_mw_adminimize_own_values');
56 - $_mw_adminimize_own_values = preg_split( "/\r\n/", $_mw_adminimize_own_values );
57 - foreach ( (array) $_mw_adminimize_own_values as $key => $_mw_adminimize_own_value ) {
58 - $_mw_adminimize_own_value = trim($_mw_adminimize_own_value);
59 - array_push($global_options, $_mw_adminimize_own_value);
60 - }
61 -
62 - $_mw_adminimize_own_options = _mw_adminimize_get_option_value('_mw_adminimize_own_options');
63 - $_mw_adminimize_own_options = preg_split( "/\r\n/", $_mw_adminimize_own_options );
64 - foreach ( (array) $_mw_adminimize_own_options as $key => $_mw_adminimize_own_option ) {
65 - $_mw_adminimize_own_option = trim($_mw_adminimize_own_option);
66 - array_push($global_options_names, $_mw_adminimize_own_option);
67 - }
68 -
69 - $x = 0;
70 - foreach ($global_options as $index => $global_option) {
71 - if ( $global_option != '') {
72 - $checked_user_role_ = array();
73 - foreach ($user_roles as $role) {
74 - $checked_user_role_[$role] = ( isset($disabled_global_option_[$role]) && in_array($global_option, $disabled_global_option_[$role]) ) ? ' checked="checked"' : '';
75 - }
76 - echo '<tr>' . "\n";
77 - echo '<td>' . $global_options_names[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $global_option . ')</span> </td>' . "\n";
78 - foreach ($user_roles as $role) {
79 - echo '<td class="num"><input id="check_post'. $role . $x .'" type="checkbox"' . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_global_option_'. $role .'_items[]" value="' . $global_option . '" /></td>' . "\n";
80 - }
81 - echo '</tr>' . "\n";
82 - $x++;
83 - }
84 - }
85 - ?>
86 - </tbody>
87 - </table>
88 -
89 - <?php
90 - //your own global options
91 - ?>
92 - <br style="margin-top: 10px;" />
93 - <table summary="config_edit_post" class="widefat">
94 - <thead>
95 - <tr>
96 - <th><?php _e('Your own options', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br />'; _e('ID or class', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th>
97 - <th><?php echo '<br />'; _e('Option', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th>
98 - </tr>
99 - </thead>
100 -
101 - <tbody>
102 - <tr valign="top">
103 - <td colspan="2"><?php _e('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.', FB_ADMINIMIZE_TEXTDOMAIN ); ?></td>
104 - </tr>
105 - <tr valign="top">
106 - <td>
107 - <textarea name="_mw_adminimize_own_options" cols="60" rows="3" id="_mw_adminimize_own_options" style="width: 95%;" ><?php echo _mw_adminimize_get_option_value('_mw_adminimize_own_options'); ?></textarea>
108 - <br />
109 - <?php _e('Possible nomination for ID or class. Separate multiple nominations through a carriage return.', FB_ADMINIMIZE_TEXTDOMAIN ); ?>
110 - </td>
111 - <td>
112 - <textarea class="code" name="_mw_adminimize_own_values" cols="60" rows="3" id="_mw_adminimize_own_values" style="width: 95%;" ><?php echo _mw_adminimize_get_option_value('_mw_adminimize_own_values'); ?></textarea>
113 - <br />
114 - <?php _e('Possible IDs or classes. Separate multiple values through a carriage return.', FB_ADMINIMIZE_TEXTDOMAIN ); ?>
115 - </td>
116 - </tr>
117 - </tbody>
118 - </table>
119 -
120 - <p id="submitbutton">
121 - <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
122 - <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
123 - </p>
124 - <p><a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php _e('scroll to top', FB_ADMINIMIZE_TEXTDOMAIN); ?></a><br class="clear" /></p>
125 -
126 - </div>
127 - </div>
128 - </div>
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>