Adminimize - Version 1.3

Version Description

Download this release

Release Info

Developer Bueltge
Plugin Icon wp plugin Adminimize
Version 1.3
Comparing to
See all releases

Version 1.3

Files changed (2) hide show
  1. adminimize.php +957 -0
  2. adminimize_page.php +634 -0
adminimize.php ADDED
@@ -0,0 +1,957 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ Plugin Name: Adminimize
5
+ Plugin URI: http://bueltge.de/wordpress-admin-theme-adminimize/674/
6
+ Description: Visually compresses the administratrive header so that more admin page content can be initially seen. Also moves 'Dashboard' onto the main administrative menu because having it sit in the tip-top black bar was ticking me off and many other changes in the edit-area. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, with or without admins. You can also hide post meta controls on the edit-area to simplify the interface.
7
+ Author: Frank Bueltge
8
+ Author URI: http://bueltge.de/
9
+ Version: 1.3
10
+ Last Update: 01.08.2008 08:35:48
11
+ */
12
+
13
+ /**
14
+ * The stylesheet and the initial idea is from Eric A. Meyer, http://meyerweb.com/
15
+ * and i have written a plugin with many options on the basis
16
+ * of differently user-right and a user-friendly range in admin-area.
17
+ *
18
+ * The javascript for de/activate ist by Oliver Schl�be, http://www.schloebe.de
19
+ * - many thanks
20
+ */
21
+
22
+
23
+ // Pre-2.6 compatibility
24
+ if ( !defined('WP_CONTENT_URL') )
25
+ define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
26
+ if ( !defined('WP_CONTENT_DIR') )
27
+ define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
28
+
29
+
30
+ function _mw_adminimize_textdomain() {
31
+
32
+ if (function_exists('load_plugin_textdomain')) {
33
+ if ( !defined('WP_PLUGIN_DIR') ) {
34
+ load_plugin_textdomain('adminimize', str_replace( ABSPATH, '', dirname(__FILE__) ) . '/languages');
35
+ } else {
36
+ load_plugin_textdomain('adminimize', false, dirname(plugin_basename(__FILE__)) . '/languages');
37
+ }
38
+ }
39
+ }
40
+
41
+
42
+ /**
43
+ * some basic security with nonce
44
+ * @var $_mw_adminimize_nonce
45
+ */
46
+ if ( !function_exists('wp_nonce_field') ) {
47
+ function _mw_adminimize_nonce_field($action = -1) {
48
+ return;
49
+ }
50
+ $_mw_adminimize_nonce = -1;
51
+ } else {
52
+ function _mw_adminimize_nonce_field($action = -1) {
53
+ return wp_nonce_field($action);
54
+ }
55
+ $_mw_adminimize_nonce = '_mw_adminimize_update_key';
56
+ }
57
+
58
+
59
+ /**
60
+ * some basics for message
61
+ * @var $_mw_adminimize_nonce
62
+ */
63
+ class _mw_adminimize_message_class {
64
+ function _mw_adminimize_message_class() {
65
+ $this->localizionName = 'adminimize';
66
+ $this->errors = new WP_Error();
67
+ $this->initialize_errors();
68
+ }
69
+
70
+ /**
71
+ get_error - Returns an error message based on the passed code
72
+ Parameters - $code (the error code as a string)
73
+ Returns an error message
74
+ */
75
+ function get_error($code = '') {
76
+ $errorMessage = $this->errors->get_error_message($code);
77
+ if ($errorMessage == null) {
78
+ return __("Unbekannter Fehler.", $this->localizionName);
79
+ }
80
+ return $errorMessage;
81
+ }
82
+
83
+ // Initializes all the error messages
84
+ function initialize_errors() {
85
+ $this->errors->add('_mw_adminimize_update', __('Die Einstellungen wurden gespeichert.', 'adminimize'));
86
+ $this->errors->add('_mw_adminimize_access_denied', __('Du hast nicht ausreichend Rechte um diese Aktion durchzuf&uuml;hren!', 'adminimize'));
87
+ $this->errors->add('_mw_adminimize_deinstall', __('Die Einstellungen wurde gel&ouml;scht!', 'adminimize'));
88
+ $this->errors->add('_mw_adminimize_deinstall_yes', __('Checkbox setzen, wenn wirklich deinstalliert werden soll!', 'adminimize'));
89
+ $this->errors->add('_mw_adminimize_get_option', __('Menu und Submenu k&ouml;nnen nicht geladen werden!', 'adminimize'));
90
+ $this->errors->add('_mw_adminimize_set_theme', __('Backend-Theme wurde zugewiesen!', 'adminimize'));
91
+ }
92
+ }
93
+
94
+
95
+ /**
96
+ * check user-option and add new style
97
+ * @uses $pagenow
98
+ */
99
+ function _mw_adminimize_init() {
100
+ global $pagenow, $menu, $submenu;
101
+
102
+ $disabled_metaboxes_post = get_option('mw_adminimize_disabled_metaboxes_post');
103
+ $disabled_metaboxes_page = get_option('mw_adminimize_disabled_metaboxes_page');
104
+ $disabled_metaboxes_post_adm = get_option('mw_adminimize_disabled_metaboxes_post_adm');
105
+ $disabled_metaboxes_page_adm = get_option('mw_adminimize_disabled_metaboxes_page_adm');
106
+
107
+ $_mw_admin_color = get_user_option('admin_color');
108
+
109
+ if ( ($_mw_admin_color == 'mw_fresh') ||
110
+ ($_mw_admin_color == 'mw_classic') ||
111
+ ($_mw_admin_color == 'mw_colorblind') ||
112
+ ($_mw_admin_color == 'mw_grey') ||
113
+ ($_mw_admin_color == 'mw_fresh_ozh_am') ||
114
+ ($_mw_admin_color == 'mw_classic_ozh_am') ||
115
+ ($_mw_admin_color == 'mw_fresh_lm') ||
116
+ ($_mw_admin_color == 'mw_classic_lm') ||
117
+ ($_mw_admin_color == 'mw_wp23')
118
+ ) {
119
+ if ( ($_mw_admin_color == 'mw_fresh') ||
120
+ ($_mw_admin_color == 'mw_classic') ||
121
+ ($_mw_admin_color == 'mw_colorblind') ||
122
+ ($_mw_admin_color == 'mw_grey') ||
123
+ ($_mw_admin_color == 'mw_wp23')
124
+ ) {
125
+ add_action('admin_head', '_mw_adminimize_adminmenu', 1);
126
+ }
127
+
128
+ if ( ('post-new.php' == $pagenow) || ('post.php' == $pagenow) ) {
129
+ add_action('admin_head', '_mw_adminimize_remove_box', 99);
130
+ add_action('admin_head', '_mw_adminimize_remove_tb_window');
131
+
132
+ //add_filter('image_downsize', '_mw_adminimize_image_downsize', 1, 3);
133
+
134
+ if ( !in_array('#categorydivsb', $disabled_metaboxes_post) || !in_array('#categorydivsb', $disabled_metaboxes_post_adm) )
135
+ add_action('submitpost_box', '_mw_adminimize_sidecat_list_category_box');
136
+ if ( !in_array('#tagsdivsb', $disabled_metaboxes_post) || !in_array('#tagsdivsb', $disabled_metaboxes_post_adm) )
137
+ add_action('submitpost_box', '_mw_adminimize_sidecat_list_tag_box');
138
+ if ( in_array('media_buttons', $disabled_metaboxes_post) || in_array('media_buttons', $disabled_metaboxes_post_adm) )
139
+ remove_action('media_buttons', 'media_buttons');
140
+ }
141
+
142
+ if ( ('page-new.php' == $pagenow) || ('page.php' == $pagenow) ) {
143
+ add_action('admin_head', '_mw_adminimize_remove_tb_window');
144
+
145
+ //add_filter('image_downsize', '_mw_adminimize_image_downsize', 1, 3);
146
+
147
+ if ( in_array('media_buttons', $disabled_metaboxes_page) || in_array('media_buttons', $disabled_metaboxes_page_adm) )
148
+ remove_action('media_buttons', 'media_buttons');
149
+ }
150
+
151
+ }
152
+
153
+ if ( ('post-new.php' == $pagenow) || ('page-new.php' == $pagenow) || ('page.php' == $pagenow) || ('post.php' == $pagenow) ) {
154
+
155
+ $_mw_adminimize_writescroll = get_option('_mw_adminimize_writescroll');
156
+ switch ($_mw_adminimize_writescroll) {
157
+ case 1:
158
+ add_action('admin_head', '_mw_adminimize_writescroll');
159
+ break;
160
+ }
161
+ $_mw_adminimize_tb_window = get_option('_mw_adminimize_tb_window');
162
+ switch ($_mw_adminimize_tb_window) {
163
+ case 1:
164
+ add_action('admin_head', '_mw_adminimize_tb_window');
165
+ break;
166
+ }
167
+ // set user option in edit-area
168
+ add_action('admin_head', '_mw_adminimize_set_user_option_edit');
169
+ }
170
+
171
+ // set menu option
172
+ add_action('admin_head', '_mw_adminimize_set_menu_option', 1);
173
+
174
+ // set metabox option
175
+ add_action('admin_head', '_mw_adminimize_set_metabox_option', 1);
176
+
177
+ add_action('in_admin_footer', '_mw_adminimize_admin_footer');
178
+
179
+ update_option('mw_adminimize_default_menu', $menu);
180
+ update_option('mw_adminimize_default_submenu', $submenu);
181
+ }
182
+
183
+ add_action('init', '_mw_adminimize_textdomain');
184
+ add_action('admin_menu', '_mw_adminimize_add_settings_page');
185
+ add_action('admin_menu', '_mw_adminimize_remove_dashboard');
186
+ add_action('admin_init', '_mw_adminimize_init', 1);
187
+ add_action('admin_init', '_mw_adminimize_admin_styles', 1);
188
+
189
+ register_activation_hook(__FILE__, '_mw_adminimize_install');
190
+ //register_deactivation_hook(__FILE__, '_mw_adminimize_deinstall');
191
+
192
+
193
+ /**
194
+ * remove tb_window of media-uplader
195
+ * @echo script
196
+ */
197
+ function _mw_adminimize_remove_tb_window() {
198
+
199
+ $_mw_adminimize_remove_tb_window = "\n";
200
+ $_mw_adminimize_remove_tb_window .= '<script type="text/javascript">' . "\n";
201
+ $_mw_adminimize_remove_tb_window .= "\t" . 'jQuery(document).ready(function() { jQuery(\'#TB_window\').remove(); });' . "\n";
202
+ $_mw_adminimize_remove_tb_window .= '</script>' . "\n";
203
+
204
+ print($_mw_adminimize_remove_tb_window);
205
+ }
206
+
207
+
208
+ /**
209
+ * new tb_window of media-uplader
210
+ */
211
+ function _mw_adminimize_tb_window() {
212
+
213
+ ?>
214
+ <script type="text/javascript">
215
+ // thickbox settings
216
+ jQuery(function($) {
217
+ tb_position = function() {
218
+ var tbWindow = $('#TB_window');
219
+ var width = $(window).width();
220
+ var H = $(window).height();
221
+ var W = ( 1720 < width ) ? 1720 : width;
222
+
223
+ if ( tbWindow.size() ) {
224
+ tbWindow.width( W - 50 ).height( H - 45 );
225
+ $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
226
+ tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
227
+ if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
228
+ tbWindow.css({'top':'20px','margin-top':'0'});
229
+ $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
230
+ };
231
+
232
+ return $('a.thickbox').each( function() {
233
+ var href = $(this).attr('href');
234
+ if ( ! href ) return;
235
+ href = href.replace(/&width=[0-9]+/g, '');
236
+ href = href.replace(/&height=[0-9]+/g, '');
237
+ $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 ) );
238
+ });
239
+ };
240
+
241
+ $(window).resize( function() { tb_position() } );
242
+ });
243
+ </script>
244
+ <?php
245
+ }
246
+
247
+
248
+ /**
249
+ * Uses WordPress filter for image_downsize, kill wp-image-dimension
250
+ * code by Andrew Rickmann
251
+ * http://www.wp-fun.co.uk/
252
+ * @param $value, $id, $size
253
+ */
254
+ function _mw_adminimize_image_downsize($value = false,$id = 0, $size = "medium") {
255
+
256
+ if ( !wp_attachment_is_image($id) )
257
+ return false;
258
+
259
+ $img_url = wp_get_attachment_url($id);
260
+ // Mimic functionality in image_downsize function in wp-includes/media.php
261
+ if ( $intermediate = image_get_intermediate_size($id, $size) ) {
262
+ $img_url = str_replace(basename($img_url), $intermediate['file'], $img_url);
263
+ }
264
+ elseif ( $size == 'thumbnail' ) {
265
+ // fall back to the old thumbnail
266
+ if ( $thumb_file = wp_get_attachment_thumb_file() && $info = getimagesize($thumb_file) ) {
267
+ $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url);
268
+ }
269
+ }
270
+ if ( $img_url)
271
+ return array($img_url, 0, 0);
272
+ return false;
273
+ }
274
+
275
+
276
+ /**
277
+ * Automatically scroll Write pages to a good position
278
+ * code by Dougal Campbell
279
+ * http://dougal.gunters.org/blog/2008/06/03/writescroll
280
+ */
281
+ function _mw_adminimize_writescroll() {
282
+
283
+ ?>
284
+ <script type="text/javascript">
285
+ jQuery(document).ready(function() {
286
+ // element to scroll
287
+ var h = jQuery('html');
288
+ // position to scroll to
289
+ var wraptop = jQuery('div#poststuff').offset().top;
290
+ var speed = 250; // ms
291
+ h.animate({scrollTop: wraptop}, speed);
292
+ });
293
+ </script>
294
+ <?php
295
+ }
296
+
297
+
298
+ /**
299
+ * list category-box in sidebar
300
+ * @uses $post_ID
301
+ */
302
+ function _mw_adminimize_sidecat_list_category_box() {
303
+ global $post_ID;
304
+ ?>
305
+
306
+ <div class="inside" id="categorydivsb">
307
+ <p><strong><?php _e("Categories"); ?></strong></p>
308
+ <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
309
+ <?php wp_category_checklist($post_ID); ?>
310
+ </ul>
311
+ <?php if ( !defined('WP_PLUGIN_DIR') ) { // for wp <2.6 ?>
312
+ <div id="category-adder" class="wp-hidden-children">
313
+ <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
314
+ <p id="category-add" class="wp-hidden-child">
315
+ <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" />
316
+ <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
317
+ <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
318
+ <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
319
+ <span id="category-ajax-response"></span>
320
+ </p>
321
+ </div>
322
+ <?php } else { ?>
323
+ <div id="category-adder" class="wp-hidden-children">
324
+ <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
325
+ <p id="category-add" class="wp-hidden-child">
326
+ <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
327
+ <br />
328
+ <label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
329
+ <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
330
+ <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
331
+ <span id="category-ajax-response"></span>
332
+ </p>
333
+ </div>
334
+ <?php } ?>
335
+ </div>
336
+ <?php
337
+ }
338
+
339
+
340
+ /**
341
+ * list tag-box in sidebar
342
+ * @uses $post_ID
343
+ */
344
+ function _mw_adminimize_sidecat_list_tag_box() {
345
+ global $post_ID;
346
+
347
+ if ( !class_exists('SimpleTagsAdmin') ) {
348
+ ?>
349
+ <div class="inside" id="tagsdivsb">
350
+ <p><strong><?php _e('Tags'); ?></strong></p>
351
+ <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit($post_ID); ?>" /></p>
352
+ <div id="tagchecklist"></div>
353
+ </div>
354
+ <?php
355
+ }
356
+ }
357
+
358
+
359
+ /**
360
+ * remove default categorydiv
361
+ * @echo script
362
+ */
363
+ function _mw_adminimize_remove_box() {
364
+
365
+ if ( function_exists('remove_meta_box') ) {
366
+ if ( !class_exists('SimpleTagsAdmin') )
367
+ remove_meta_box('tagsdiv', 'post', 'normal');
368
+ remove_meta_box('categorydiv', 'post', 'normal');
369
+ } else {
370
+ $_mw_adminimize_sidecat_admin_head = "\n" . '<script type="text/javascript">' . "\n";
371
+ $_mw_adminimize_sidecat_admin_head .= "\t" . 'jQuery(document).ready(function() { jQuery(\'#categorydiv\').remove(); });' . "\n";
372
+ $_mw_adminimize_sidecat_admin_head .= "\t" . 'jQuery(document).ready(function() { jQuery(\'#tagsdiv\').remove(); });' . "\n";
373
+ $_mw_adminimize_sidecat_admin_head .= '</script>' . "\n";
374
+
375
+ print($_mw_adminimize_sidecat_admin_head);
376
+ }
377
+ }
378
+
379
+
380
+ /**
381
+ * reorder admin-menu
382
+ * @uses $menu
383
+ * @param $file
384
+ */
385
+ function _mw_adminimize_adminmenu($file) {
386
+ global $menu;
387
+
388
+ $menu[7] = $menu[5];
389
+ $menu[5] = $menu[0];
390
+ $menu[32] = $menu[40];
391
+ $menu[40] = $menu[35];
392
+ $menu[35] = $menu[30];
393
+ $menu[30] = $menu[15];
394
+ unset($menu[0]);
395
+ unset($menu[15]);
396
+ }
397
+
398
+
399
+ /**
400
+ * add new adminstyle to usersettings
401
+ * @param $file
402
+ */
403
+ function _mw_adminimize_admin_styles($file) {
404
+
405
+ $_mw_adminimize_path = WP_CONTENT_URL . '/plugins/' . plugin_basename( dirname(__FILE__) ) . '/css/';
406
+
407
+ // MW Adminimize Classic
408
+ $styleName = 'MW Adminimize:' . ' ' . __('Classic');
409
+ wp_admin_css_color (
410
+ 'mw_classic', $styleName, $_mw_adminimize_path . 'mw_classic.css',
411
+ array('#07273E', '#14568A', '#D54E21', '#2683AE')
412
+ );
413
+
414
+ // MW Adminimize Fresh
415
+ $styleName = 'MW Adminimize:' . ' ' . __('Fresh');
416
+ wp_admin_css_color (
417
+ 'mw_fresh', $styleName, $_mw_adminimize_path . 'mw_fresh.css',
418
+ array('#464646', '#CEE1EF', '#D54E21', '#2683AE')
419
+ );
420
+
421
+ // MW Adminimize WordPress 2.3
422
+ $styleName = 'MW Adminimize:' . ' ' . __('WordPress 2.3');
423
+ wp_admin_css_color (
424
+ 'mw_wp23', $styleName, $_mw_adminimize_path . 'mw_wp23.css',
425
+ array('#000000', '#14568A', '#448ABD', '#83B4D8')
426
+ );
427
+
428
+ // MW Adminimize Colorblind
429
+ $styleName = 'MW Adminimize:' . ' ' . __('Maybe i\'m colorblind');
430
+ wp_admin_css_color (
431
+ 'mw_colorblind', $styleName, $_mw_adminimize_path . 'mw_colorblind.css',
432
+ array('#FF9419', '#F0720C', '#710001', '#550007', '#CF4529')
433
+ );
434
+
435
+ // MW Adminimize Grey
436
+ $styleName = 'MW Adminimize:' . ' ' . __('Grey');
437
+ wp_admin_css_color (
438
+ 'mw_grey', $styleName, $_mw_adminimize_path . 'mw_grey.css',
439
+ array('#000000', '#787878', '#F0F0F0', '#D8D8D8', '#909090')
440
+ );
441
+
442
+ /**
443
+ * style and changes for plugin Admin Drop Down Menu
444
+ * by Ozh
445
+ * http://planetozh.com/blog/my-projects/wordpress-admin-menu-drop-down-css/
446
+ */
447
+ if ( function_exists('wp_ozh_adminmenu') ) {
448
+
449
+ // MW Adminimize Classic include ozh adminmenu
450
+ $styleName = 'MW Adminimize inc. Admin Drop Down Menu' . ' ' . __('Classic');
451
+ wp_admin_css_color (
452
+ 'mw_classic_ozh_am', $styleName, $_mw_adminimize_path . 'mw_classic_ozh_am.css',
453
+ array('#07273E', '#14568A', '#D54E21', '#2683AE')
454
+ );
455
+
456
+ // MW Adminimize Fresh include ozh adminmenu
457
+ $styleName = 'MW Adminimize inc. Admin Drop Down Menu' . ' ' . __('Fresh');
458
+ wp_admin_css_color (
459
+ 'mw_fresh_ozh_am', $styleName, $_mw_adminimize_path . 'mw_fresh_ozh_am.css',
460
+ array('#464646', '#CEE1EF', '#D54E21', '#2683AE')
461
+ );
462
+
463
+ }
464
+
465
+ /**
466
+ * style and changes for plugin Lighter Menus
467
+ * by corpodibacco
468
+ * http://www.italyisfalling.com/lighter-menus
469
+ */
470
+ if ( function_exists('lm_build') ) {
471
+
472
+ // MW Adminimize Classic include Lighter Menus
473
+ $styleName = 'MW Adminimize inc. Lighter Menus' . ' ' . __('Classic');
474
+ wp_admin_css_color (
475
+ 'mw_classic_lm', $styleName, $_mw_adminimize_path . 'mw_classic_lm.css',
476
+ array('#07273E', '#14568A', '#D54E21', '#2683AE')
477
+ );
478
+
479
+ // MW Adminimize Fresh include Lighter Menus
480
+ $styleName = 'MW Adminimize inc. Lighter Menus' . ' ' . __('Fresh');
481
+ wp_admin_css_color (
482
+ 'mw_fresh_lm', $styleName, $_mw_adminimize_path . 'mw_fresh_lm.css',
483
+ array('#464646', '#CEE1EF', '#D54E21', '#2683AE')
484
+ );
485
+
486
+ }
487
+ }
488
+
489
+
490
+ /**
491
+ * remove the dashbord
492
+ * @author of basic Austin Matzko
493
+ * http://www.ilfilosofo.com/blog/2006/05/24/plugin-remove-the-wordpress-dashboard/
494
+ */
495
+ function _mw_adminimize_remove_dashboard() {
496
+ global $menu, $submenu, $user_ID;
497
+
498
+ $disabled_menu = get_option('mw_adminimize_disabled_menu');
499
+ $disabled_submenu = get_option('mw_adminimize_disabled_submenu');
500
+ $disabled_menu_adm = get_option('mw_adminimize_disabled_menu_adm');
501
+ $disabled_submenu_adm = get_option('mw_adminimize_disabled_submenu_adm');
502
+
503
+ // remove dashboard
504
+ if ($disabled_menu != '') {
505
+ if ( ( in_array('index.php', $disabled_menu) && !current_user_can('level_10') ) ||
506
+ ( in_array('index.php', $disabled_submenu) && !current_user_can('level_10') ) ||
507
+ ( in_array('index.php', $disabled_menu_adm) && current_user_can('level_10') ) ||
508
+ ( in_array('index.php', $disabled_submenu_adm) && current_user_can('level_10') )
509
+ ) {
510
+
511
+ $_mw_adminimize_db_redirect = get_option('_mw_adminimize_db_redirect');
512
+ switch ($_mw_adminimize_db_redirect) {
513
+ case 0:
514
+ $_mw_adminimize_db_redirect = 'profile.php';
515
+ break;
516
+ case 1:
517
+ $_mw_adminimize_db_redirect = 'edit.php';
518
+ break;
519
+ case 2:
520
+ $_mw_adminimize_db_redirect = 'edit-pages.php';
521
+ break;
522
+ case 3:
523
+ $_mw_adminimize_db_redirect = 'post-new.php';
524
+ break;
525
+ case 4:
526
+ $_mw_adminimize_db_redirect = 'page-new.php';
527
+ break;
528
+ case 5:
529
+ $_mw_adminimize_db_redirect = 'edit-comments.php';
530
+ break;
531
+ }
532
+
533
+ $the_user = new WP_User($user_ID);
534
+ reset($menu); $page = key($menu);
535
+
536
+ while ( (__('Dashboard') != $menu[$page][0]) && next($menu) || (__('Dashboard') != $menu[$page][1]) && next($menu) )
537
+ $page = key($menu);
538
+
539
+ if (__('Dashboard') == $menu[$page][0] || __('Dashboard') == $menu[$page][1])
540
+ unset($menu[$page]);
541
+ reset($menu); $page = key($menu);
542
+
543
+ while ( !$the_user->has_cap($menu[$page][1]) && next($menu) )
544
+ $page = key($menu);
545
+
546
+ if ( preg_match('#wp-admin/?(index.php)?$#', $_SERVER['REQUEST_URI'])) {
547
+ if (function_exists('admin_url')) {
548
+ wp_redirect( admin_url($_mw_adminimize_db_redirect) );
549
+ } else {
550
+ wp_redirect( get_option('siteurl') . '/wp-admin/' . $_mw_adminimize_db_redirect );
551
+ }
552
+ }
553
+ }
554
+ }
555
+ }
556
+
557
+
558
+ /**
559
+ * remove the flash_uploader
560
+ */
561
+ function _mw_adminimize_disable_flash_uploader() {
562
+ return false;
563
+ }
564
+
565
+
566
+ /**
567
+ * set user options from database in edit-area
568
+ */
569
+ function _mw_adminimize_set_user_option_edit() {
570
+
571
+ $_mw_adminimize_path = WP_CONTENT_URL . '/plugins/' . plugin_basename( dirname(__FILE__) ) . '/css/';
572
+
573
+ $_mw_adminimize_sidecat_admin_head = '';
574
+ $_mw_adminimize_sidebar_wight = get_option('_mw_adminimize_sidebar_wight');
575
+ switch ($_mw_adminimize_sidebar_wight) {
576
+ case 300:
577
+ $_mw_adminimize_sidecat_admin_head .= '<link rel="stylesheet" href="' . "\n";
578
+ $_mw_adminimize_sidecat_admin_head .= $_mw_adminimize_path . 'mw_300_sidebar.css';
579
+ $_mw_adminimize_sidecat_admin_head .= '" type="text/css" media="all" />' . "\n";
580
+ break;
581
+ case 400:
582
+ $_mw_adminimize_sidecat_admin_head .= '<link rel="stylesheet" href="' . "\n";
583
+ $_mw_adminimize_sidecat_admin_head .= $_mw_adminimize_path . 'mw_400_sidebar.css';
584
+ $_mw_adminimize_sidecat_admin_head .= '" type="text/css" media="all" />' . "\n";
585
+ break;
586
+ case 20:
587
+ $_mw_adminimize_sidecat_admin_head .= '<link rel="stylesheet" href="' . "\n";
588
+ $_mw_adminimize_sidecat_admin_head .= $_mw_adminimize_path . 'mw_20p_sidebar.css';
589
+ $_mw_adminimize_sidecat_admin_head .= '" type="text/css" media="all" />' . "\n";
590
+ break;
591
+ case 30:
592
+ $_mw_adminimize_sidecat_admin_head .= '<link rel="stylesheet" href="' . "\n";
593
+ $_mw_adminimize_sidecat_admin_head .= $_mw_adminimize_path . 'mw_30p_sidebar.css';
594
+ $_mw_adminimize_sidecat_admin_head .= '" type="text/css" media="all" />' . "\n";
595
+ break;
596
+ }
597
+
598
+ print($_mw_adminimize_sidecat_admin_head);
599
+ }
600
+
601
+
602
+ /**
603
+ * set menu options from database
604
+ */
605
+ function _mw_adminimize_set_menu_option() {
606
+ global $pagenow, $menu, $submenu;
607
+
608
+ $disabled_menu = get_option('mw_adminimize_disabled_menu');
609
+ $disabled_submenu = get_option('mw_adminimize_disabled_submenu');
610
+ $disabled_menu_adm = get_option('mw_adminimize_disabled_menu_adm');
611
+ $disabled_submenu_adm = get_option('mw_adminimize_disabled_submenu_adm');
612
+
613
+ $_mw_adminimize_admin_head = "\n";
614
+ $_mw_adminimize_user_info = get_option('_mw_adminimize_user_info');
615
+ $_mw_adminimize_ui_redirect = get_option('_mw_adminimize_ui_redirect');
616
+ switch ($_mw_adminimize_user_info) {
617
+ case 1:
618
+ $_mw_adminimize_admin_head .= '<script type="text/javascript">' . "\n";
619
+ $_mw_adminimize_admin_head .= "\t" . 'jQuery(document).ready(function() { jQuery(\'#user_info\').remove(); });' . "\n";
620
+ $_mw_adminimize_admin_head .= '</script>' . "\n";
621
+ break;
622
+ case 2:
623
+ $_mw_adminimize_admin_head .= '<link rel="stylesheet" href="' . get_option( 'siteurl' ) . '/' . PLUGINDIR . '/' . plugin_basename( dirname(__FILE__) ) . '/css/mw_small_user_info.css" type="text/css" />' . "\n";
624
+ $_mw_adminimize_admin_head .= '<script type="text/javascript">' . "\n";
625
+ $_mw_adminimize_admin_head .= "\t" . 'jQuery(document).ready(function() { jQuery(\'#user_info\').remove();';
626
+ if ($_mw_adminimize_ui_redirect == '1') {
627
+ $_mw_adminimize_admin_head .= 'jQuery(\'div#wpcontent\').after(\'<div id="small_user_info"><p><a href="' . get_option('siteurl') . ('/wp-login.php?action=logout&amp;redirect_to=') . get_option('siteurl') . '" title="' . __('Log Out') . '">' . __('Log Out') . '</a></p></div>\') });' . "\n";
628
+ } else {
629
+ $_mw_adminimize_admin_head .= 'jQuery(\'div#wpcontent\').after(\'<div id="small_user_info"><p><a href="' . get_option('siteurl') . ('/wp-login.php?action=logout') . '" title="' . __('Log Out') . '">' . __('Log Out') . '</a></p></div>\') });' . "\n";
630
+ }
631
+ $_mw_adminimize_admin_head .= '</script>' . "\n";
632
+ break;
633
+ }
634
+
635
+ $_mw_adminimize_footer = get_option('_mw_adminimize_footer');
636
+ switch ($_mw_adminimize_footer) {
637
+ case 1:
638
+ $_mw_adminimize_admin_head .= '<script type="text/javascript">' . "\n";
639
+ $_mw_adminimize_admin_head .= "\t" . 'jQuery(document).ready(function() { jQuery(\'#footer\').remove(); });' . "\n";
640
+ $_mw_adminimize_admin_head .= '</script>' . "\n";
641
+ break;
642
+ }
643
+
644
+ // timestamp open
645
+ $_mw_adminimize_timestamp = get_option('_mw_adminimize_timestamp');
646
+ switch ($_mw_adminimize_timestamp) {
647
+ case 1:
648
+ $_mw_adminimize_admin_head .= '<script type="text/javascript">' . "\n";
649
+ $_mw_adminimize_admin_head .= "\t" . 'addLoadEvent(function(){jQuery(\'.edit-timestamp\').click();});' . "\n";
650
+ $_mw_adminimize_admin_head .= '</script>' . "\n";
651
+ break;
652
+ }
653
+
654
+ $_mw_adminimize_admin_head .= '<script type="text/javascript">
655
+ /* <![CDATA[ */
656
+ adminimizeL10n = {
657
+ all: "' . __('Alle', 'adminimize') . '", none: "' . __('Keine', 'adminimize') . '"
658
+ }
659
+ /* ]]> */
660
+ </script>';
661
+ $_mw_adminimize_admin_head .= '<script type="text/javascript" src="' . WP_CONTENT_URL . '/plugins/' . plugin_basename( dirname(__FILE__) ) . '/js/adminimize.js"></script>';
662
+
663
+ // set menu
664
+ if ($disabled_menu != '') {
665
+
666
+ // set user-menu
667
+ if ( !current_user_can('level_10') ) {
668
+ foreach ($menu as $index => $item) {
669
+ if ($item == 'index.php')
670
+ continue;
671
+
672
+ if (in_array($item[2], $disabled_menu))
673
+ unset($menu[$index]);
674
+
675
+ if ( !empty($submenu[$item[2]]) ) {
676
+ foreach ($submenu[$item[2]] as $subindex => $subitem) {
677
+ if (in_array($subitem[2], $disabled_submenu))
678
+ unset($submenu[$item[2]][$subindex]);
679
+ }
680
+ }
681
+ }
682
+ }
683
+
684
+ // set admin-menu
685
+ if ( current_user_can('level_10') ) {
686
+ foreach ($menu as $index => $item) {
687
+ if ($item == 'index.php')
688
+ continue;
689
+
690
+ if (in_array($item[2], $disabled_menu_adm))
691
+ unset($menu[$index]);
692
+
693
+ if ( !empty($submenu[$item[2]]) ) {
694
+ foreach ($submenu[$item[2]] as $subindex => $subitem) {
695
+ if (in_array($subitem[2], $disabled_submenu_adm))
696
+ unset($submenu[$item[2]][$subindex]);
697
+ }
698
+ }
699
+ }
700
+ }
701
+
702
+ }
703
+
704
+ print($_mw_adminimize_admin_head);
705
+ }
706
+
707
+
708
+ /**
709
+ * set metabox options from database
710
+ */
711
+ function _mw_adminimize_set_metabox_option() {
712
+ global $pagenow;
713
+
714
+ $_mw_adminimize_admin_head = "\n";
715
+
716
+ // post
717
+ if ( ('post-new.php' == $pagenow) || ('post.php' == $pagenow) ) {
718
+ remove_action('admin_head', 'index_js');
719
+
720
+ $disabled_metaboxes_post = get_option('mw_adminimize_disabled_metaboxes_post');
721
+ $disabled_metaboxes_post_adm = get_option('mw_adminimize_disabled_metaboxes_post_adm');
722
+
723
+ if ( current_user_can('level_10') ) {
724
+ $metaboxes = implode(',', $disabled_metaboxes_post_adm); // for admins
725
+ } else {
726
+ $metaboxes = implode(',', $disabled_metaboxes_post); // < user level 10, admin
727
+ }
728
+
729
+ $_mw_adminimize_admin_head .= '<style type="text/css">' . $metaboxes . ' {display: none !important}</style>' . "\n";
730
+ }
731
+
732
+ // page
733
+ if ( ('page-new.php' == $pagenow) || ('page.php' == $pagenow) ) {
734
+ remove_action('admin_head', 'index_js');
735
+
736
+ $disabled_metaboxes_page = get_option('mw_adminimize_disabled_metaboxes_page');
737
+ $disabled_metaboxes_page_adm = get_option('mw_adminimize_disabled_metaboxes_page_adm');
738
+
739
+ if ( current_user_can('level_10') ) {
740
+ $metaboxes = implode(',', $disabled_metaboxes_page_adm);
741
+ } else {
742
+ $metaboxes = implode(',', $disabled_metaboxes_page); // < user level 10, admin
743
+ }
744
+
745
+ $_mw_adminimize_admin_head .= '<style type="text/css">' . $metaboxes . ' {display: none !important}</style>' . "\n";
746
+ }
747
+
748
+ print($_mw_adminimize_admin_head);
749
+ }
750
+
751
+
752
+ /**
753
+ * small user-info
754
+ * @uses $post_ID
755
+ */
756
+ function _mw_adminimize_small_user_info() {
757
+ ?>
758
+ <div id="small_user_info">
759
+ <p><a href="<?php echo site_url('wp-login.php?action=logout') ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
760
+ </div>
761
+ <?php
762
+ }
763
+
764
+
765
+ /**
766
+ * include options-page in wp-admin
767
+ */
768
+ require_once('adminimize_page.php');
769
+
770
+
771
+ /**
772
+ * credit in wp-footer
773
+ */
774
+ function _mw_adminimize_admin_footer() {
775
+ $plugin_data = get_plugin_data( __FILE__ );
776
+ $plugin_data['Title'] = $plugin_data['Name'];
777
+ if ( !empty($plugin_data['PluginURI']) && !empty($plugin_data['Name']) )
778
+ $plugin_data['Title'] = '<a href="' . $plugin_data['PluginURI'] . '" title="'.__( 'Visit plugin homepage' ).'">' . $plugin_data['Name'] . '</a>';
779
+
780
+ if ( basename($_SERVER['REQUEST_URI']) == 'adminimize.php') {
781
+ printf('%1$s ' . __('plugin') . ' | ' . __('Version') . ' <a href="http://bueltge.de/wordpress-admin-theme-adminimize/674/#historie" title="' . __('Historie', 'adminimize') . '">%2$s</a> | ' . __('Author') . ' %3$s<br />', $plugin_data['Title'], $plugin_data['Version'], $plugin_data['Author']);
782
+ }
783
+ if ( get_option('_mw_adminimize_advice') == 1 && basename($_SERVER['REQUEST_URI']) != 'adminimize.php' ) {
784
+ printf('%1$s ' . __('plugin aktiv', 'adminimize') . ' | ' . stripslashes( get_option('_mw_adminimize_advice_txt') ) . '<br />', $plugin_data['Title']);
785
+ }
786
+ }
787
+
788
+
789
+ /**
790
+ * Add action link(s) to plugins page
791
+ * Thanks Dion Hulse -- http://dd32.id.au/wordpress-plugins/?configure-link
792
+ */
793
+ function _mw_adminimize_filter_plugin_actions($links, $file){
794
+ static $this_plugin;
795
+
796
+ if( !$this_plugin ) $this_plugin = plugin_basename(__FILE__);
797
+
798
+ if( $file == $this_plugin ){
799
+ $settings_link = '<a href="options-general.php?page=adminimize/adminimize.php">' . __('Settings') . '</a>';
800
+ $links = array_merge( array($settings_link), $links); // before other links
801
+ // $links[] = $settings_link; // ... or after other links
802
+ }
803
+ return $links;
804
+ }
805
+
806
+
807
+ /**
808
+ * settings in plugin-admin-page
809
+ */
810
+ function _mw_adminimize_add_settings_page() {
811
+ if( current_user_can('switch_themes') ) {
812
+ add_submenu_page('options-general.php', __('Adminimize Einstellungen', 'adminimize'), __('Adminimize', 'adminimize'), 8, __FILE__, '_mw_adminimize_options');
813
+ add_filter('plugin_action_links', '_mw_adminimize_filter_plugin_actions', 10, 2);
814
+ }
815
+ }
816
+
817
+
818
+ /**
819
+ * Set theme for users y user_level 10
820
+ */
821
+ function _mw_adminimize_set_theme() {
822
+
823
+ if ( !current_user_can('edit_users') )
824
+ wp_die(__('Cheatin&#8217; uh?'));
825
+
826
+ $user_ids = $_POST[mw_adminimize_theme_items];
827
+ $admin_color = htmlspecialchars( stripslashes( $_POST[_mw_adminimize_set_theme] ) );
828
+
829
+ if ( !$user_ids )
830
+ return false;
831
+
832
+ foreach( $user_ids as $user_id) {
833
+ $user_id = (int) $user_id;
834
+ update_usermeta($user_id, 'admin_color', $admin_color);
835
+ }
836
+ }
837
+
838
+
839
+ /**
840
+ * Update options in database
841
+ */
842
+ function _mw_adminimize_update() {
843
+ global $menu, $submenu;
844
+
845
+ // for a smaller database
846
+ function _mw_adminimize_get_update($option) {
847
+ if ( ($_POST[$option] == '0') || $_POST[$option] == '') {
848
+ delete_option($option);
849
+ } else {
850
+ update_option($option , $_POST[$option]);
851
+ }
852
+ }
853
+
854
+ _mw_adminimize_get_update('_mw_adminimize_sidebar_wight');
855
+ _mw_adminimize_get_update('_mw_adminimize_user_info');
856
+ _mw_adminimize_get_update('_mw_adminimize_footer');
857
+ _mw_adminimize_get_update('_mw_adminimize_writescroll');
858
+ _mw_adminimize_get_update('_mw_adminimize_tb_window');
859
+ _mw_adminimize_get_update('_mw_adminimize_db_redirect');
860
+ _mw_adminimize_get_update('_mw_adminimize_ui_redirect');
861
+ _mw_adminimize_get_update('_mw_adminimize_advice');
862
+ _mw_adminimize_get_update('_mw_adminimize_advice_txt');
863
+ _mw_adminimize_get_update('_mw_adminimize_timestamp');
864
+
865
+ // wp menu, submenu
866
+ update_option('mw_adminimize_default_menu', $menu);
867
+ update_option('mw_adminimize_default_submenu', $submenu);
868
+
869
+ // disabled wp menu, submenu
870
+ update_option('mw_adminimize_disabled_menu',
871
+ isset($_POST['mw_adminimize_disabled_menu_items']) ? $_POST['mw_adminimize_disabled_menu_items'] : array()
872
+ );
873
+ update_option('mw_adminimize_disabled_submenu',
874
+ isset($_POST['mw_adminimize_disabled_submenu_items']) ? $_POST['mw_adminimize_disabled_submenu_items'] : array()
875
+ );
876
+ update_option('mw_adminimize_disabled_menu_adm',
877
+ isset($_POST['mw_adminimize_disabled_menu_adm_items']) ? $_POST['mw_adminimize_disabled_menu_adm_items'] : array()
878
+ );
879
+ update_option('mw_adminimize_disabled_submenu_adm',
880
+ isset($_POST['mw_adminimize_disabled_submenu_adm_items']) ? $_POST['mw_adminimize_disabled_submenu_adm_items'] : array()
881
+ );
882
+
883
+ // disabled meta boxes post
884
+ update_option('mw_adminimize_disabled_metaboxes_post',
885
+ isset($_POST['mw_adminimize_disabled_metaboxes_post_items']) ? $_POST['mw_adminimize_disabled_metaboxes_post_items'] : array()
886
+ );
887
+ // disabled meta boxes page
888
+ update_option('mw_adminimize_disabled_metaboxes_page',
889
+ isset($_POST['mw_adminimize_disabled_metaboxes_page_items']) ? $_POST['mw_adminimize_disabled_metaboxes_page_items'] : array()
890
+ );
891
+ // disabled meta boxes post Admin
892
+ update_option('mw_adminimize_disabled_metaboxes_post_adm',
893
+ isset($_POST['mw_adminimize_disabled_metaboxes_post_adm_items']) ? $_POST['mw_adminimize_disabled_metaboxes_post_adm_items'] : array()
894
+ );
895
+ // disabled meta boxes page Admin
896
+ update_option('mw_adminimize_disabled_metaboxes_page_adm',
897
+ isset($_POST['mw_adminimize_disabled_metaboxes_page_adm_items']) ? $_POST['mw_adminimize_disabled_metaboxes_page_adm_items'] : array()
898
+ );
899
+
900
+ $myErrors = new _mw_adminimize_message_class();
901
+ $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error('_mw_adminimize_update') . '</p></div>';
902
+ echo $myErrors;
903
+ }
904
+
905
+
906
+ /**
907
+ * Delete options in database
908
+ */
909
+ function _mw_adminimize_deinstall() {
910
+
911
+ delete_option('_mw_adminimize_sidebar_wight');
912
+ delete_option('_mw_adminimize_user_info');
913
+ delete_option('_mw_adminimize_footer');
914
+ delete_option('_mw_adminimize_writescroll');
915
+ delete_option('_mw_adminimize_tb_window');
916
+ delete_option('_mw_adminimize_db_redirect');
917
+ delete_option('_mw_adminimize_ui_redirect');
918
+ delete_option('_mw_adminimize_advice');
919
+ delete_option('_mw_adminimize_advice_txt');
920
+ delete_option('_mw_adminimize_timestamp');
921
+
922
+ delete_option('mw_adminimize_default_menu');
923
+ delete_option('mw_adminimize_default_submenu');
924
+ delete_option('mw_adminimize_disabled_menu');
925
+ delete_option('mw_adminimize_disabled_submenu');
926
+ delete_option('mw_adminimize_disabled_menu_adm');
927
+ delete_option('mw_adminimize_disabled_submenu_adm');
928
+
929
+ delete_option('mw_adminimize_default_metaboxes_post');
930
+ delete_option('mw_adminimize_disabled_metaboxes_page-adm');
931
+ delete_option('mw_adminimize_disabled_metaboxes_post');
932
+ delete_option('mw_adminimize_disabled_metaboxes_page');
933
+ delete_option('mw_adminimize_disabled_metaboxes_post_adm');
934
+ delete_option('mw_adminimize_disabled_metaboxes_page_adm');
935
+
936
+ delete_option('_mw_adminimize_update_key');
937
+ }
938
+
939
+
940
+ /**
941
+ * Install options in database
942
+ */
943
+ function _mw_adminimize_install() {
944
+
945
+ add_option('mw_adminimize_default_menu', '', '');
946
+ add_option('mw_adminimize_default_submenu', '', '');
947
+ add_option('mw_adminimize_disabled_menu', array(), '');
948
+ add_option('mw_adminimize_disabled_submenu', array(), '');
949
+ add_option('mw_adminimize_disabled_menu_adm', array(), '');
950
+ add_option('mw_adminimize_disabled_submenu_adm', array(), '');
951
+
952
+ add_option('mw_adminimize_disabled_metaboxes_post', array(),'');
953
+ add_option('mw_adminimize_disabled_metaboxes_page', array(),'');
954
+ add_option('mw_adminimize_disabled_metaboxes_post_adm', array(),'');
955
+ add_option('mw_adminimize_disabled_metaboxes_page_adm', array(),'');
956
+ }
957
+ ?>
adminimize_page.php ADDED
@@ -0,0 +1,634 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * options-page in wp-admin
4
+ */
5
+ function _mw_adminimize_options() {
6
+
7
+ // update options
8
+ if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_insert') && $_POST['_mw_adminimize_save'] ) {
9
+
10
+ if ( function_exists('current_user_can') && current_user_can('edit_plugins') ) {
11
+ check_admin_referer($_mw_adminimize_nonce);
12
+
13
+ _mw_adminimize_update();
14
+
15
+ } else {
16
+ $myErrors = new _mw_adminimize_message_class();
17
+ $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_access_denied') . '</p></div>';
18
+ wp_die($myErrors);
19
+ }
20
+ }
21
+
22
+ // deinstall options
23
+ if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_deinstall') && ($_POST['_mw_adminimize_deinstall_yes'] != '_mw_adminimize_deinstall') ) {
24
+ $myErrors = new _mw_adminimize_message_class();
25
+ $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_deinstall_yes') . '</p></div>';
26
+ wp_die($myErrors);
27
+ }
28
+
29
+ if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_deinstall') && $_POST['_mw_adminimize_deinstall'] && ($_POST['_mw_adminimize_deinstall_yes'] == '_mw_adminimize_deinstall') ) {
30
+
31
+ if ( function_exists('current_user_can') && current_user_can('edit_plugins') ) {
32
+ check_admin_referer($_mw_adminimize_nonce);
33
+
34
+ _mw_adminimize_deinstall();
35
+
36
+ $myErrors = new _mw_adminimize_message_class();
37
+ $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error('_mw_adminimize_deinstall') . '</p></div>';
38
+ echo $myErrors;
39
+ } else {
40
+ $myErrors = new _mw_adminimize_message_class();
41
+ $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_access_denied') . '</p></div>';
42
+ wp_die($myErrors);
43
+ }
44
+ }
45
+
46
+ if ( ($_POST['_mw_adminimize_action'] == '_mw_adminimize_set_theme') && $_POST['_mw_adminimize_save'] ) {
47
+ if ( function_exists('current_user_can') && current_user_can('edit_users') ) {
48
+ check_admin_referer($_mw_adminimize_nonce);
49
+
50
+ _mw_adminimize_set_theme();
51
+
52
+ $myErrors = new _mw_adminimize_message_class();
53
+ $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error('_mw_adminimize_set_theme') . '</p></div>';
54
+ echo $myErrors;
55
+ } else {
56
+ $myErrors = new _mw_adminimize_message_class();
57
+ $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error('_mw_adminimize_access_denied') . '</p></div>';
58
+ wp_die($myErrors);
59
+ }
60
+ }
61
+
62
+ ?>
63
+ <div class="wrap">
64
+ <h2><?php _e('Adminimize', 'adminimize'); ?></h2>
65
+ <br class="clear" />
66
+ <div id="poststuff" class="dlm">
67
+ <div class="postbox closed" >
68
+ <h3><?php _e('Backend Einstellungen', 'adminimize'); ?></h3>
69
+ <div class="inside">
70
+
71
+ <form name="backend_option" method="post" id="_mw_adminimize_options" action="<?php echo $location; ?>" >
72
+ <?php _mw_adminimize_nonce_field($_mw_adminimize_nonce); ?>
73
+ <br class="clear" />
74
+ <table summary="config" class="widefat">
75
+ <thead>
76
+ <tr>
77
+ <th><?php _e('Backend Einstellungen', 'adminimize'); ?></th>
78
+ <th>&nbsp;</th>
79
+ </tr>
80
+ </thead>
81
+ <tbody>
82
+ <tr valign="top">
83
+ <td><?php _e('Sidebar Width', 'adminimize'); ?></td>
84
+ <td>
85
+ <?php $_mw_adminimize_sidebar_wight = get_option('_mw_adminimize_sidebar_wight'); ?>
86
+ <select name="_mw_adminimize_sidebar_wight">
87
+ <option value="0"<?php if ($_mw_adminimize_sidebar_wight == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
88
+ <option value="300"<?php if ($_mw_adminimize_sidebar_wight == '300') { echo ' selected="selected"'; } ?>>300px</option>
89
+ <option value="400"<?php if ($_mw_adminimize_sidebar_wight == '400') { echo ' selected="selected"'; } ?>>400px</option>
90
+ <option value="20"<?php if ($_mw_adminimize_sidebar_wight == '20') { echo ' selected="selected"'; } ?>>20%</option>
91
+ <option value="30"<?php if ($_mw_adminimize_sidebar_wight == '30') { echo ' selected="selected"'; } ?>>30%</option>
92
+ </select> <?php _e('Der Sidebar am rechten Rand des Bereich <em>Schreiben</em> kann konfiguriert werden. Standard sind 200 Pixel im WordPress Theme <em>Classic</em> und <em>Fresh</em>', 'adminimize'); ?>
93
+ </td>
94
+ </tr>
95
+ <tr valign="top">
96
+ <td><?php _e('User-Info', 'adminimize'); ?></td>
97
+ <td>
98
+ <?php $_mw_adminimize_user_info = get_option('_mw_adminimize_user_info'); ?>
99
+ <select name="_mw_adminimize_user_info">
100
+ <option value="0"<?php if ($_mw_adminimize_user_info == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
101
+ <option value="1"<?php if ($_mw_adminimize_user_info == '1') { echo ' selected="selected"'; } ?>><?php _e('Ausblenden', 'adminimize'); ?></option>
102
+ <option value="2"<?php if ($_mw_adminimize_user_info == '2') { echo ' selected="selected"'; } ?>><?php _e('nur Logout', 'adminimize'); ?></option>
103
+ </select> <?php _e('Der &quot;User-Info-Bereich&quot; ist im oberen rechten Bereich zu finden und kann ausgeblendet oder reduziert dargestellt werden.', 'adminimize'); ?>
104
+ </td>
105
+ </tr>
106
+ <?php if ($_mw_adminimize_user_info != '2') $disabled_item = ' disabled="disabled"' ?>
107
+ <tr valign="top">
108
+ <td><?php _e('User Info ge&auml;ndert, Weiterleitung nach', 'adminimize'); ?></td>
109
+ <td>
110
+ <?php $_mw_adminimize_ui_redirect = get_option('_mw_adminimize_ui_redirect'); ?>
111
+ <select name="_mw_adminimize_ui_redirect" <?php echo $disabled_item ?>>
112
+ <option value="0"<?php if ($_mw_adminimize_ui_redirect == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
113
+ <option value="1"<?php if ($_mw_adminimize_ui_redirect == '1') { echo ' selected="selected"'; } ?>><?php _e('Startseite des Blog', 'adminimize'); ?>
114
+ </select> <?php _e('Wenn der &quot;User-Info-Bereich&quot; ge&auml;ndert wird, dann kann die die Weiterleitung nach einem Logout ge&auml;ndert werden.', 'adminimize'); ?>
115
+ </td>
116
+ </tr>
117
+ <tr valign="top">
118
+ <td><?php _e('Footer', 'adminimize'); ?></td>
119
+ <td>
120
+ <?php $_mw_adminimize_footer = get_option('_mw_adminimize_footer'); ?>
121
+ <select name="_mw_adminimize_footer">
122
+ <option value="0"<?php if ($_mw_adminimize_footer == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
123
+ <option value="1"<?php if ($_mw_adminimize_footer == '1') { echo ' selected="selected"'; } ?>><?php _e('Ausblenden', 'adminimize'); ?></option>
124
+ </select> <?php _e('Der Footer-Bereich kann deaktiviert werden, inklusive aller Links und Hinweise.', 'adminimize'); ?>
125
+ </td>
126
+ </tr>
127
+ <tr valign="top">
128
+ <td><?php _e('WriteScroll', 'adminimize'); ?></td>
129
+ <td>
130
+ <?php $_mw_adminimize_writescroll = get_option('_mw_adminimize_writescroll'); ?>
131
+ <select name="_mw_adminimize_writescroll">
132
+ <option value="0"<?php if ($_mw_adminimize_writescroll == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
133
+ <option value="1"<?php if ($_mw_adminimize_writescroll == '1') { echo ' selected="selected"'; } ?>><?php _e('Aktiv', 'adminimize'); ?></option>
134
+ </select> <?php _e('Automatisches Scrollen zum Editor beim Aufruf der Seite Schreiben in Beitr&auml;ge und Seite.', 'adminimize'); ?>
135
+ </td>
136
+ </tr>
137
+ <tr valign="top">
138
+ <td><?php _e('Timestamp', 'adminimize'); ?></td>
139
+ <td>
140
+ <?php $_mw_adminimize_timestamp = get_option('_mw_adminimize_timestamp'); ?>
141
+ <select name="_mw_adminimize_timestamp">
142
+ <option value="0"<?php if ($_mw_adminimize_timestamp == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
143
+ <option value="1"<?php if ($_mw_adminimize_timestamp == '1') { echo ' selected="selected"'; } ?>><?php _e('Aktiv', 'adminimize'); ?></option>
144
+ </select> <?php _e('Das Feld zum &Auml;ndern des Ver&ouml;ffentlichungsdatum ist immer ge&ouml;ffnet.', 'adminimize'); ?>
145
+ </td>
146
+ </tr>
147
+ <tr valign="top">
148
+ <td><?php _e('Thickbox FullScreen', 'adminimize'); ?></td>
149
+ <td>
150
+ <?php $_mw_adminimize_tb_window = get_option('_mw_adminimize_tb_window'); ?>
151
+ <select name="_mw_adminimize_tb_window">
152
+ <option value="0"<?php if ($_mw_adminimize_tb_window == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
153
+ <option value="1"<?php if ($_mw_adminimize_tb_window == '1') { echo ' selected="selected"'; } ?>><?php _e('Aktiv', 'adminimize'); ?></option>
154
+ </select> <?php _e('Alle Thickbox-Funktionen nutzen den kompletten Raum des Browsers, zum Beispiel beim uploaden von Bildern.', 'adminimize'); ?>
155
+ </td>
156
+ </tr>
157
+ <tr valign="top">
158
+ <td><?php _e('Hinweis im Footer', 'adminimize'); ?></td>
159
+ <td>
160
+ <?php $_mw_adminimize_advice = get_option('_mw_adminimize_advice'); ?>
161
+ <select name="_mw_adminimize_advice">
162
+ <option value="0"<?php if ($_mw_adminimize_advice == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?></option>
163
+ <option value="1"<?php if ($_mw_adminimize_advice == '1') { echo ' selected="selected"'; } ?>><?php _e('Aktiv', 'adminimize'); ?></option>
164
+ </select>
165
+ <textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_advice_txt" id="_mw_adminimize_advice_txt" ><?php echo htmlspecialchars(stripslashes(get_option('_mw_adminimize_advice_txt'))); ?></textarea><br /><?php _e('Im Footer kann ein Hinweis auf die aktive Ver&auml;nderung des Standard-Layout gesetzt werden, (x)HTML erlaubt.', 'adminimize'); ?>
166
+ </td>
167
+ </tr>
168
+ <?php
169
+ // when remove dashboard
170
+ $disabled_menu = get_option('mw_adminimize_disabled_menu');
171
+ $disabled_submenu = get_option('mw_adminimize_disabled_submenu');
172
+ $disabled_menu_adm = get_option('mw_adminimize_disabled_menu_adm');
173
+ $disabled_submenu_adm = get_option('mw_adminimize_disabled_submenu_adm');
174
+
175
+ if ($disabled_menu != '') {
176
+ if ( in_array('index.php', $disabled_menu) ||
177
+ in_array('index.php', $disabled_submenu) ||
178
+ in_array('index.php', $disabled_menu_adm) ||
179
+ in_array('index.php', $disabled_submenu_adm)
180
+ ) {
181
+ ?>
182
+ <tr valign="top" class="form-invalid">
183
+ <td><?php _e('Dashboard inaktiv, Weiterleitung nach', 'adminimize'); ?></td>
184
+ <td>
185
+ <?php $_mw_adminimize_db_redirect = get_option('_mw_adminimize_db_redirect'); ?>
186
+ <select name="_mw_adminimize_db_redirect">
187
+ <option value="0"<?php if ($_mw_adminimize_db_redirect == '0') { echo ' selected="selected"'; } ?>><?php _e('Standard', 'adminimize'); ?> (profile.php)</option>
188
+ <option value="1"<?php if ($_mw_adminimize_db_redirect == '1') { echo ' selected="selected"'; } ?>><?php _e('Verwalten Beitr&auml;ge', 'adminimize'); ?> (edit.php)</option>
189
+ <option value="2"<?php if ($_mw_adminimize_db_redirect == '2') { echo ' selected="selected"'; } ?>><?php _e('Verwalten Seiten', 'adminimize'); ?> (edit-pages.php)</option>
190
+ <option value="3"<?php if ($_mw_adminimize_db_redirect == '3') { echo ' selected="selected"'; } ?>><?php _e('Schreiben Beitrag', 'adminimize'); ?> (post-new.php)</option>
191
+ <option value="4"<?php if ($_mw_adminimize_db_redirect == '4') { echo ' selected="selected"'; } ?>><?php _e('Schreiben Seite', 'adminimize'); ?> (page-new.php)</option>
192
+ <option value="5"<?php if ($_mw_adminimize_db_redirect == '5') { echo ' selected="selected"'; } ?>><?php _e('Kommentare', 'adminimize'); ?> (edit-comments.php)</option>
193
+ </select> <?php _e('Du hast das Dashboard deaktivert, wohin soll der Nutzer weitergeleitet werden?', 'adminimize'); ?>
194
+ </td>
195
+ </tr>
196
+ <?php
197
+ }
198
+ }
199
+ ?>
200
+ </tbody>
201
+ </table>
202
+ <p id="submitbutton">
203
+ <input class="button" type="submit" name="_mw_adminimize_save" value="<?php _e('Einstellungen aktualisieren', 'adminimize'); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
204
+ </p>
205
+
206
+ </div>
207
+ </div>
208
+ </div>
209
+
210
+ <div id="poststuff" class="dlm">
211
+ <div class="postbox closed" >
212
+ <h3 id="config_menu"><?php _e('Menu Einstellungen', 'adminimize'); ?></h3>
213
+ <div class="inside">
214
+ <br class="clear" />
215
+ <table summary="config_menu" class="widefat">
216
+ <thead>
217
+ <tr>
218
+ <th><?php _e('Menu Einstellungen - Menu, <span style="font-weight: 400;">Submenu</span>', 'adminimize'); ?></th>
219
+ <th><?php _e('Deaktivieren &lt; User Level 10 (Admin)', 'adminimize'); ?></th>
220
+ <th><?php _e('Deaktivieren f&uuml;r Admin\'s', 'adminimize'); ?></th>
221
+ </tr>
222
+ </thead>
223
+ <tbody>
224
+ <?php
225
+ $menu = get_option('mw_adminimize_default_menu');
226
+ $submenu = get_option('mw_adminimize_default_submenu');
227
+ $disabled_menu = get_option('mw_adminimize_disabled_menu');
228
+ $disabled_submenu = get_option('mw_adminimize_disabled_submenu');
229
+ $disabled_menu_adm = get_option('mw_adminimize_disabled_menu_adm');
230
+ $disabled_submenu_adm = get_option('mw_adminimize_disabled_submenu_adm');
231
+
232
+ $disabled_metaboxes_post = get_option('mw_adminimize_disabled_metaboxes_post');
233
+ $disabled_metaboxes_page = get_option('mw_adminimize_disabled_metaboxes_page');
234
+ $disabled_metaboxes_post_adm = get_option('mw_adminimize_disabled_metaboxes_post_adm');
235
+ $disabled_metaboxes_page_adm = get_option('mw_adminimize_disabled_metaboxes_page_adm');
236
+
237
+ $metaboxes = array(
238
+ '#pageslugdiv',
239
+ '#tagsdiv,#tagsdivsb',
240
+ '#categorydiv,#categorydivsb',
241
+ '#category-add-toggle',
242
+ '#postexcerpt',
243
+ '#trackbacksdiv',
244
+ '#postcustom',
245
+ '#commentstatusdiv',
246
+ '#passworddiv',
247
+ '#authordiv',
248
+ '#revisionsdiv',
249
+ '.side-info',
250
+ '#notice',
251
+ '#post-body h2',
252
+ 'media_buttons'
253
+ );
254
+
255
+ if (class_exists('SimpleTagsAdmin'))
256
+ array_push($metaboxes, '#suggestedtags');
257
+ if (function_exists('tc_post'))
258
+ array_push($metaboxes, '#textcontroldiv');
259
+ if (class_exists('HTMLSpecialCharactersHelper'))
260
+ array_push($metaboxes, '#htmlspecialchars');
261
+
262
+ $metaboxes_names = array(
263
+ __('Permalink', 'adminimize'),
264
+ __('Tags', 'adminimize'),
265
+ __('Kategorien', 'adminimize'),
266
+ __('Neue Kategorie hinzuf&uuml;gen', 'adminimize'),
267
+ __('Auszug', 'adminimize'),
268
+ __('Trackbacks', 'adminimize'),
269
+ __('Benutzerdefinierte Felder', 'adminimize'),
270
+ __('Kommentare & Pings', 'adminimize'),
271
+ __('Diesen Artikel durch ein Passwort sch&uuml;tzen', 'adminimize'),
272
+ __('Autor', 'adminimize'),
273
+ __('Post Revisions', 'adminimize'),
274
+ __('Siehe auch, Tastaturk&uuml;rzel', 'adminimize'),
275
+ __('Mitteilungen', 'adminimize'),
276
+ __('h2: Erweiterte Einstellungen', 'adminimize'),
277
+ __('Media Buttons (alle)', 'adminimize')
278
+ );
279
+
280
+ if (class_exists('SimpleTagsAdmin'))
281
+ array_push($metaboxes_names, __('Suggested tags from'));
282
+ if (function_exists('tc_post'))
283
+ array_push($metaboxes_names, __('Text Control'));
284
+ if (class_exists('HTMLSpecialCharactersHelper'))
285
+ array_push($metaboxes_names, __('HTML Special Characters'));
286
+
287
+ $metaboxes_page = array(
288
+ '#pageslugdiv',
289
+ '#pagepostcustom, #pagecustomdiv',
290
+ '#pagecommentstatusdiv',
291
+ '#pagepassworddiv',
292
+ '#pageparentdiv',
293
+ '#pagetemplatediv',
294
+ '#pageorderdiv',
295
+ '#pageauthordiv',
296
+ '#revisionsdiv',
297
+ '.side-info',
298
+ '#notice',
299
+ '#post-body h2',
300
+ 'media_buttons'
301
+ );
302
+
303
+ if (class_exists('SimpleTagsAdmin'))
304
+ array_push($metaboxes_page, '#suggestedtags');
305
+ if (class_exists('HTMLSpecialCharactersHelper'))
306
+ array_push($metaboxes_page, '#htmlspecialchars');
307
+
308
+ $metaboxes_names_page = array(
309
+ __('Permalink', 'adminimize'),
310
+ __('Benutzerdefinierte Felder', 'adminimize'),
311
+ __('Kommentare &amp; Pings', 'adminimize'),
312
+ __('Diese Seite mit einem Passwort versehen', 'adminimize'),
313
+ __('&Uuml;bergeordnete Seite', 'adminimize'),
314
+ __('Seiten-Template', 'adminimize'),
315
+ __('Reihenfolge', 'adminimize'),
316
+ __('Seitenautor', 'adminimize'),
317
+ __('Page Revisions', 'adminimize'),
318
+ __('Siehe auch', 'adminimize'),
319
+ __('Mitteilungen', 'adminimize'),
320
+ __('h2: Erweiterte Einstellungen', 'adminimize'),
321
+ __('Media Buttons (alle)', 'adminimize')
322
+ );
323
+
324
+ if (class_exists('SimpleTagsAdmin'))
325
+ array_push($metaboxes_names_page, __('Suggested tags from', 'adminimize'));
326
+ if (class_exists('HTMLSpecialCharactersHelper'))
327
+ array_push($metaboxes_names_page, __('HTML Special Characters'));
328
+
329
+ // print menu, submenu
330
+ if ($menu != '') {
331
+
332
+ $i = 0;
333
+ $x = 0;
334
+ foreach ($menu as $item) {
335
+
336
+ // menu items
337
+ // items disabled for user
338
+ if ( $item[2] == 'examble.php' ) {
339
+ $disabled_item = ' disabled="disabled"';
340
+ } else {
341
+ $disabled_item = '';
342
+ }
343
+
344
+ // checkbox checked
345
+ if ( in_array($item[2], $disabled_menu) ) {
346
+ $checked = ' checked="checked"';
347
+ } else {
348
+ $checked = '';
349
+ }
350
+
351
+ // checkbox checked for admin
352
+ if ( in_array($item[2], $disabled_menu_adm) ) {
353
+ $checked_adm = ' checked="checked"';
354
+ } else {
355
+ $checked_adm = '';
356
+ }
357
+
358
+ echo '<tr class="form-invalid">' . "\n";
359
+ echo '<th>' . $item[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $item[2] . ')</span> </th>';
360
+ echo '<td class="num"><input id="check_menu'. $x .'" type="checkbox"' . $disabled_item . $checked . ' name="mw_adminimize_disabled_menu_items[]" value="' . $item[2] . '"/></td>' . "\n";
361
+ echo '<td class="num"><input id="check_menuadm'. $x .'" type="checkbox"' . $disabled_item . $checked_adm . ' name="mw_adminimize_disabled_menu_adm_items[]" value="' . $item[2] . '"/></td>' . "\n";
362
+ echo '</tr>';
363
+ $x++;
364
+ if ( !isset($submenu[$item[2]]) )
365
+ continue;
366
+
367
+ // submenu items
368
+ foreach ( $submenu[ $item[2] ] as $subitem ) {
369
+
370
+ // submenu items
371
+ // items disabled for adm
372
+ if ( $subitem[2] == 'adminimize/adminimize.php' ) {
373
+ $disabled_subitem_adm = ' disabled="disabled"';
374
+ } else {
375
+ $disabled_subitem_adm = '';
376
+ }
377
+
378
+ echo '<tr>' . "\n";
379
+
380
+ $checked = (in_array($subitem[2], $disabled_submenu)) ? ' checked="checked"' : '';
381
+ $checked_adm = (in_array($subitem[2], $disabled_submenu_adm)) ? ' checked="checked"' : '';
382
+
383
+ echo '<td> &mdash; ' . $subitem[0] . ' <span style="color:#ccc; font-weight: 400;">(' . $subitem[2] . ')</span> </td>' . "\n";
384
+ echo '<td class="num"><input id="check_menu'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_submenu_items[]" value="' . $subitem[2] . '" /></td>' . "\n";
385
+ echo '<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";
386
+ echo '</tr>' . "\n";
387
+ $x++;
388
+ }
389
+ $i++;
390
+ $x++;
391
+ }
392
+ echo '<tr>' . "\n";
393
+ echo '<th>' . __('Alle w&auml;hlen', 'adminimize') . '</th>';
394
+ echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menu" onClick="toggleCheckboxes_menu();"><a id="atoggleCheckboxes_menu" href="javascript:toggleCheckboxes_menu();"> ' . __('Alle', 'adminimize') . '</a></td>';
395
+ echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_menuadm" onClick="toggleCheckboxes_menuadm();"><a id="atoggleCheckboxes_menuadm" href="javascript:toggleCheckboxes_menuadm();"> ' . __('Alle', 'adminimize') . '</a></td>';
396
+ echo '</tr>' . "\n";
397
+
398
+ } else {
399
+ $myErrors = new _mw_adminimize_message_class();
400
+ $myErrors = '<tr><td style="color: red;">' . $myErrors->get_error('_mw_adminimize_get_option') . '</td></tr>';
401
+ echo $myErrors;
402
+ } ?>
403
+ </tbody>
404
+ </table>
405
+ <p id="submitbutton">
406
+ <input class="button" type="submit" name="_mw_adminimize_save" value="<?php _e('Einstellungen aktualisieren', 'adminimize'); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
407
+ </p>
408
+
409
+ </div>
410
+ </div>
411
+ </div>
412
+
413
+ <div id="poststuff" class="dlm">
414
+ <div class="postbox closed" >
415
+ <h3 id="config_edit"><?php _e('Schreiben Einstellungen', 'adminimize'); ?></h3>
416
+ <div class="inside">
417
+ <br class="clear" />
418
+ <table summary="config_edit" class="widefat">
419
+ <thead>
420
+ <tr>
421
+ <th><?php _e('Schreiben Einstellungen - Beitr&auml;ge', 'adminimize'); ?></th>
422
+ <th><?php _e('Schreiben Einstellungen - Seiten', 'adminimize'); ?></th>
423
+ </tr>
424
+ </thead>
425
+
426
+ <tbody>
427
+ <tr valign="top">
428
+ <td>
429
+ <table summary="config_edit_post" class="widefat">
430
+ <thead>
431
+ <tr>
432
+ <th>&nbsp;</th>
433
+ <th><?php _e('&lt; Admin (Level 10)', 'adminimize'); ?></th>
434
+ <th><?php _e('Admin (Level 10)', 'adminimize'); ?></th>
435
+ </tr>
436
+ </thead>
437
+
438
+ <tbody>
439
+ <?php
440
+ $x = 0;
441
+ foreach ($metaboxes as $index => $metabox) {
442
+ $checked = (in_array($metabox, $disabled_metaboxes_post)) ? ' checked="checked"' : '';
443
+ $checked_adm = (in_array($metabox, $disabled_metaboxes_post_adm)) ? ' checked="checked"' : '';
444
+
445
+ echo '<tr>' . "\n";
446
+ echo '<td>' . $metaboxes_names[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $metabox . ')</span> </td>' . "\n";
447
+ echo '<td class="num"><input id="check_post'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_metaboxes_post_items[]" value="' . $metabox . '" /></td>' . "\n";
448
+ 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";
449
+ echo '</tr>' . "\n";
450
+ $x++;
451
+ }
452
+ ?>
453
+ <tr>
454
+ <th><?php _e('Alle w&auml;hlen', 'adminimize'); ?></th>
455
+ <?php
456
+ echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_post" onClick="toggleCheckboxes_post();"><a id="atoggleCheckboxes_post" href="javascript:toggleCheckboxes_post();"> ' . __('Alle', 'adminimize') . '</a></td>';
457
+ echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_postadm" onClick="toggleCheckboxes_postadm();"><a id="atoggleCheckboxes_postadm" href="javascript:toggleCheckboxes_postadm();"> ' . __('Alle', 'adminimize') . '</a></td>';
458
+ ?>
459
+ </tr>
460
+ </tbody>
461
+ </table>
462
+ </td>
463
+ <td>
464
+ <table summary="config_edit_page" class="widefat">
465
+ <thead>
466
+ <tr>
467
+ <th>&nbsp;</th>
468
+ <th><?php _e('&lt; Admin (Level 10)', 'adminimize'); ?></th>
469
+ <th><?php _e('Admin (Level 10)', 'adminimize'); ?></th>
470
+ </tr>
471
+ </thead>
472
+
473
+ <tbody>
474
+ <?php
475
+ $x = 0;
476
+ foreach ($metaboxes_page as $index => $metabox) {
477
+ $checked = (in_array($metabox, $disabled_metaboxes_page)) ? ' checked="checked"' : '';
478
+ $checked_adm = (in_array($metabox, $disabled_metaboxes_page_adm)) ? ' checked="checked"' : '';
479
+
480
+ echo '<tr>' . "\n";
481
+ echo '<td>' . $metaboxes_names_page[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $metabox . ')</span> </td>' . "\n";
482
+ echo '<td class="num"><input id="check_page'. $x .'" type="checkbox"' . $checked . ' name="mw_adminimize_disabled_metaboxes_page_items[]" value="' . $metabox . '" /></td>' . "\n";
483
+ 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";
484
+ echo '</tr>' . "\n";
485
+ $x++;
486
+ }
487
+ ?>
488
+ <tr>
489
+ <th><?php _e('Alle w&auml;hlen', 'adminimize'); ?></th>
490
+ <?php
491
+ echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_page" onClick="toggleCheckboxes_page();"><a id="atoggleCheckboxes_page" href="javascript:toggleCheckboxes_page();"> ' . __('Alle', 'adminimize') . '</a></td>';
492
+ echo '<td class="num"><input type="checkbox" id="ctoggleCheckboxes_pageadm" onClick="toggleCheckboxes_pageadm();"><a id="atoggleCheckboxes_pageadm" href="javascript:toggleCheckboxes_pageadm();"> ' . __('Alle', 'adminimize') . '</a></td>';
493
+ ?>
494
+ </tr>
495
+ </tbody>
496
+ </table>
497
+ </td>
498
+ </tr>
499
+ </tbody>
500
+ </table>
501
+
502
+ <p id="submitbutton">
503
+ <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
504
+ <input class="button" type="submit" name="_mw_adminimize_save" value="<?php _e('Einstellungen aktualisieren', 'adminimize'); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
505
+ </p>
506
+ </form>
507
+
508
+ </div>
509
+ </div>
510
+ </div>
511
+
512
+ <div id="poststuff" class="dlm">
513
+ <div class="postbox closed" >
514
+ <h3 id="set_theme"><?php _e('Theme setzen', 'adminimize') ?></h3>
515
+ <div class="inside">
516
+ <br class="clear" />
517
+ <form name="set_theme" method="post" id="_mw_adminimize_set_theme" action="<?php echo $location; ?>" >
518
+ <?php _mw_adminimize_nonce_field($_mw_adminimize_nonce); ?>
519
+ <table class="widefat">
520
+ <thead>
521
+ <tr class="thead">
522
+ <th>&nbsp;</th>
523
+ <th class="num"><?php _e('User-ID') ?></th>
524
+ <th><?php _e('Benutzername') ?></th>
525
+ <th><?php _e('Name im Blog') ?></th>
526
+ <th><?php _e('Aktuelles Theme') ?></th>
527
+ <th><?php _e('User Level') ?></th>
528
+ <th><?php _e('Rolle') ?></th>
529
+ </tr>
530
+ </thead>
531
+ <tbody id="users" class="list:user user-list">
532
+ <?php
533
+ global $wpdb, $_wp_admin_css_colors;;
534
+
535
+ $wp_user_search = $wpdb->get_results("SELECT ID, user_login, display_name FROM $wpdb->users ORDER BY ID");
536
+
537
+ $style = '';
538
+ foreach ( $wp_user_search as $userid ) {
539
+ $user_id = (int) $userid->ID;
540
+ $user_login = stripslashes($userid->user_login);
541
+ $display_name = stripslashes($userid->display_name);
542
+ $current_color = get_user_option('admin_color', $user_id);
543
+ $user_level = (int) get_user_option($table_prefix . 'user_level', $user_id);
544
+ $user_object = new WP_User($user_id);
545
+ $roles = $user_object->roles;
546
+ $role = array_shift($roles);
547
+
548
+ $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
549
+ $return = '';
550
+ $return .= '<tr>';
551
+ $return .= '<td><input type="checkbox" name="mw_adminimize_theme_items[]" value="' . $user_id . '" /></td>';
552
+ $return .= '<td class="num">'. $user_id .'</td>';
553
+ $return .= '<td>'. $user_login .'</td>';
554
+ $return .= '<td>'. $display_name .'</td>';
555
+ $return .= '<td>'. $current_color . '</td>';
556
+ $return .= '<td class="num">'. $user_level . '</td>';
557
+ $return .= '<td>'. $role . '</td>';
558
+ $return .= '</tr>';
559
+
560
+ print($return);
561
+ }
562
+ ?>
563
+ <tr valign="top">
564
+ <td>&nbsp;</td>
565
+ <td>&nbsp;</td>
566
+ <td>&nbsp;</td>
567
+ <td>&nbsp;</td>
568
+ <td>
569
+ <select name="_mw_adminimize_set_theme">
570
+ <?php foreach ( $_wp_admin_css_colors as $color => $color_info ): ?>
571
+ <option value="<?php echo $color; ?>"><?php echo $color_info->name . ' (' . $color . ')' ?></option>
572
+ <?php endforeach; ?>
573
+ </select>
574
+ </td>
575
+ <td>&nbsp;</td>
576
+ <td>&nbsp;</td>
577
+ </tr>
578
+ </tbody>
579
+ </table>
580
+ <p id="submitbutton">
581
+ <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_set_theme" />
582
+ <input class="button" type="submit" name="_mw_adminimize_save" value="<?php _e('Theme zuweisen', 'adminimize'); ?> &raquo;" />
583
+ <input type="hidden" name="page_options" value="'dofollow_timeout'" />
584
+ </p>
585
+ </form>
586
+
587
+ </div>
588
+ </div>
589
+ </div>
590
+
591
+ <div id="poststuff" class="dlm">
592
+ <div class="postbox closed" >
593
+ <h3 id="uninstall"><?php _e('Deinstallation der Einstellungen', 'adminimize') ?></h3>
594
+ <div class="inside">
595
+
596
+ <p><?php _e('Nutze diese Option, um die Einstellungen f&uuml;r das Plugin in der Datenbank zu l&ouml;schen. Das Plugin entfernt die Eintr&auml;ge <strong>nicht</strong>, wenn es deaktiviert wird!', 'adminimize'); ?></p>
597
+ <form name="form2" method="post" id="_mw_adminimize_options_deinstall" action="<?php echo $location; ?>">
598
+ <?php _mw_adminimize_nonce_field($_mw_adminimize_nonce); ?>
599
+ <p id="submitbutton>
600
+ <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_deinstall" />
601
+ <input class="button-secondary" type="submit" name="_mw_adminimize_deinstall" value="<?php _e('Einstellungen l&ouml;schen', 'adminimize'); ?> &raquo;" />
602
+ <input name="_mw_adminimize_deinstall_yes" value="_mw_adminimize_deinstall" type="checkbox" />
603
+ </p>
604
+ </form>
605
+
606
+ </div>
607
+ </div>
608
+ </div>
609
+
610
+ <div id="poststuff" class="dlm">
611
+ <div class="postbox closed" >
612
+ <h3 id="uninstall"><?php _e('&Uuml;ber das Plugin', 'adminimize') ?></h3>
613
+ <div class="inside">
614
+
615
+ <p><?php _e('Weitere Information: Besuche die <a href=\'http://bueltge.de/wordpress-admin-theme-adminimize/674/\'>Plugin Webseite</a> f&uuml;r weitere Informationen oder hole die aktuelle Version des Plugins.', 'adminimize'); ?><br />&copy; Copyright 2008 - <?php echo date("Y"); ?> <a href="http://bueltge.de">Frank B&uuml;ltge</a> | <?php _e('Du willst Danke sagen? Besuche meine <a href=\'http://bueltge.de/wunschliste/\'>Wunschliste</a>.', 'adminimize'); ?></p>
616
+
617
+ </div>
618
+ </div>
619
+ </div>
620
+
621
+ <script type="text/javascript">
622
+ <!--
623
+ jQuery('.postbox h3').prepend('<a class="togbox">+</a> ');
624
+ //jQuery('.togbox').click( function() { jQuery(jQuery(this).parent().parent().get(0)).toggleClass('closed'); } );
625
+ jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); } );
626
+ jQuery('.postbox.close-me').each(function(){
627
+ jQuery(this).addClass("closed");
628
+ });
629
+ //-->
630
+ </script>
631
+ </div>
632
+ <?php
633
+ }
634
+ ?>