PluginProbe
Adminimize / 1.9.1
Adminimize v1.9.1
1.11.14 1.11.13 1.11.1 1.11.10 1.11.11 1.11.12 1.11.2 1.11.3 1.11.4 1.11.5 1.11.6 1.11.7 1.11.8 1.11.9 1.3 1.4.7 1.6 1.7.12 1.7.13 1.7.14 1.7.15 1.7.16 1.7.17 1.7.18 1.7.19 All 53 releases
← All changes | adminimize_page.php +209 -634 1.3 → 1.9.1 View file →
@@ -1,634 +1,209 @@
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 -?>
1 +<?php
2 +/**
3 + * @package Adminimize
4 + * @subpackage Settings page
5 + * @author Frank Bültge
6 + */
7 +if ( ! function_exists( 'add_action' ) ) {
8 + echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9 + exit;
10 +}
11 +
12 +// Export the options to local client.
13 +if ( array_key_exists( '_mw_adminimize_export', $_GET ) ) {
14 + _mw_adminimize_export_json();
15 + die();
16 +}
17 +
18 +function _mw_adminimize_options() {
19 + global $wpdb, $_wp_admin_css_colors, $wp_version, $wp_roles, $table_prefix;
20 +
21 + $_mw_adminimize_user_info = 0;
22 +
23 + // get array with userroles
24 + // also provide for the other files
25 + $user_roles = _mw_adminimize_get_all_user_roles();
26 + $user_roles_names = _mw_adminimize_get_all_user_roles_names();
27 +
28 + // update options
29 + if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
30 + && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_insert' )
31 + && $_POST[ '_mw_adminimize_save' ]
32 + ) {
33 +
34 + if ( function_exists( 'current_user_can' ) && current_user_can( 'manage_options' ) ) {
35 + check_admin_referer( 'mw_adminimize_nonce' );
36 +
37 + _mw_adminimize_update();
38 +
39 + } else {
40 + $myErrors = new _mw_adminimize_message_class();
41 + $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
42 + '_mw_adminimize_access_denied'
43 + ) . '</p></div>';
44 + wp_die( $myErrors );
45 + }
46 + }
47 +
48 + // import options
49 + if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
50 + && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_import' )
51 + && $_POST[ '_mw_adminimize_save' ]
52 + ) {
53 +
54 + _mw_adminimize_import_json();
55 + }
56 +
57 + // Uninstall options
58 + if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
59 + && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_deinstall' )
60 + && ! array_key_exists( '_mw_adminimize_deinstall_yes', $_POST )
61 +
62 + ) {
63 + $myErrors = new _mw_adminimize_message_class();
64 + $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
65 + '_mw_adminimize_deinstall_yes'
66 + ) . '</p></div>';
67 + wp_die( $myErrors );
68 + }
69 +
70 + if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
71 + && array_key_exists( '_mw_adminimize_deinstall_yes', $_POST )
72 + && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_deinstall' )
73 + && $_POST[ '_mw_adminimize_deinstall' ]
74 + && $_POST[ '_mw_adminimize_deinstall_yes' ] === '_mw_adminimize_deinstall'
75 + ) {
76 + if ( function_exists( 'current_user_can' ) && current_user_can( 'manage_options' ) ) {
77 + check_admin_referer( 'mw_adminimize_nonce' );
78 +
79 + _mw_adminimize_deinstall();
80 +
81 + $myErrors = new _mw_adminimize_message_class();
82 + $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error(
83 + '_mw_adminimize_deinstall'
84 + ) . '</p></div>';
85 + echo $myErrors;
86 + } else {
87 + $myErrors = new _mw_adminimize_message_class();
88 + $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
89 + '_mw_adminimize_access_denied'
90 + ) . '</p></div>';
91 + wp_die( $myErrors );
92 + }
93 + }
94 +
95 + // load theme user data
96 + if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
97 + && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' )
98 + && $_POST[ '_mw_adminimize_load' ]
99 + ) {
100 + if ( function_exists( 'current_user_can' ) && current_user_can( 'edit_users' ) ) {
101 + check_admin_referer( 'mw_adminimize_nonce' );
102 +
103 + $myErrors = new _mw_adminimize_message_class();
104 + $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error(
105 + '_mw_adminimize_load_theme'
106 + ) . '</p></div>';
107 + echo $myErrors;
108 + } else {
109 + $myErrors = new _mw_adminimize_message_class();
110 + $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
111 + '_mw_adminimize_access_denied'
112 + ) . '</p></div>';
113 + wp_die( $myErrors );
114 + }
115 + }
116 +
117 + if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
118 + && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_set_theme' )
119 + && $_POST[ '_mw_adminimize_save' ]
120 + ) {
121 + if ( function_exists( 'current_user_can' ) && current_user_can( 'edit_users' ) ) {
122 + check_admin_referer( 'mw_adminimize_nonce' );
123 +
124 + _mw_adminimize_set_theme();
125 +
126 + $myErrors = new _mw_adminimize_message_class();
127 + $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error(
128 + '_mw_adminimize_set_theme'
129 + ) . '</p></div>';
130 + echo $myErrors;
131 + } else {
132 + $myErrors = new _mw_adminimize_message_class();
133 + $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
134 + '_mw_adminimize_access_denied'
135 + ) . '</p></div>';
136 + wp_die( $myErrors );
137 + }
138 + }
139 + ?>
140 + <div class="wrap">
141 + <?php
142 + do_action( 'mw_adminimize_before_settings_form' );
143 + // Backend Options for all roles
144 + require_once 'inc-options/minimenu.php';
145 + ?>
146 + <form name="backend_option" method="post" id="_mw_adminimize_options" action="?page=<?php echo esc_attr(
147 + $_GET[ 'page' ]
148 + ); ?>">
149 + <?php
150 + // Admin Bar options
151 + require_once 'inc-options/admin_bar.php';
152 +
153 + // Admin Bar items frontend
154 + require_once 'inc-options/admin_bar_frontend.php';
155 +
156 + // Backend Options for all roles
157 + require_once 'inc-options/backend_options.php';
158 +
159 + // global options on all pages in backend for different roles
160 + require_once 'inc-options/global_options.php';
161 +
162 + // dashboard options for different roles
163 + require_once 'inc-options/dashboard_options.php';
164 +
165 + // Menu Sub-menu Options
166 + require_once 'inc-options/menu_options.php';
167 +
168 + // Write Page Options
169 + require_once 'inc-options/write_post_options.php';
170 +
171 + // Write Page Options
172 + require_once 'inc-options/write_page_options.php';
173 +
174 + // Custom Post Type
175 + if ( function_exists( 'get_post_types' ) ) {
176 + require_once 'inc-options/write_cp_options.php';
177 + }
178 +
179 + // Links Options
180 + if ( 0 !== get_option( 'link_manager_enabled' ) ) {
181 + require_once 'inc-options/links_options.php';
182 + }
183 +
184 + // Widget options
185 + require_once 'inc-options/widget_options.php';
186 +
187 + // WP Nav Menu Options
188 + require_once 'inc-options/wp_nav_menu_options.php';
189 +
190 + do_action( 'mw_adminimize_settings_form' );
191 + ?>
192 + </form>
193 +
194 + <?php
195 + do_action( 'mw_adminimize_after_settings_form' );
196 +
197 + // Theme Options
198 + require_once 'inc-options/theme_options.php';
199 +
200 + // Im/Export Options
201 + require_once 'inc-options/im_export_options.php';
202 +
203 + // Uninstall options
204 + require_once 'inc-options/deinstall_options.php';
205 + ?>
206 +
207 + </div>
208 + <?php
209 +}