| 1 |
<?php |
| 2 |
/** |
| 3 |
* options-page in wp-admin |
| 4 |
*/ |
| 5 |
function _mw_adminimize_options() { |
| 6 |
global $wpdb, $_wp_admin_css_colors, $wp_version; |
| 7 |
|
| 8 |
_mw_adminimize_user_info == ''; |
| 9 |
|
| 10 |
// update options |
| 11 |
if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_insert') && $_POST['_mw_adminimize_save'] ) { |
| 12 |
|
| 13 |
if ( function_exists('current_user_can') && current_user_can('edit_plugins') ) { |
| 14 |
check_admin_referer('mw_adminimize_nonce'); |
| 15 |
|
| 16 |
_mw_adminimize_update(); |
| 17 |
|
| 18 |
} else { |
| 19 |
$myErrors = new _mw_adminimize_message_class(); |
| 20 |
$myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_access_denied') . '</p></div>'; |
| 21 |
wp_die($myErrors); |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
// deinstall options |
| 26 |
if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_deinstall') && ($_POST['_mw_adminimize_deinstall_yes'] != '_mw_adminimize_deinstall') ) { |
| 27 |
$myErrors = new _mw_adminimize_message_class(); |
| 28 |
$myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_deinstall_yes') . '</p></div>'; |
| 29 |
wp_die($myErrors); |
| 30 |
} |
| 31 |
|
| 32 |
if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_deinstall') && $_POST['_mw_adminimize_deinstall'] && ($_POST['_mw_adminimize_deinstall_yes'] == '_mw_adminimize_deinstall') ) { |
| 33 |
|
| 34 |
if ( function_exists('current_user_can') && current_user_can('edit_plugins') ) { |
| 35 |
check_admin_referer('mw_adminimize_nonce'); |
| 36 |
|
| 37 |
_mw_adminimize_deinstall(); |
| 38 |
|
| 39 |
$myErrors = new _mw_adminimize_message_class(); |
| 40 |
$myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error('_mw_adminimize_deinstall') . '</p></div>'; |
| 41 |
echo $myErrors; |
| 42 |
} else { |
| 43 |
$myErrors = new _mw_adminimize_message_class(); |
| 44 |
$myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_access_denied') . '</p></div>'; |
| 45 |
wp_die($myErrors); |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_set_theme') && $_POST['_mw_adminimize_save'] ) { |
| 50 |
if ( function_exists('current_user_can') && current_user_can('edit_users') ) { |
| 51 |
check_admin_referer('mw_adminimize_nonce'); |
| 52 |
|
| 53 |
_mw_adminimize_set_theme(); |
| 54 |
|
| 55 |
$myErrors = new _mw_adminimize_message_class(); |
| 56 |
$myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error('_mw_adminimize_set_theme') . '</p></div>'; |
| 57 |
echo $myErrors; |
| 58 |
} else { |
| 59 |
$myErrors = new _mw_adminimize_message_class(); |
| 60 |
$myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_access_denied') . '</p></div>'; |
| 61 |
wp_die($myErrors); |
| 62 |
} |
| 63 |
} |
| 64 |
?> |
| 65 |
<div class="wrap"> |
| 66 |
<h2><?php _e('Adminimize', 'adminimize'); ?></h2> |
| 67 |
<br class="clear" /> |
| 68 |
<div id="poststuff" class="ui-sortable"> |
| 69 |
<div class="postbox closed" > |
| 70 |
<h3><?php _e('Backend Options', 'adminimize'); ?></h3> |
| 71 |
<div class="inside"> |
| 72 |
|
| 73 |
<form name="backend_option" method="post" id="_mw_adminimize_options" action="?page=<?php echo $_GET['page'];?>" > |
| 74 |
<?php wp_nonce_field('mw_adminimize_nonce'); ?> |
| 75 |
<br class="clear" /> |
| 76 |
<table summary="config" class="widefat"> |
| 77 |
<tbody> |
| 78 |
<?php if ( version_compare( substr($wp_version, 0, 3), '2.7', '>=' ) ) { ?> |
| 79 |
<tr valign="top"> |
| 80 |
<td><?php _e('Favorite Actions', 'adminimize'); ?></td> |
| 81 |
<td> |
| 82 |
<?php $_mw_adminimize_favorite_actions = _mw_adminimize_getOptionValue('_mw_adminimize_favorite_actions'); ?> |
| 83 |
<select name="_mw_adminimize_favorite_actions"> |
| 84 |
<option value="0"<?php if ($_mw_adminimize_favorite_actions == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 85 |
<option value="1"<?php if ($_mw_adminimize_favorite_actions == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 86 |
</select> <?php _e('It is possible to hide the favorite-actions in the header.', 'adminimize'); ?> |
| 87 |
</td> |
| 88 |
</tr> |
| 89 |
<tr valign="top"> |
| 90 |
<td><?php _e('Screen Options', 'adminimize'); ?></td> |
| 91 |
<td> |
| 92 |
<?php $_mw_adminimize_screen_options = _mw_adminimize_getOptionValue('_mw_adminimize_screen_options'); ?> |
| 93 |
<select name="_mw_adminimize_screen_options"> |
| 94 |
<option value="0"<?php if ($_mw_adminimize_screen_options == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 95 |
<option value="1"<?php if ($_mw_adminimize_screen_options == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 96 |
</select> <?php _e('It is possible to hide the screen-options.', 'adminimize'); ?> |
| 97 |
</td> |
| 98 |
</tr> |
| 99 |
<?php } ?> |
| 100 |
<tr valign="top"> |
| 101 |
<td><?php _e('Menu Order', 'adminimize'); ?></td> |
| 102 |
<td> |
| 103 |
<?php $_mw_adminimize_menu_order = _mw_adminimize_getOptionValue('_mw_adminimize_menu_order'); ?> |
| 104 |
<select name="_mw_adminimize_menu_order"> |
| 105 |
<option value="0"<?php if ($_mw_adminimize_menu_order == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 106 |
<option value="1"<?php if ($_mw_adminimize_menu_order == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 107 |
</select> <?php _e('It is possible to set a new menu-order.', 'adminimize'); ?> |
| 108 |
</td> |
| 109 |
</tr> |
| 110 |
<tr valign="top"> |
| 111 |
<td><?php _e('Sidebar Width', 'adminimize'); ?></td> |
| 112 |
<td> |
| 113 |
<?php $_mw_adminimize_sidebar_wight = _mw_adminimize_getOptionValue('_mw_adminimize_sidebar_wight'); ?> |
| 114 |
<select name="_mw_adminimize_sidebar_wight"> |
| 115 |
<option value="0"<?php if ($_mw_adminimize_sidebar_wight == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 116 |
<option value="300"<?php if ($_mw_adminimize_sidebar_wight == '300') { echo ' selected="selected"'; } ?>>300px</option> |
| 117 |
<option value="400"<?php if ($_mw_adminimize_sidebar_wight == '400') { echo ' selected="selected"'; } ?>>400px</option> |
| 118 |
<option value="20"<?php if ($_mw_adminimize_sidebar_wight == '20') { echo ' selected="selected"'; } ?>>20%</option> |
| 119 |
<option value="30"<?php if ($_mw_adminimize_sidebar_wight == '30') { echo ' selected="selected"'; } ?>>30%</option> |
| 120 |
</select> <?php _e('The sidebar on the right side in the area <em>Edit</em> is configurable. Default is 200 pixel in the WordPress Theme <em>Classic</em> and <em>Fresh</em>', 'adminimize'); ?> |
| 121 |
</td> |
| 122 |
</tr> |
| 123 |
<?php |
| 124 |
/** |
| 125 |
* for WP 2.7 |
| 126 |
* new @ version 1.5 |
| 127 |
*/ |
| 128 |
if ( isset( $top_menu ) && ($top_menu != '') ) { |
| 129 |
?> |
| 130 |
<tr valign="top"> |
| 131 |
<td><?php _e('Dashmenu', 'adminimize'); ?></td> |
| 132 |
<td> |
| 133 |
<?php $_mw_adminimize_dashmenu = _mw_adminimize_getOptionValue('_mw_adminimize_dashmenu'); ?> |
| 134 |
<select name="_mw_adminimize_dashmenu"> |
| 135 |
<option value="0"<?php if ($_mw_adminimize_dashmenu == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 136 |
<option value="1"<?php if ($_mw_adminimize_dashmenu == '1') { echo ' selected="selected"'; } ?>><?php _e('Hide', 'adminimize'); ?></option> |
| 137 |
</select> <?php _e('The "Dashboard-area" is on the top left side of the backend. You can hide show.', 'adminimize'); ?> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
<?php } ?> |
| 141 |
<tr valign="top"> |
| 142 |
<td><?php _e('User-Info', 'adminimize'); ?></td> |
| 143 |
<td> |
| 144 |
<?php $_mw_adminimize_user_info = _mw_adminimize_getOptionValue('_mw_adminimize_user_info'); ?> |
| 145 |
<select name="_mw_adminimize_user_info"> |
| 146 |
<option value="0"<?php if ($_mw_adminimize_user_info == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 147 |
<option value="1"<?php if ($_mw_adminimize_user_info == '1') { echo ' selected="selected"'; } ?>><?php _e('Hide', 'adminimize'); ?></option> |
| 148 |
<option value="2"<?php if ($_mw_adminimize_user_info == '2') { echo ' selected="selected"'; } ?>><?php _e('Only logout', 'adminimize'); ?></option> |
| 149 |
<option value="3"<?php if ($_mw_adminimize_user_info == '3') { echo ' selected="selected"'; } ?>><?php _e('User & Logout', 'adminimize'); ?></option> |
| 150 |
</select> <?php _e('The "User-Info-area" is on the top right side of the backend. You can hide or reduced show.', 'adminimize'); ?> |
| 151 |
</td> |
| 152 |
</tr> |
| 153 |
<?php if ( ($_mw_adminimize_user_info == '') || ($_mw_adminimize_user_info == '1') || ($_mw_adminimize_user_info == '0') ) $disabled_item = ' disabled="disabled"' ?> |
| 154 |
<tr valign="top" class="form-invalid"> |
| 155 |
<td><?php _e('Change User-Info, redirect to', 'adminimize'); ?></td> |
| 156 |
<td> |
| 157 |
<?php $_mw_adminimize_ui_redirect = _mw_adminimize_getOptionValue('_mw_adminimize_ui_redirect'); ?> |
| 158 |
<select name="_mw_adminimize_ui_redirect" <?php echo $disabled_item ?>> |
| 159 |
<option value="0"<?php if ($_mw_adminimize_ui_redirect == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 160 |
<option value="1"<?php if ($_mw_adminimize_ui_redirect == '1') { echo ' selected="selected"'; } ?>><?php _e('Frontpage of the Blog', 'adminimize'); ?> |
| 161 |
</select> <?php _e('When the "User-Info-area" change it, then it is possible to change the redirect.', 'adminimize'); ?> |
| 162 |
</td> |
| 163 |
</tr> |
| 164 |
<tr valign="top"> |
| 165 |
<td><?php _e('Admin Color Scheme', 'adminimize'); ?></td> |
| 166 |
<td> |
| 167 |
<?php $mw_adminimize_disabled_colorscheme = _mw_adminimize_getOptionValue('mw_adminimize_disabled_colorscheme'); ?> |
| 168 |
<select name="mw_adminimize_disabled_colorscheme"> |
| 169 |
<option value="0"<?php if ($mw_adminimize_disabled_colorscheme == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 170 |
<option value="1"<?php if ($mw_adminimize_disabled_colorscheme == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 171 |
</select> <?php _e('It is possible to hide the Admin Color Schemes.', 'adminimize'); ?> |
| 172 |
</td> |
| 173 |
</tr> |
| 174 |
<tr valign="top"> |
| 175 |
<td><?php _e('Footer', 'adminimize'); ?></td> |
| 176 |
<td> |
| 177 |
<?php $_mw_adminimize_footer = _mw_adminimize_getOptionValue('_mw_adminimize_footer'); ?> |
| 178 |
<select name="_mw_adminimize_footer"> |
| 179 |
<option value="0"<?php if ($_mw_adminimize_footer == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 180 |
<option value="1"<?php if ($_mw_adminimize_footer == '1') { echo ' selected="selected"'; } ?>><?php _e('Hide', 'adminimize'); ?></option> |
| 181 |
</select> <?php _e('The Footer-area kann hide, include all links and details.', 'adminimize'); ?> |
| 182 |
</td> |
| 183 |
</tr> |
| 184 |
<tr valign="top"> |
| 185 |
<td><?php _e('WriteScroll', 'adminimize'); ?></td> |
| 186 |
<td> |
| 187 |
<?php $_mw_adminimize_writescroll = _mw_adminimize_getOptionValue('_mw_adminimize_writescroll'); ?> |
| 188 |
<select name="_mw_adminimize_writescroll"> |
| 189 |
<option value="0"<?php if ($_mw_adminimize_writescroll == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 190 |
<option value="1"<?php if ($_mw_adminimize_writescroll == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 191 |
</select> <?php _e('With the WriteScroll option active, these pages will automatically scroll to an optimal position for editing, when you visit Write Post or Write Page.', 'adminimize'); ?> |
| 192 |
</td> |
| 193 |
</tr> |
| 194 |
<tr valign="top"> |
| 195 |
<td><?php _e('Timestamp', 'adminimize'); ?></td> |
| 196 |
<td> |
| 197 |
<?php $_mw_adminimize_timestamp = _mw_adminimize_getOptionValue('_mw_adminimize_timestamp'); ?> |
| 198 |
<select name="_mw_adminimize_timestamp"> |
| 199 |
<option value="0"<?php if ($_mw_adminimize_timestamp == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 200 |
<option value="1"<?php if ($_mw_adminimize_timestamp == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 201 |
</select> <?php _e('Opens the post timestamp editing fields without you having to click the "Edit" link every time.', 'adminimize'); ?> |
| 202 |
</td> |
| 203 |
</tr> |
| 204 |
<tr valign="top"> |
| 205 |
<td><?php _e('Thickbox FullScreen', 'adminimize'); ?></td> |
| 206 |
<td> |
| 207 |
<?php $_mw_adminimize_tb_window = _mw_adminimize_getOptionValue('_mw_adminimize_tb_window'); ?> |
| 208 |
<select name="_mw_adminimize_tb_window"> |
| 209 |
<option value="0"<?php if ($_mw_adminimize_tb_window == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 210 |
<option value="1"<?php if ($_mw_adminimize_tb_window == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 211 |
</select> <?php _e('All Thickbox-function use the full area of the browser. Thickbox is for examble in upload media-files.', 'adminimize'); ?> |
| 212 |
</td> |
| 213 |
</tr> |
| 214 |
<tr valign="top"> |
| 215 |
<td><?php _e('Advice in Footer', 'adminimize'); ?></td> |
| 216 |
<td> |
| 217 |
<?php $_mw_adminimize_advice = _mw_adminimize_getOptionValue('_mw_adminimize_advice'); ?> |
| 218 |
<select name="_mw_adminimize_advice"> |
| 219 |
<option value="0"<?php if ($_mw_adminimize_advice == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?></option> |
| 220 |
<option value="1"<?php if ($_mw_adminimize_advice == '1') { echo ' selected="selected"'; } ?>><?php _e('Activate', 'adminimize'); ?></option> |
| 221 |
</select> |
| 222 |
<textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_advice_txt" id="_mw_adminimize_advice_txt" ><?php echo htmlspecialchars(stripslashes(_mw_adminimize_getOptionValue('_mw_adminimize_advice_txt'))); ?></textarea><br /><?php _e('In the Footer kann you display a advice for change the Default-design, (x)HTML is possible.', 'adminimize'); ?> |
| 223 |
</td> |
| 224 |
</tr> |
| 225 |
<?php |
| 226 |
// when remove dashboard |
| 227 |
$disabled_menu_subscriber = _mw_adminimize_getOptionValue('mw_adminimize_disabled_menu_subscriber_items'); |
| 228 |
$disabled_submenu_subscriber = _mw_adminimize_getOptionValue('mw_adminimize_disabled_submenu_subscriber_items'); |
| 229 |
$disabled_top_menu_subscriber = _mw_adminimize_getOptionValue('mw_adminimize_disabled_top_menu_subscriber_items'); |
| 230 |
$disabled_menu_contributor = _mw_adminimize_getOptionValue('mw_adminimize_disabled_menu_contributor_items'); |
| 231 |
$disabled_submenu_contributor = _mw_adminimize_getOptionValue('mw_adminimize_disabled_submenu_contributor_items'); |
| 232 |
$disabled_top_menu_contributor = _mw_adminimize_getOptionValue('mw_adminimize_disabled_top_menu_contributor_items'); |
| 233 |
$disabled_menu_author = _mw_adminimize_getOptionValue('mw_adminimize_disabled_menu_author_items'); |
| 234 |
$disabled_submenu_author = _mw_adminimize_getOptionValue('mw_adminimize_disabled_submenu_author_items'); |
| 235 |
$disabled_top_menu_author = _mw_adminimize_getOptionValue('mw_adminimize_disabled_top_menu_author_items'); |
| 236 |
$disabled_menu = _mw_adminimize_getOptionValue('mw_adminimize_disabled_menu_items'); |
| 237 |
$disabled_submenu = _mw_adminimize_getOptionValue('mw_adminimize_disabled_submenu_items'); |
| 238 |
$disabled_top_menu = _mw_adminimize_getOptionValue('mw_adminimize_disabled_top_menu_items'); |
| 239 |
$disabled_menu_adm = _mw_adminimize_getOptionValue('mw_adminimize_disabled_menu_adm_items'); |
| 240 |
$disabled_submenu_adm = _mw_adminimize_getOptionValue('mw_adminimize_disabled_submenu_adm_items'); |
| 241 |
$disabled_top_menu_adm = _mw_adminimize_getOptionValue('mw_adminimize_disabled_top_menu_adm_items'); |
| 242 |
|
| 243 |
$disabled_menu_all = array(); |
| 244 |
array_push($disabled_menu_all, $disabled_menu_subscriber); |
| 245 |
array_push($disabled_menu_all, $disabled_submenu_subscriber); |
| 246 |
array_push($disabled_menu_all, $disabled_top_menu_subscriber); |
| 247 |
array_push($disabled_menu_all, $disabled_menu_contributor); |
| 248 |
array_push($disabled_menu_all, $disabled_submenu_contributor); |
| 249 |
array_push($disabled_menu_all, $disabled_top_menu_contributor); |
| 250 |
array_push($disabled_menu_all, $disabled_menu_author); |
| 251 |
array_push($disabled_menu_all, $disabled_submenu_author); |
| 252 |
array_push($disabled_menu_all, $disabled_top_menu_author); |
| 253 |
array_push($disabled_menu_all, $disabled_menu); |
| 254 |
array_push($disabled_menu_all, $disabled_submenu); |
| 255 |
array_push($disabled_menu_all, $disabled_top_menu); |
| 256 |
array_push($disabled_menu_all, $disabled_menu_adm); |
| 257 |
array_push($disabled_menu_all, $disabled_submenu_adm); |
| 258 |
array_push($disabled_menu_all, $disabled_top_menu_adm); |
| 259 |
|
| 260 |
if ($disabled_menu_all != '') { |
| 261 |
if ( !recursive_in_array('index.php', $disabled_menu_all) ) { |
| 262 |
$disabled_item2 = ' disabled="disabled"'; |
| 263 |
} |
| 264 |
?> |
| 265 |
<tr valign="top" class="form-invalid"> |
| 266 |
<td><?php _e('Dashboard deaktivate, redirect to', 'adminimize'); ?></td> |
| 267 |
<td> |
| 268 |
<?php $_mw_adminimize_db_redirect = _mw_adminimize_getOptionValue('_mw_adminimize_db_redirect'); ?> |
| 269 |
<select name="_mw_adminimize_db_redirect"<?php echo $disabled_item2; ?>> |
| 270 |
<option value="0"<?php if ($_mw_adminimize_db_redirect == '0') { echo ' selected="selected"'; } ?>><?php _e('Default', 'adminimize'); ?> (profile.php)</option> |
| 271 |
<option value="1"<?php if ($_mw_adminimize_db_redirect == '1') { echo ' selected="selected"'; } ?>><?php _e('Manage Posts', 'adminimize'); ?> (edit.php)</option> |
| 272 |
<option value="2"<?php if ($_mw_adminimize_db_redirect == '2') { echo ' selected="selected"'; } ?>><?php _e('Manage Pages', 'adminimize'); ?> (edit-pages.php)</option> |
| 273 |
<option value="3"<?php if ($_mw_adminimize_db_redirect == '3') { echo ' selected="selected"'; } ?>><?php _e('Write Post', 'adminimize'); ?> (post-new.php)</option> |
| 274 |
<option value="4"<?php if ($_mw_adminimize_db_redirect == '4') { echo ' selected="selected"'; } ?>><?php _e('Write Page', 'adminimize'); ?> (page-new.php)</option> |
| 275 |
<option value="5"<?php if ($_mw_adminimize_db_redirect == '5') { echo ' selected="selected"'; } ?>><?php _e('Comments', 'adminimize'); ?> (edit-comments.php)</option> |
| 276 |
<option value="6"<?php if ($_mw_adminimize_db_redirect == '6') { echo ' selected="selected"'; } ?>><?php _e('other Page', 'adminimize'); ?></option> |
| 277 |
</select> |
| 278 |
<textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_db_redirect_txt" id="_mw_adminimize_db_redirect_txt" ><?php echo htmlspecialchars(stripslashes(_mw_adminimize_getOptionValue('_mw_adminimize_db_redirect_txt'))); ?></textarea> |
| 279 |
<br /><?php _e('You have deaktivate the Dashboard, please select a page for redirect?', 'adminimize'); ?> |
| 280 |
</td> |
| 281 |
</tr> |
| 282 |
<?php |
| 283 |
} |
| 284 |
?> |
| 285 |
</tbody> |
| 286 |
</table> |
| 287 |
<p id="submitbutton"> |
| 288 |
<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', 'adminimize'); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 289 |
</p> |
| 290 |
|
| 291 |
</div> |
| 292 |
</div> |
| 293 |
</div> |
| 294 |
|
| 295 |
<?php |
| 296 |
/** |
| 297 |
* for WP 2.7 |
| 298 |
* new @ version 1.5 |
| 299 |
*/ |
| 300 |
if ( isset( $top_menu ) && ($top_menu != '') ) { |
| 301 |
?> |
| 302 |
<div id="poststuff" class="ui-sortable"> |
| 303 |
<div class="postbox closed" > |
| 304 |
<h3 id="config_top_menu"><?php _e('Top Menu Options', 'adminimize'); ?></h3> |
| 305 |
<div class="inside"> |
| 306 |
<br class="clear" /> |
| 307 |
<table summary="config_top_menu" class="widefat"> |
| 308 |
<thead> |
| 309 |
<tr> |
| 310 |
<th><?php _e('Top Menu Options', 'adminimize'); ?></th> |
| 311 |
<th><?php _e('Deactivate for Subscriber', 'adminimize'); ?></th> |
| 312 |
<th><?php _e('Deactivate for Contributor', 'adminimize'); ?></th> |
| 313 |
<th><?php _e('Deactivate for Author', 'adminimize'); ?></th> |
| 314 |
<th><?php _e('Deactivate for Editor', 'adminimize'); ?></th> |
| 315 |
<th><?php _e('Deactivate for Administrator', 'adminimize'); ?></th> |
| 316 |
</tr> |
| 317 |
</thead> |
| 318 |
<tbody> |
| 319 |
<?php |
| 320 |
$top_menu = _mw_adminimize_getOptionValue('mw_adminimize_default_top_menu'); |
| 321 |
|
| 322 |
$x = 0; |
| 323 |
foreach ($top_menu as $item) { |
| 324 |
|
| 325 |
// checkbox checked |
| 326 |
if ( in_array($item[2], $disabled_top_menu_subscriber) ) { |
| 327 |
$checked_subscriber = ' checked="checked"'; |
| 328 |
} else { |
| 329 |
$checked_subscriber = ''; |
| 330 |
} |
| 331 |
|
| 332 |
// checkbox checked |
| 333 |
if ( in_array($item[2], $disabled_top_menu_contributor) ) { |
| 334 |
$checked_contributor = ' checked="checked"'; |
| 335 |
} else { |
| 336 |
$checked_contributor = ''; |
| 337 |
} |
| 338 |
|
| 339 |
// checkbox checked |
| 340 |
if ( in_array($item[2], $disabled_top_menu_author) ) { |
| 341 |
$checked_author = ' checked="checked"'; |
| 342 |
} else { |
| 343 |
$checked_author = ''; |
| 344 |
} |
| 345 |
|
| 346 |
// checkbox checked |
| 347 |
if ( in_array($item[2], $disabled_top_menu) ) { |
| 348 |
$checked = ' checked="checked"'; |
| 349 |
} else { |
| 350 |
$checked = ''; |
| 351 |
} |
| 352 |
|
| 353 |
// checkbox checked for admin |
| 354 |
if ( in_array($item[2], $disabled_top_menu_adm) ) { |
| 355 |
$checked_adm = ' checked="checked"'; |
| 356 |
} else { |
| 357 |
$checked_adm = ''; |
| 358 |
} |
| 359 |
|
| 360 |
echo '<tr>' . "\n"; |
| 361 |
echo "\t" . '<th>' . $item[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $item[2] . ')</span> </th>'; |
| 362 |
echo "\t" . '<td class="num"><input id="check_top_menusubscriber'. $x .'" type="checkbox"' . $checked_subscriber . ' name="mw_adminimize_disabled_top_menu_subscriber_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 363 |
echo "\t" . '<td class="num"><input id="check_top_menucontributor'. $x .'" type="checkbox"' . $checked_contributor . ' name="mw_adminimize_disabled_top_menu_contributor_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 364 |
echo "\t" . '<td class="num"><input id="check_top_menuauthor'. $x .'" type="checkbox"' . $checked_author . ' name="mw_adminimize_disabled_top_menu_author_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 365 |
echo "\t" . '<td class="num"><input id="check_top_menu'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_top_menu_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 366 |
echo "\t" . '<td class="num"><input id="check_top_menuadm'. $x .'" type="checkbox"' . $checked_adm . ' name="mw_adminimize_disabled_top_menu_adm_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 367 |
echo '</tr>'; |
| 368 |
$x++; |
| 369 |
} |
| 370 |
?> |
| 371 |
</tbody> |
| 372 |
</table> |
| 373 |
<p id="submitbutton"> |
| 374 |
<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', 'adminimize'); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 375 |
</p> |
| 376 |
|
| 377 |
</div> |
| 378 |
</div> |
| 379 |
</div> |
| 380 |
<?php } ?> |
| 381 |
|
| 382 |
<div id="poststuff" class="ui-sortable"> |
| 383 |
<div class="postbox closed" > |
| 384 |
<h3 id="config_menu"><?php _e('Menu Options', 'adminimize'); ?></h3> |
| 385 |
<div class="inside"> |
| 386 |
<br class="clear" /> |
| 387 |
<table summary="config_menu" class="widefat"> |
| 388 |
<thead> |
| 389 |
<tr> |
| 390 |
<th><?php _e('Menu options - Menu, <span style=\"font-weight: 400;\">Submenu</span>', 'adminimize'); ?></th> |
| 391 |
<th><?php _e('Deactivate for Subscriber', 'adminimize'); ?></th> |
| 392 |
<th><?php _e('Deactivate for Contributor', 'adminimize'); ?></th> |
| 393 |
<th><?php _e('Deactivate for Author', 'adminimize'); ?></th> |
| 394 |
<th><?php _e('Deactivate for Editor', 'adminimize'); ?></th> |
| 395 |
<th><?php _e('Deactivate for Administrator', 'adminimize'); ?></th> |
| 396 |
</tr> |
| 397 |
</thead> |
| 398 |
<tbody> |
| 399 |
<?php |
| 400 |
$menu = _mw_adminimize_getOptionValue('mw_adminimize_default_menu'); |
| 401 |
$submenu = _mw_adminimize_getOptionValue('mw_adminimize_default_submenu'); |
| 402 |
|
| 403 |
$disabled_metaboxes_post_subscriber = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_post_subscriber_items'); |
| 404 |
$disabled_metaboxes_page_subscriber = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_page_subscriber_items'); |
| 405 |
$disabled_metaboxes_post_contributor = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_post_contributor_items'); |
| 406 |
$disabled_metaboxes_page_contributor = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_page_contributor_items'); |
| 407 |
$disabled_metaboxes_post_author = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_post_author_items'); |
| 408 |
$disabled_metaboxes_page_author = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_page_author_items'); |
| 409 |
$disabled_metaboxes_post = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_post_items'); |
| 410 |
$disabled_metaboxes_page = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_page_items'); |
| 411 |
$disabled_metaboxes_post_adm = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_post_adm_items'); |
| 412 |
$disabled_metaboxes_page_adm = _mw_adminimize_getOptionValue('mw_adminimize_disabled_metaboxes_page_adm_items'); |
| 413 |
|
| 414 |
$metaboxes = array( |
| 415 |
'#pageslugdiv', |
| 416 |
'#tagsdiv,#tagsdivsb', |
| 417 |
'#categorydiv,#categorydivsb', |
| 418 |
'#category-add-toggle', |
| 419 |
'#postexcerpt', |
| 420 |
'#trackbacksdiv', |
| 421 |
'#postcustom', |
| 422 |
'#commentstatusdiv', |
| 423 |
'#passworddiv', |
| 424 |
'#authordiv', |
| 425 |
'#revisionsdiv', |
| 426 |
'.side-info', |
| 427 |
'#notice', |
| 428 |
'#post-body h2', |
| 429 |
'media_buttons' |
| 430 |
); |
| 431 |
|
| 432 |
if (class_exists('SimpleTagsAdmin')) |
| 433 |
array_push($metaboxes, '#suggestedtags'); |
| 434 |
if (function_exists('tc_post')) |
| 435 |
array_push($metaboxes, '#textcontroldiv'); |
| 436 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 437 |
array_push($metaboxes, '#htmlspecialchars'); |
| 438 |
if (class_exists('All_in_One_SEO_Pack')) |
| 439 |
array_push($metaboxes, '#postaiosp'); |
| 440 |
if (function_exists('tdomf_edit_post_panel_admin_head')) |
| 441 |
array_push($metaboxes, '#tdomf'); |
| 442 |
if (function_exists('post_notification_form')) |
| 443 |
array_push($metaboxes, '#post_notification'); |
| 444 |
if (function_exists('sticky_add_meta_box')) |
| 445 |
array_push($metaboxes, '#poststickystatusdiv'); |
| 446 |
|
| 447 |
$metaboxes_names = array( |
| 448 |
__('Permalink', 'adminimize'), |
| 449 |
__('Tags', 'adminimize'), |
| 450 |
__('Categories', 'adminimize'), |
| 451 |
__('Add New Category', 'adminimize'), |
| 452 |
__('Excerpt', 'adminimize'), |
| 453 |
__('Trackbacks', 'adminimize'), |
| 454 |
__('Custom Fields', 'adminimize'), |
| 455 |
__('Comments & Pings', 'adminimize'), |
| 456 |
__('Password Protect This Post', 'adminimize'), |
| 457 |
__('Post Author', 'adminimize'), |
| 458 |
__('Post Revisions', 'adminimize'), |
| 459 |
__('Related, Shortcuts', 'adminimize'), |
| 460 |
__('Messenges', 'adminimize'), |
| 461 |
__('h2: Advanced Options', 'adminimize'), |
| 462 |
__('Media Buttons (all)', 'adminimize') |
| 463 |
); |
| 464 |
|
| 465 |
if (class_exists('SimpleTagsAdmin')) |
| 466 |
array_push($metaboxes_names, __('Suggested tags from')); |
| 467 |
if (function_exists('tc_post')) |
| 468 |
array_push($metaboxes_names, __('Text Control')); |
| 469 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 470 |
array_push($metaboxes_names, __('HTML Special Characters')); |
| 471 |
if (class_exists('All_in_One_SEO_Pack')) |
| 472 |
array_push($metaboxes_names, 'All in One SEO Pack'); |
| 473 |
if (function_exists('tdomf_edit_post_panel_admin_head')) |
| 474 |
array_push($metaboxes_names, 'TDOMF'); |
| 475 |
if (function_exists('post_notification_form')) |
| 476 |
array_push($metaboxes_names, 'Post Notification'); |
| 477 |
if (function_exists('sticky_add_meta_box')) |
| 478 |
array_push($metaboxes, 'Post Sticky Status'); |
| 479 |
|
| 480 |
$metaboxes_page = array( |
| 481 |
'#pageslugdiv', |
| 482 |
'#pagepostcustom, #pagecustomdiv', |
| 483 |
'#pagecommentstatusdiv', |
| 484 |
'#pagepassworddiv', |
| 485 |
'#pageparentdiv', |
| 486 |
'#pagetemplatediv', |
| 487 |
'#pageorderdiv', |
| 488 |
'#pageauthordiv', |
| 489 |
'#revisionsdiv', |
| 490 |
'.side-info', |
| 491 |
'#notice', |
| 492 |
'#post-body h2', |
| 493 |
'media_buttons' |
| 494 |
); |
| 495 |
|
| 496 |
if (class_exists('SimpleTagsAdmin')) |
| 497 |
array_push($metaboxes_page, '#suggestedtags'); |
| 498 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 499 |
array_push($metaboxes_page, '#htmlspecialchars'); |
| 500 |
if (class_exists('All_in_One_SEO_Pack')) |
| 501 |
array_push($metaboxes_page, '#postaiosp'); |
| 502 |
if (function_exists('tdomf_edit_post_panel_admin_head')) |
| 503 |
array_push($metaboxes_page, '#tdomf'); |
| 504 |
if (function_exists('post_notification_form')) |
| 505 |
array_push($metaboxes_page, '#post_notification'); |
| 506 |
|
| 507 |
$metaboxes_names_page = array( |
| 508 |
__('Permalink', 'adminimize'), |
| 509 |
__('Custom Fields', 'adminimize'), |
| 510 |
__('Comments & Pings', 'adminimize'), |
| 511 |
__('Password Protect This Page', 'adminimize'), |
| 512 |
__('Page Parent', 'adminimize'), |
| 513 |
__('Page Template', 'adminimize'), |
| 514 |
__('Page Order', 'adminimize'), |
| 515 |
__('Page Author', 'adminimize'), |
| 516 |
__('Page Revisions', 'adminimize'), |
| 517 |
__('Related', 'adminimize'), |
| 518 |
__('Messenges', 'adminimize'), |
| 519 |
__('h2: Advanced Options', 'adminimize'), |
| 520 |
__('Media Buttons (all)', 'adminimize') |
| 521 |
); |
| 522 |
|
| 523 |
if (class_exists('SimpleTagsAdmin')) |
| 524 |
array_push($metaboxes_names_page, __('Suggested tags from', 'adminimize')); |
| 525 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 526 |
array_push($metaboxes_names_page, __('HTML Special Characters')); |
| 527 |
if (class_exists('All_in_One_SEO_Pack')) |
| 528 |
array_push($metaboxes_names_page, 'All in One SEO Pack'); |
| 529 |
if (function_exists('tdomf_edit_post_panel_admin_head')) |
| 530 |
array_push($metaboxes_names_page, 'TDOMF'); |
| 531 |
if (function_exists('post_notification_form')) |
| 532 |
array_push($metaboxes_names_page, 'Post Notification'); |
| 533 |
if (class_exists('HTMLSpecialCharactersHelper')) |
| 534 |
array_push($metaboxes_names_page, 'HTML Special Characters'); |
| 535 |
|
| 536 |
// print menu, submenu |
| 537 |
if ( isset($menu) && $menu != '') { |
| 538 |
|
| 539 |
$i = 0; |
| 540 |
$x = 0; |
| 541 |
foreach ($menu as $item) { |
| 542 |
|
| 543 |
// checkbox checked |
| 544 |
if ( isset($disabled_menu_subscriber) && in_array($item[2], $disabled_menu_subscriber) ) { |
| 545 |
$checked_subscriber = ' checked="checked"'; |
| 546 |
} else { |
| 547 |
$checked_subscriber = ''; |
| 548 |
} |
| 549 |
|
| 550 |
// checkbox checked |
| 551 |
if ( isset($disabled_menu_contributor) && in_array($item[2], $disabled_menu_contributor) ) { |
| 552 |
$checked_contributor = ' checked="checked"'; |
| 553 |
} else { |
| 554 |
$checked_contributor = ''; |
| 555 |
} |
| 556 |
|
| 557 |
// checkbox checked |
| 558 |
if ( isset($disabled_menu_author) && in_array($item[2], $disabled_menu_author) ) { |
| 559 |
$checked_author = ' checked="checked"'; |
| 560 |
} else { |
| 561 |
$checked_author = ''; |
| 562 |
} |
| 563 |
|
| 564 |
// checkbox checked |
| 565 |
if ( isset($disabled_menu) && in_array($item[2], $disabled_menu) ) { |
| 566 |
$checked = ' checked="checked"'; |
| 567 |
} else { |
| 568 |
$checked = ''; |
| 569 |
} |
| 570 |
|
| 571 |
// checkbox checked for admin |
| 572 |
if ( isset($disabled_menu_adm) && in_array($item[2], $disabled_menu_adm) ) { |
| 573 |
$checked_adm = ' checked="checked"'; |
| 574 |
} else { |
| 575 |
$checked_adm = ''; |
| 576 |
} |
| 577 |
|
| 578 |
// menu items |
| 579 |
// items disabled for user |
| 580 |
if ( $item[2] == 'options-general.php' ) { |
| 581 |
$disabled_item_adm = ' disabled="disabled"'; |
| 582 |
$checked_adm = ''; |
| 583 |
} else { |
| 584 |
$disabled_item_adm = ''; |
| 585 |
} |
| 586 |
|
| 587 |
echo '<tr class="form-invalid">' . "\n"; |
| 588 |
echo "\t" . '<th>' . $item[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $item[2] . ')</span> </th>'; |
| 589 |
echo "\t" . '<td class="num"><input id="check_menusubscriber'. $x .'" type="checkbox"' . $checked_subscriber . ' name="mw_adminimize_disabled_menu_subscriber_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 590 |
echo "\t" . '<td class="num"><input id="check_menucontributor'. $x .'" type="checkbox"' . $checked_contributor . ' name="mw_adminimize_disabled_menu_contributor_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 591 |
echo "\t" . '<td class="num"><input id="check_menuauthor'. $x .'" type="checkbox"' . $checked_author . ' name="mw_adminimize_disabled_menu_author_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 592 |
echo "\t" . '<td class="num"><input id="check_menu'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_menu_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 593 |
echo "\t" . '<td class="num"><input id="check_menuadm'. $x .'" type="checkbox"' . $disabled_item_adm . $checked_adm . ' name="mw_adminimize_disabled_menu_adm_items[]" value="' . $item[2] . '"/></td>' . "\n"; |
| 594 |
echo '</tr>'; |
| 595 |
$x++; |
| 596 |
|
| 597 |
if ( !isset($submenu[$item[2]]) ) |
| 598 |
continue; |
| 599 |
|
| 600 |
// submenu items |
| 601 |
foreach ( $submenu[ $item[2] ] as $subitem ) { |
| 602 |
|
| 603 |
// submenu items |
| 604 |
// items disabled for adm |
| 605 |
if ( $subitem[2] == 'adminimize/adminimize.php' ) { |
| 606 |
$disabled_subitem_adm = ' disabled="disabled"'; |
| 607 |
$checked_adm = ''; |
| 608 |
} else { |
| 609 |
$disabled_subitem_adm = ''; |
| 610 |
} |
| 611 |
|
| 612 |
echo '<tr>' . "\n"; |
| 613 |
|
| 614 |
if ( isset($disabled_submenu_subscriber) ) |
| 615 |
$checked_subscriber = ( in_array($subitem[2], $disabled_submenu_subscriber ) ) ? ' checked="checked"' : ''; |
| 616 |
if ( isset($disabled_submenu_contributor) ) |
| 617 |
$checked_contributor = ( in_array($subitem[2], $disabled_submenu_contributor ) ) ? ' checked="checked"' : ''; |
| 618 |
if ( isset($disabled_submenu_author) ) |
| 619 |
$checked_author = ( in_array($subitem[2], $disabled_submenu_author ) ) ? ' checked="checked"' : ''; |
| 620 |
if ( isset($disabled_submenu) ) |
| 621 |
$checked = ( in_array($subitem[2], $disabled_submenu ) ) ? ' checked="checked"' : ''; |
| 622 |
if ( isset($disabled_submenu_adm) ) |
| 623 |
$checked_adm = ( in_array($subitem[2], $disabled_submenu_adm ) ) ? ' checked="checked"' : ''; |
| 624 |
|
| 625 |
echo '<td> — ' . $subitem[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $subitem[2] . ')</span> </td>' . "\n"; |
| 626 |
echo "\t" . '<td class="num"><input id="check_menusubscriber'. $x .'" type="checkbox"' . $checked_subscriber . ' name="mw_adminimize_disabled_submenu_subscriber_items[]" value="' . $subitem[2] . '" /></td>' . "\n"; |
| 627 |
echo "\t" . '<td class="num"><input id="check_menucontributor'. $x .'" type="checkbox"' . $checked_contributor . ' name="mw_adminimize_disabled_submenu_contributor_items[]" value="' . $subitem[2] . '" /></td>' . "\n"; |
| 628 |
echo "\t" . '<td class="num"><input id="check_menuauthor'. $x .'" type="checkbox"' . $checked_author . ' name="mw_adminimize_disabled_submenu_author_items[]" value="' . $subitem[2] . '" /></td>' . "\n"; |
| 629 |
echo "\t" . '<td class="num"><input id="check_menu'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_submenu_items[]" value="' . $subitem[2] . '" /></td>' . "\n"; |
| 630 |
echo "\t" . '<td class="num"><input id="check_menuadm'. $x .'" type="checkbox"' . $disabled_subitem_adm . $checked_adm . ' name="mw_adminimize_disabled_submenu_adm_items[]" value="' . $subitem[2] . '" /></td>' . "\n"; |
| 631 |
echo '</tr>' . "\n"; |
| 632 |
$x++; |
| 633 |
} |
| 634 |
$i++; |
| 635 |
$x++; |
| 636 |
} |
| 637 |
echo '<tr>' . "\n"; |
| 638 |
echo '<th>' . __('All items', 'adminimize') . '</th>'; |
| 639 |
echo "\t" . '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menusubscriber" onClick="toggleCheckboxes_menusubscriber();"><a id="atoggleCheckboxes_menusubscriber" href="javascript:toggleCheckboxes_menusubscriber();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 640 |
echo "\t" . '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menucontributor" onClick="toggleCheckboxes_menucontributor();"><a id="atoggleCheckboxes_menucontributor" href="javascript:toggleCheckboxes_menucontributor();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 641 |
echo "\t" . '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menuauthor" onClick="toggleCheckboxes_menuauthor();"><a id="atoggleCheckboxes_menuauthor" href="javascript:toggleCheckboxes_menuauthor();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 642 |
echo "\t" . '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menu" onClick="toggleCheckboxes_menu();"><a id="atoggleCheckboxes_menu" href="javascript:toggleCheckboxes_menu();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 643 |
echo "\t" . '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menuadm" onClick="toggleCheckboxes_menuadm();"><a id="atoggleCheckboxes_menuadm" href="javascript:toggleCheckboxes_menuadm();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 644 |
echo '</tr>' . "\n"; |
| 645 |
|
| 646 |
} else { |
| 647 |
$myErrors = new _mw_adminimize_message_class(); |
| 648 |
$myErrors = '<tr><td style="color: red;">' . $myErrors->get_error('_mw_adminimize_get_option') . '</td></tr>'; |
| 649 |
echo $myErrors; |
| 650 |
} ?> |
| 651 |
</tbody> |
| 652 |
</table> |
| 653 |
<p id="submitbutton"> |
| 654 |
<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', 'adminimize'); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 655 |
</p> |
| 656 |
|
| 657 |
</div> |
| 658 |
</div> |
| 659 |
</div> |
| 660 |
|
| 661 |
<div id="poststuff" class="ui-sortable"> |
| 662 |
<div class="postbox closed" > |
| 663 |
<h3 id="config_edit"><?php _e('Write options - Post', 'adminimize'); ?></h3> |
| 664 |
<div class="inside"> |
| 665 |
<br class="clear" /> |
| 666 |
|
| 667 |
<table summary="config_edit_post" class="widefat"> |
| 668 |
<thead> |
| 669 |
<tr> |
| 670 |
<th><?php _e('Write options - Post', 'adminimize'); ?></th> |
| 671 |
<th><?php _e('Deactivate for Subscriber', 'adminimize'); ?></th> |
| 672 |
<th><?php _e('Deactivate for Contributor', 'adminimize'); ?></th> |
| 673 |
<th><?php _e('Deactivate for Author', 'adminimize'); ?></th> |
| 674 |
<th><?php _e('Deactivate for Editor', 'adminimize'); ?></th> |
| 675 |
<th><?php _e('Deactivate for Administrator', 'adminimize'); ?></th> |
| 676 |
</tr> |
| 677 |
</thead> |
| 678 |
|
| 679 |
<tbody> |
| 680 |
<?php |
| 681 |
$x = 0; |
| 682 |
foreach ($metaboxes as $index => $metabox) { |
| 683 |
$checked_subscriber = ( isset($disabled_metaboxes_post_subscriber) && in_array($metabox, $disabled_metaboxes_post_subscriber) ) ? ' checked="checked"' : ''; |
| 684 |
$checked_contributor = ( isset($disabled_metaboxes_post_contributor) && in_array($metabox, $disabled_metaboxes_post_contributor) ) ? ' checked="checked"' : ''; |
| 685 |
$checked_author = ( isset($disabled_metaboxes_post_author) && in_array($metabox, $disabled_metaboxes_post_author) ) ? ' checked="checked"' : ''; |
| 686 |
$checked = ( isset($disabled_metaboxes_post) && in_array($metabox, $disabled_metaboxes_post) ) ? ' checked="checked"' : ''; |
| 687 |
$checked_adm = ( isset($disabled_metaboxes_post_adm) && in_array($metabox, $disabled_metaboxes_post_adm) ) ? ' checked="checked"' : ''; |
| 688 |
|
| 689 |
echo '<tr>' . "\n"; |
| 690 |
echo '<td>' . $metaboxes_names[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $metabox . ')</span> </td>' . "\n"; |
| 691 |
echo '<td class="num"><input id="check_postsubscriber'. $x .'" type="checkbox"' . $checked_subscriber . ' name="mw_adminimize_disabled_metaboxes_post_subscriber_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 692 |
echo '<td class="num"><input id="check_postcontributor'. $x .'" type="checkbox"' . $checked_contributor . ' name="mw_adminimize_disabled_metaboxes_post_contributor_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 693 |
echo '<td class="num"><input id="check_postauthor'. $x .'" type="checkbox"' . $checked_author . ' name="mw_adminimize_disabled_metaboxes_post_author_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 694 |
echo '<td class="num"><input id="check_post'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_metaboxes_post_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 695 |
echo '<td class="num"><input id="check_postadm'. $x .'" type="checkbox"' . $checked_adm . ' name="mw_adminimize_disabled_metaboxes_post_adm_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 696 |
echo '</tr>' . "\n"; |
| 697 |
$x++; |
| 698 |
} |
| 699 |
?> |
| 700 |
<tr> |
| 701 |
<th><?php _e('All items', 'adminimize'); ?></th> |
| 702 |
<?php |
| 703 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_postsubscriber" onClick="toggleCheckboxes_postsubscriber();"><a id="atoggleCheckboxes_postsubscriber" href="javascript:toggleCheckboxes_postsubscriber();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 704 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_postcontributor" onClick="toggleCheckboxes_postcontributor();"><a id="atoggleCheckboxes_postcontributor" href="javascript:toggleCheckboxes_postcontributor();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 705 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_postauthor" onClick="toggleCheckboxes_postauthor();"><a id="atoggleCheckboxes_postauthor" href="javascript:toggleCheckboxes_postauthor();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 706 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_post" onClick="toggleCheckboxes_post();"><a id="atoggleCheckboxes_post" href="javascript:toggleCheckboxes_post();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 707 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_postadm" onClick="toggleCheckboxes_postadm();"><a id="atoggleCheckboxes_postadm" href="javascript:toggleCheckboxes_postadm();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 708 |
?> |
| 709 |
</tr> |
| 710 |
</tbody> |
| 711 |
</table> |
| 712 |
|
| 713 |
<p id="submitbutton"> |
| 714 |
<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" /> |
| 715 |
<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', 'adminimize'); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 716 |
</p> |
| 717 |
|
| 718 |
</div> |
| 719 |
</div> |
| 720 |
</div> |
| 721 |
|
| 722 |
<div id="poststuff" class="ui-sortable"> |
| 723 |
<div class="postbox closed" > |
| 724 |
<h3 id="config_edit"><?php _e('Write options - Page', 'adminimize'); ?></h3> |
| 725 |
<div class="inside"> |
| 726 |
<br class="clear" /> |
| 727 |
|
| 728 |
<table summary="config_edit_page" class="widefat"> |
| 729 |
<thead> |
| 730 |
<tr> |
| 731 |
<th><?php _e('Write options - Page', 'adminimize'); ?></th> |
| 732 |
<th><?php _e('Deactivate for Subscriber', 'adminimize'); ?></th> |
| 733 |
<th><?php _e('Deactivate for Contributor', 'adminimize'); ?></th> |
| 734 |
<th><?php _e('Deactivate for Author', 'adminimize'); ?></th> |
| 735 |
<th><?php _e('Deactivate for Editor', 'adminimize'); ?></th> |
| 736 |
<th><?php _e('Deactivate for Administrator', 'adminimize'); ?></th> |
| 737 |
</tr> |
| 738 |
</thead> |
| 739 |
|
| 740 |
<tbody> |
| 741 |
<?php |
| 742 |
$x = 0; |
| 743 |
foreach ($metaboxes_page as $index => $metabox) { |
| 744 |
$checked_subscriber = ( isset($disabled_metaboxes_page_subscriber) && in_array($metabox, $disabled_metaboxes_page_subscriber) ) ? ' checked="checked"' : ''; |
| 745 |
$checked_contributor = ( isset($disabled_metaboxes_page_contributor) && in_array($metabox, $disabled_metaboxes_page_contributor) ) ? ' checked="checked"' : ''; |
| 746 |
$checked_author = ( isset($disabled_metaboxes_page_author) && in_array($metabox, $disabled_metaboxes_page_author) ) ? ' checked="checked"' : ''; |
| 747 |
$checked = ( isset($disabled_metaboxes_page) && in_array($metabox, $disabled_metaboxes_page) ) ? ' checked="checked"' : ''; |
| 748 |
$checked_adm = ( isset($disabled_metaboxes_page_adm) && in_array($metabox, $disabled_metaboxes_page_adm) ) ? ' checked="checked"' : ''; |
| 749 |
|
| 750 |
echo '<tr>' . "\n"; |
| 751 |
echo '<td>' . $metaboxes_names_page[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $metabox . ')</span> </td>' . "\n"; |
| 752 |
echo '<td class="num"><input id="check_pagesubscriber'. $x .'" type="checkbox"' . $checked_subscriber . ' name="mw_adminimize_disabled_metaboxes_page_subscriber_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 753 |
echo '<td class="num"><input id="check_pagecontributor'. $x .'" type="checkbox"' . $checked_contributor . ' name="mw_adminimize_disabled_metaboxes_page_contributor_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 754 |
echo '<td class="num"><input id="check_pageauthor'. $x .'" type="checkbox"' . $checked_author . ' name="mw_adminimize_disabled_metaboxes_page_author_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 755 |
echo '<td class="num"><input id="check_page'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_metaboxes_page_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 756 |
echo '<td class="num"><input id="check_pageadm'. $x .'" type="checkbox"' . $checked_adm . ' name="mw_adminimize_disabled_metaboxes_page_adm_items[]" value="' . $metabox . '" /></td>' . "\n"; |
| 757 |
echo '</tr>' . "\n"; |
| 758 |
$x++; |
| 759 |
} |
| 760 |
?> |
| 761 |
<tr> |
| 762 |
<th><?php _e('All items', 'adminimize'); ?></th> |
| 763 |
<?php |
| 764 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_pagesubscriber" onClick="toggleCheckboxes_pagesubscriber();"><a id="atoggleCheckboxes_pagesubscriber" href="javascript:toggleCheckboxes_pagesubscriber();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 765 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_pagecontributor" onClick="toggleCheckboxes_pagecontributor();"><a id="atoggleCheckboxes_pagecontributor" href="javascript:toggleCheckboxes_pagecontributor();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 766 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_pageauthor" onClick="toggleCheckboxes_pageauthor();"><a id="atoggleCheckboxes_pageauthor" href="javascript:toggleCheckboxes_pageauthor();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 767 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_page" onClick="toggleCheckboxes_page();"><a id="atoggleCheckboxes_page" href="javascript:toggleCheckboxes_page();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 768 |
echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_pageadm" onClick="toggleCheckboxes_pageadm();"><a id="atoggleCheckboxes_pageadm" href="javascript:toggleCheckboxes_pageadm();"> ' . __('All', 'adminimize') . '</a></td>'; |
| 769 |
?> |
| 770 |
</tr> |
| 771 |
</tbody> |
| 772 |
</table> |
| 773 |
|
| 774 |
<p id="submitbutton"> |
| 775 |
<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" /> |
| 776 |
<input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', 'adminimize'); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> |
| 777 |
</p> |
| 778 |
</form> |
| 779 |
|
| 780 |
</div> |
| 781 |
</div> |
| 782 |
</div> |
| 783 |
|
| 784 |
<div id="poststuff" class="ui-sortable"> |
| 785 |
<div class="postbox closed" > |
| 786 |
<h3 id="set_theme"><?php _e('Set Theme', 'adminimize') ?></h3> |
| 787 |
<div class="inside"> |
| 788 |
<br class="clear" /> |
| 789 |
<form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="?page=<?php echo $_GET['page'];?>" > |
| 790 |
<?php wp_nonce_field('mw_adminimize_nonce'); ?> |
| 791 |
<table class="widefat"> |
| 792 |
<thead> |
| 793 |
<tr class="thead"> |
| 794 |
<th> </th> |
| 795 |
<th class="num"><?php _e('User-ID') ?></th> |
| 796 |
<th><?php _e('Username') ?></th> |
| 797 |
<th><?php _e('Display name publicly as') ?></th> |
| 798 |
<th><?php _e('Admin-Color Scheme') ?></th> |
| 799 |
<th><?php _e('User Level') ?></th> |
| 800 |
<th><?php _e('Role') ?></th> |
| 801 |
</tr> |
| 802 |
</thead> |
| 803 |
<tbody id="users" class="list:user user-list"> |
| 804 |
<?php |
| 805 |
$wp_user_search = $wpdb->get_results("SELECT ID, user_login, display_name FROM $wpdb->users ORDER BY ID"); |
| 806 |
|
| 807 |
$style = ''; |
| 808 |
foreach ( $wp_user_search as $userid ) { |
| 809 |
$user_id = (int) $userid->ID; |
| 810 |
$user_login = stripslashes($userid->user_login); |
| 811 |
$display_name = stripslashes($userid->display_name); |
| 812 |
$current_color = get_user_option('admin_color', $user_id); |
| 813 |
$user_level = (int) get_user_option($table_prefix . 'user_level', $user_id); |
| 814 |
$user_object = new WP_User($user_id); |
| 815 |
$roles = $user_object->roles; |
| 816 |
$role = array_shift($roles); |
| 817 |
|
| 818 |
$style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; |
| 819 |
$return = ''; |
| 820 |
$return .= '<tr>' . "\n"; |
| 821 |
$return .= "\t" . '<td><input type="checkbox" name="mw_adminimize_theme_items[]" value="' . $user_id . '" /></td>' . "\n"; |
| 822 |
$return .= "\t" . '<td class="num">'. $user_id .'</td>' . "\n"; |
| 823 |
$return .= "\t" . '<td>'. $user_login .'</td>' . "\n"; |
| 824 |
$return .= "\t" . '<td>'. $display_name .'</td>' . "\n"; |
| 825 |
$return .= "\t" . '<td>'. $current_color . '</td>' . "\n"; |
| 826 |
$return .= "\t" . '<td class="num">'. $user_level . '</td>' . "\n"; |
| 827 |
$return .= "\t" . '<td>'. $role . '</td>' . "\n"; |
| 828 |
$return .= '</tr>' . "\n"; |
| 829 |
|
| 830 |
print($return); |
| 831 |
} |
| 832 |
?> |
| 833 |
<tr valign="top"> |
| 834 |
<td> </td> |
| 835 |
<td> </td> |
| 836 |
<td> </td> |
| 837 |
<td> </td> |
| 838 |
<td> |
| 839 |
<select name="_mw_adminimize_set_theme"> |
| 840 |
<?php foreach ( $_wp_admin_css_colors as $color => $color_info ): ?> |
| 841 |
<option value="<?php echo $color; ?>"><?php echo $color_info->name . ' (' . $color . ')' ?></option> |
| 842 |
<?php endforeach; ?> |
| 843 |
</select> |
| 844 |
</td> |
| 845 |
<td> </td> |
| 846 |
<td> </td> |
| 847 |
</tr> |
| 848 |
</tbody> |
| 849 |
</table> |
| 850 |
<p id="submitbutton"> |
| 851 |
<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_set_theme" /> |
| 852 |
<input type="submit" name="_mw_adminimize_save" value="<?php _e('Set Theme', 'adminimize'); ?> »" class="button button-primary" /> |
| 853 |
</p> |
| 854 |
</form> |
| 855 |
|
| 856 |
</div> |
| 857 |
</div> |
| 858 |
</div> |
| 859 |
|
| 860 |
<div id="poststuff" class="ui-sortable"> |
| 861 |
<div class="postbox closed" > |
| 862 |
<h3 id="uninstall"><?php _e('Deinstall Options', 'adminimize') ?></h3> |
| 863 |
<div class="inside"> |
| 864 |
|
| 865 |
<p><?php _e('Use this option for clean your database from all entries of this plugin. When you deactivate the plugin, the deinstall of the plugin <strong>clean not</strong> all entries in the database.', 'adminimize'); ?></p> |
| 866 |
<form name="deinstall_options" method="post" id="_mw_adminimize_options_deinstall" action="?page=<?php echo $_GET['page'];?>"> |
| 867 |
<?php wp_nonce_field('mw_adminimize_nonce'); ?> |
| 868 |
<p id="submitbutton"> |
| 869 |
<input type="submit" name="_mw_adminimize_deinstall" value="<?php _e('Delete Options', 'adminimize'); ?> »" class="button-secondary" /> |
| 870 |
<input type="checkbox" name="_mw_adminimize_deinstall_yes" value="_mw_adminimize_deinstall" /> |
| 871 |
<input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_deinstall" /> |
| 872 |
</p> |
| 873 |
</form> |
| 874 |
|
| 875 |
</div> |
| 876 |
</div> |
| 877 |
</div> |
| 878 |
|
| 879 |
<div id="poststuff" class="ui-sortable"> |
| 880 |
<div class="postbox closed" > |
| 881 |
<h3 id="about"><?php _e('About the plugin', 'adminimize') ?></h3> |
| 882 |
<div class="inside"> |
| 883 |
|
| 884 |
<p><?php _e('Further information: Visit the <a href="http://bueltge.de/wordpress-admin-theme-adminimize/674/">plugin homepage</a> for further information or to grab the latest version of this plugin.', 'adminimize'); ?><br />© Copyright 2008 - <?php echo date("Y"); ?> <a href="http://bueltge.de">Frank Bültge</a> | <?php _e('You want to thank me? Visit my <a href="http://bueltge.de/wunschliste/">wishlist</a>.', 'adminimize'); ?></p> |
| 885 |
<p class="textright"><?php echo $wpdb->num_queries; ?>q, <?php timer_stop(1); ?>s</p> |
| 886 |
</div> |
| 887 |
</div> |
| 888 |
</div> |
| 889 |
|
| 890 |
<script type="text/javascript"> |
| 891 |
<!-- |
| 892 |
<?php if ( version_compare( substr($wp_version, 0, 3), '2.7', '<' ) ) { ?> |
| 893 |
jQuery('.postbox h3').prepend('<a class="togbox">+</a> '); |
| 894 |
<?php } ?> |
| 895 |
jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); } ); |
| 896 |
jQuery('.postbox.close-me').each(function(){ |
| 897 |
jQuery(this).addClass("closed"); |
| 898 |
}); |
| 899 |
//--> |
| 900 |
</script> |
| 901 |
|
| 902 |
</div> |
| 903 |
<?php |
| 904 |
} |
| 905 |
?> |