Version Description
- Fixed issue on PHP 5.3 when short PHP tags are not supported
Download this release
Release Info
Developer | argonius |
Plugin | Absolutely Glamorous Custom Admin |
Version | 1.5.3 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.5.3
- plugin.php +3064 -2825
- readme.txt +7 -1
plugin.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
|
|
4 |
Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
|
5 |
Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
|
6 |
Author: WAP
|
7 |
-
Version: 1.5.
|
8 |
Author URI: http://www.wordpressadminpanel.com/
|
9 |
|
10 |
Copyright 2015. WAP (email : info@wordpressadminpanel.com)
|
@@ -22,2893 +22,3132 @@ Author URI: http://www.wordpressadminpanel.com/
|
|
22 |
You should have received a copy of the GNU General Public License
|
23 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
*/
|
25 |
-
|
26 |
$agca = new AGCA();
|
27 |
|
28 |
-
class AGCA
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
34 |
private $context = "";
|
35 |
-
private $saveAfterImport = false;
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
?>
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
register_setting(
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
register_setting(
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
register_setting(
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
register_setting(
|
444 |
-
register_setting(
|
445 |
-
register_setting(
|
446 |
-
register_setting(
|
447 |
-
register_setting(
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
register_setting(
|
456 |
-
register_setting(
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
}
|
479 |
-
|
480 |
-
|
481 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
}
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
}
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
function getOptions(){
|
496 |
-
return Array(
|
497 |
-
'agca_role_allbutadmin',
|
498 |
-
'agca_admin_bar_frontend',
|
499 |
-
'agca_admin_bar_frontend_hide',
|
500 |
-
'agca_login_register_remove',
|
501 |
-
'agca_login_register_href',
|
502 |
-
'agca_login_lostpassword_remove',
|
503 |
-
'agca_admin_capability',
|
504 |
-
'agca_screen_options_menu',
|
505 |
-
'agca_help_menu',
|
506 |
-
'agca_logout',
|
507 |
-
'agca_remove_your_profile',
|
508 |
-
'agca_logout_only',
|
509 |
-
'agca_custom_title',
|
510 |
-
'agca_howdy',
|
511 |
-
'agca_header',
|
512 |
-
'agca_header_show_logout',
|
513 |
-
'agca_footer',
|
514 |
-
'agca_privacy_options',
|
515 |
-
'agca_header_logo',
|
516 |
-
'agca_header_logo_custom',
|
517 |
-
'agca_remove_site_link',
|
518 |
-
'agca_wp_logo_custom',
|
519 |
-
'agca_wp_logo_custom_link',
|
520 |
-
'agca_site_heading',
|
521 |
-
'agca_custom_site_heading',
|
522 |
-
'agca_update_bar',
|
523 |
-
'agca_footer_left',
|
524 |
-
'agca_footer_left_hide',
|
525 |
-
'agca_footer_right',
|
526 |
-
'agca_footer_right_hide',
|
527 |
-
'agca_login_banner',
|
528 |
-
'agca_login_banner_text',
|
529 |
-
'agca_login_photo_remove',
|
530 |
-
'agca_login_photo_url',
|
531 |
-
'agca_login_photo_href',
|
532 |
-
'agca_login_round_box',
|
533 |
-
'agca_login_round_box_size',
|
534 |
-
'agca_dashboard_icon',
|
535 |
-
'agca_dashboard_text',
|
536 |
-
'agca_dashboard_text_paragraph',
|
537 |
-
'agca_dashboard_widget_welcome',
|
538 |
-
'agca_dashboard_widget_activity',
|
539 |
-
'agca_dashboard_widget_il',
|
540 |
-
'agca_dashboard_widget_plugins',
|
541 |
-
'agca_dashboard_widget_qp',
|
542 |
-
'agca_dashboard_widget_rn',
|
543 |
-
'agca_dashboard_widget_rd',
|
544 |
-
'agca_dashboard_widget_primary',
|
545 |
-
'agca_dashboard_widget_secondary',
|
546 |
-
'agca_admin_bar_comments',
|
547 |
-
'agca_admin_bar_new_content',
|
548 |
-
'agca_admin_bar_new_content_post',
|
549 |
-
'agca_admin_bar_new_content_link',
|
550 |
-
'agca_admin_bar_new_content_page',
|
551 |
-
'agca_admin_bar_new_content_user',
|
552 |
-
'agca_admin_bar_new_content_media',
|
553 |
-
'agca_admin_bar_update_notifications',
|
554 |
-
'agca_admin_bar_admin_themes',
|
555 |
-
'agca_remove_top_bar_dropdowns',
|
556 |
-
'agca_admin_menu_turnonoff',
|
557 |
-
'agca_admin_menu_agca_button_only',
|
558 |
-
'agca_admin_menu_separators',
|
559 |
-
'agca_admin_menu_icons',
|
560 |
-
'agca_admin_menu_arrow',
|
561 |
-
'agca_admin_menu_submenu_round',
|
562 |
-
'agca_admin_menu_submenu_round_size',
|
563 |
-
'agca_admin_menu_brand',
|
564 |
-
'agca_admin_menu_brand_link',
|
565 |
-
'agca_admin_menu_autofold',
|
566 |
-
'agca_admin_menu_collapse_button',
|
567 |
-
'ag_edit_adminmenu_json',
|
568 |
-
'ag_edit_adminmenu_json_new',
|
569 |
-
'ag_add_adminmenu_json',
|
570 |
-
'ag_colorizer_json',
|
571 |
-
'agca_colorizer_turnonof',
|
572 |
-
'agca_custom_js',
|
573 |
-
'agca_custom_css',
|
574 |
-
'agca_colorizer_turnonoff',
|
575 |
-
'agca_disablewarning',
|
576 |
-
'agca_selected_template',
|
577 |
-
'agca_templates',
|
578 |
-
);
|
579 |
-
}
|
580 |
-
|
581 |
-
function getTextEditor($name){
|
582 |
-
$settings = array(
|
583 |
-
'textarea_name' => $name,
|
584 |
-
'media_buttons' => true,
|
585 |
-
'tinymce' => array(
|
586 |
-
'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
|
587 |
-
'bullist,blockquote,|,justifyleft,justifycenter' .
|
588 |
-
',justifyright,justifyfull,|,link,unlink,|' .
|
589 |
-
',spellchecker,wp_fullscreen,wp_adv'
|
590 |
-
)
|
591 |
-
);
|
592 |
-
wp_editor( get_option($name), $name, $settings );
|
593 |
-
}
|
594 |
-
|
595 |
-
function importSettings($settings){
|
596 |
-
$exploaded = explode("|^|^|", $settings);
|
597 |
-
// $str = "EEE: ";
|
598 |
-
|
599 |
-
$savedOptions = array();
|
600 |
-
|
601 |
-
foreach ($exploaded as $setting){
|
602 |
-
|
603 |
-
$key = current(explode(':', $setting));
|
604 |
-
$value = substr($setting, strlen($key)+1);
|
605 |
-
$cleanedValue = str_replace('|^|^|','',$value);
|
606 |
-
$savedOptions[$key] = $cleanedValue;
|
607 |
-
}
|
608 |
-
|
609 |
-
// print_r($savedOptions);
|
610 |
-
|
611 |
-
$optionNames = $this->getOptions();
|
612 |
-
|
613 |
-
foreach ($optionNames as $optionName){
|
614 |
-
$optionValue = "";
|
615 |
-
$optionValue = $savedOptions[$optionName];
|
616 |
-
|
617 |
-
if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
|
618 |
-
$optionValue = str_replace("\\\"", "\"", $optionValue);
|
619 |
-
$optionValue = str_replace("\\\'", "\'", $optionValue);
|
620 |
-
}else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
|
621 |
-
//fb($optionValue);
|
622 |
-
$optionValue = htmlspecialchars_decode($optionValue);
|
623 |
-
$optionValue = str_replace("\'", '"', $optionValue);
|
624 |
-
$optionValue = str_replace('\"', "'", $optionValue);
|
625 |
-
//fb($optionValue);
|
626 |
-
}else{
|
627 |
-
|
628 |
-
}
|
629 |
-
update_option($optionName, $optionValue);
|
630 |
-
$str.="/".$optionName."/".$optionValue."\n";
|
631 |
-
}
|
632 |
-
|
633 |
-
//Migration from 1.2.6. to 1.2.5.1 - remove in later versions
|
634 |
-
//agca_script_css
|
635 |
-
//
|
636 |
-
// fb($savedOptions);
|
637 |
-
if($savedOptions['agca_script_css'] != null){
|
638 |
-
$optionValue = "";
|
639 |
-
$optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
|
640 |
-
$optionValue = str_replace('\"', "'", $optionValue);
|
641 |
-
update_option('agca_custom_css', $optionValue);
|
642 |
-
}
|
643 |
-
if($savedOptions['agca_script_js'] != null){
|
644 |
-
$optionValue = "";
|
645 |
-
$optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
|
646 |
-
$optionValue = str_replace('\"', "'", $optionValue);
|
647 |
-
update_option('agca_custom_js', $optionValue);
|
648 |
-
}
|
649 |
-
|
650 |
-
//echo $str;
|
651 |
-
|
652 |
-
//save imported settings
|
653 |
-
$this->saveAfterImport = true;
|
654 |
-
}
|
655 |
-
|
656 |
-
function exportSettings(){
|
657 |
-
$str = "";
|
658 |
-
|
659 |
-
$include_menu_settings = false;
|
660 |
-
if(isset($_POST['export_settings_include_admin_menu'])){
|
661 |
-
if($_POST['export_settings_include_admin_menu'] == 'on'){
|
662 |
-
$include_menu_settings = true;
|
663 |
}
|
664 |
}
|
|
|
|
|
|
|
|
|
665 |
|
666 |
-
|
667 |
-
|
668 |
-
if(
|
669 |
-
|
670 |
-
}else{
|
671 |
-
$str .=$key. ":".$value."|^|^|";
|
672 |
}
|
673 |
-
|
|
|
|
|
|
|
|
|
|
|
674 |
}
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
$array ="";
|
719 |
-
$first = true;
|
720 |
-
//print_r($json);
|
721 |
-
if($type == "colorizer"){
|
722 |
-
$elements = json_decode($arr[0],true);
|
723 |
-
if($elements !=""){
|
724 |
-
return $elements;
|
725 |
-
}
|
726 |
-
}else if($type == "buttons"){
|
727 |
-
$elements = json_decode($arr[0],true);
|
728 |
-
if($elements !=""){
|
729 |
-
foreach($elements as $k => $v){
|
730 |
-
$array.=$this->agca_create_admin_button($k,$v);
|
731 |
-
}
|
732 |
-
}
|
733 |
-
}else if($type == "buttonsJq"){
|
734 |
-
$elements = json_decode($arr[0],true);
|
735 |
-
if($elements !=""){
|
736 |
-
foreach($elements as $k => $v){
|
737 |
-
$array.='<tr><td colspan="2"><button target="'.$v['target'].'" title="'.$v['value'].'" type="button">'.$k.'</button> <a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a> <a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>';
|
738 |
-
}
|
739 |
-
}
|
740 |
-
}else{
|
741 |
-
if(isset($arr[$type])){
|
742 |
-
$elements = $this->agca_decode($arr[$type]);
|
743 |
-
}
|
744 |
-
|
745 |
-
if($elements !=""){
|
746 |
-
foreach($elements as $element){
|
747 |
-
if(!$first){
|
748 |
-
$array .=",";
|
749 |
-
}
|
750 |
-
$parts = explode(" : ",$element);
|
751 |
-
if(isset($parts[0]) && isset($parts[1])){
|
752 |
-
$array.="[".$parts[0].", ".$parts[1]."]";
|
753 |
-
}
|
754 |
-
$first=false;
|
755 |
-
}
|
756 |
-
}
|
757 |
-
}
|
758 |
-
|
759 |
-
return $array;
|
760 |
-
}
|
761 |
-
|
762 |
-
function remove_dashboard_widget($widget,$side)
|
763 |
-
{
|
764 |
-
//side can be 'normal' or 'side'
|
765 |
-
global $wp_meta_boxes;
|
766 |
-
remove_meta_box($widget, 'dashboard', $side);
|
767 |
-
}
|
768 |
-
|
769 |
-
function get_wp_version(){
|
770 |
-
global $wp_version;
|
771 |
-
$array = explode('-', $wp_version);
|
772 |
-
$version = $array[0];
|
773 |
-
return $version;
|
774 |
-
}
|
775 |
-
|
776 |
-
function print_page()
|
777 |
-
{
|
778 |
-
if($this->isGuest() && get_option('agca_admin_bar_frontend_hide')){
|
779 |
-
return false;
|
780 |
-
}
|
781 |
-
|
782 |
-
if(get_option('agca_admin_bar_frontend_hide')==true){
|
783 |
-
add_filter( 'show_admin_bar', '__return_false' );
|
784 |
-
?>
|
785 |
-
<style type="text/css">
|
786 |
-
#wpadminbar{
|
787 |
-
display: none;
|
788 |
-
}
|
789 |
-
</style>
|
790 |
-
<script type="text/javascript">
|
791 |
-
window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
|
792 |
-
</script>
|
793 |
-
<?php
|
794 |
-
}
|
795 |
-
if(get_option('agca_admin_bar_frontend')!=true){
|
796 |
-
|
797 |
$this->context = "page";
|
798 |
$wpversion = $this->get_wp_version();
|
799 |
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
}
|
819 |
-
setTimeout("initJQuery()", 50);
|
820 |
-
} else {
|
821 |
-
jQuery(function() {
|
822 |
-
try
|
823 |
-
{
|
824 |
-
<?php if(get_option('agca_header')!=true){ ?>
|
825 |
-
jQuery('#wpadminbar').show();
|
826 |
-
<?php } ?>
|
827 |
-
|
828 |
-
<?php $this->print_admin_bar_scripts(); ?>
|
829 |
-
}catch(ex){}
|
830 |
-
});
|
831 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
832 |
}
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
?>
|
858 |
-
});
|
859 |
-
</script>
|
860 |
<?php
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1042 |
die;*/
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1152 |
}*/
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
}
|
1158 |
-
//print_r($_SESSION);
|
1159 |
-
|
1160 |
-
if(isset($_SESSION["AGCA"])){
|
1161 |
-
if(isset($_SESSION["AGCA"]["Templates"])){
|
1162 |
-
//print_r($_SESSION["AGCA"]["Templates"]);
|
1163 |
-
$agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
|
1164 |
-
}
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
|
1168 |
-
if($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"'){
|
1169 |
-
$agcaTemplatesSession = array();
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
|
1173 |
-
return $agcaTemplatesSession;
|
1174 |
-
|
1175 |
-
}
|
1176 |
-
|
1177 |
-
function getAGCAColor($name){
|
1178 |
-
if(isset($this->colorizer[$name])){
|
1179 |
-
echo htmlspecialchars($this->colorizer[$name]);
|
1180 |
-
}
|
1181 |
-
}
|
1182 |
-
|
1183 |
-
function prepareAGCALoginTemplates(){
|
1184 |
-
if(get_option( 'agca_templates' ) != ""){
|
1185 |
-
//print_r(get_option( 'agca_templates' ));
|
1186 |
-
$templates = get_option( 'agca_templates' );
|
1187 |
-
foreach($templates as $templname=>$templdata){
|
1188 |
-
if($templname == get_option('agca_selected_template')){
|
1189 |
-
echo (stripslashes($templdata['common']));
|
1190 |
-
|
1191 |
-
if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
|
1192 |
-
$this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
|
1193 |
-
|
1194 |
-
$logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
|
1195 |
-
$logindata = $this->enableSpecificWPVersionCustomizations($logindata);
|
1196 |
-
$logindata = $this->removeCSSComments($logindata);
|
1197 |
-
|
1198 |
-
echo($logindata);
|
1199 |
-
break;
|
1200 |
-
}
|
1201 |
-
}
|
1202 |
-
}
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
function agca_error_check(){
|
1206 |
-
?>
|
1207 |
-
<script type="text/javascript">
|
1208 |
-
function AGCAErrorPage(msg, url, line){
|
1209 |
-
var agca_error_details = "___________________________________________________<br/>";
|
1210 |
-
agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
|
1211 |
-
agca_error_details += "___________________________________________________<br/>";
|
1212 |
-
window.agca_error_details_text = agca_error_details + '<br/>This JavaScript error could stop AG Custom Admin plugin to work properly. If everything still works, you can ignore this notification. <br/><br/>Possible solutions:<br/><br/>1) Make sure to have everything up to date: WordPress site, plugins and themes.<br/><br/>2) Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.<br/><br/>3) Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.<br/><br/>4) If it\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support. <br/><br/>5) Try activating default WordPress theme instead of your current theme.<br/><br/>6) Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.<br/><br/>7) Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AG Custom Admin plugin, or something unexpected happens, please report that on our <a href="http://wordpressadminpanel.com/agca-support/ag_custom_admin/error-ocurred-javascript-error-caught/" target="_blank">SUPPORT PAGE</a>';
|
1213 |
-
document.getElementsByTagName('html')[0].style.visibility = "visible";
|
1214 |
-
var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
|
1215 |
-
AG Custom Admin caught an error on your site! <a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(show/hide more...)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">'+agca_error_details_text+'</div></div>';
|
1216 |
-
|
1217 |
-
var ph = document.getElementById('agca_error_placeholder');
|
1218 |
-
ph.innerHTML = errorDivHtml;
|
1219 |
-
document.getElementById('agca_news').style.visibility = "hidden";
|
1220 |
-
}
|
1221 |
-
window.onerror = function(msg, url, line) {
|
1222 |
-
window.onload = function() {
|
1223 |
-
AGCAErrorPage(msg, url, line);
|
1224 |
-
}
|
1225 |
-
return true;
|
1226 |
-
};
|
1227 |
-
</script>
|
1228 |
-
<?php
|
1229 |
}
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
document.getElementsByTagName('html')[0].style.visibility = "visible";
|
1238 |
-
|
1239 |
-
if(typeof window.console === "object"){
|
1240 |
-
console.log("___________________________________________________");
|
1241 |
-
console.log("AG Custom Admin caught a JavaScript on your site:");
|
1242 |
-
console.log(agca_error_details);
|
1243 |
-
}
|
1244 |
-
}
|
1245 |
-
window.onerror = function(msg, url, line) {
|
1246 |
-
window.onload = function() {
|
1247 |
-
AGCAErrorOtherPages(msg, url, line);
|
1248 |
-
}
|
1249 |
-
return true;
|
1250 |
-
};
|
1251 |
-
</script>
|
1252 |
-
<?php
|
1253 |
}
|
1254 |
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1395 |
print_r($customizations);
|
1396 |
print_r($textboxes);*/
|
1397 |
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
<?php
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
<?php
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1658 |
|
1659 |
if(get_option('agca_dashboard_widget_welcome')==true){
|
1660 |
-
?>jQuery("#welcome-panel").css("display","none")
|
|
|
1661 |
}else{
|
1662 |
-
?>jQuery("#welcome-panel").css("display","block")
|
1663 |
-
|
|
|
1664 |
if(get_option('agca_dashboard_widget_il')==true){
|
1665 |
$this->remove_dashboard_widget('dashboard_incoming_links','normal');
|
1666 |
}else{
|
1667 |
-
?>jQuery("#dashboard_incoming_links").css("display","block")
|
|
|
1668 |
}
|
1669 |
if(get_option('agca_dashboard_widget_plugins')==true){
|
1670 |
$this->remove_dashboard_widget('dashboard_plugins','normal');
|
1671 |
}else{
|
1672 |
-
?>jQuery("#dashboard_plugins").css("display","block")
|
|
|
1673 |
}
|
1674 |
if(get_option('agca_dashboard_widget_qp')==true){
|
1675 |
$this->remove_dashboard_widget('dashboard_quick_press','side');
|
1676 |
}else{
|
1677 |
-
?>jQuery("#dashboard_quick_press").css("display","block")
|
|
|
1678 |
}
|
1679 |
if(get_option('agca_dashboard_widget_rn')==true){
|
1680 |
$this->remove_dashboard_widget('dashboard_right_now','normal');
|
1681 |
}else{
|
1682 |
-
?>jQuery("#dashboard_right_now").css("display","block")
|
|
|
1683 |
}
|
1684 |
if(get_option('agca_dashboard_widget_rd')==true){
|
1685 |
$this->remove_dashboard_widget('dashboard_recent_drafts','side');
|
1686 |
}else{
|
1687 |
-
?>jQuery("#dashboard_recent_drafts").css("display","block")
|
|
|
1688 |
}
|
1689 |
if(get_option('agca_dashboard_widget_primary')==true){
|
1690 |
$this->remove_dashboard_widget('dashboard_primary','side');
|
1691 |
}else{
|
1692 |
-
?>jQuery("#dashboard_primary").css("display","block")
|
|
|
1693 |
}
|
1694 |
if(get_option('agca_dashboard_widget_secondary')==true){
|
1695 |
$this->remove_dashboard_widget('dashboard_secondary','side');
|
1696 |
}else{
|
1697 |
-
?>jQuery("#dashboard_secondary").css("display","block")
|
1698 |
-
|
|
|
1699 |
if(get_option('agca_dashboard_widget_activity')==true){
|
1700 |
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
|
1701 |
}else{
|
1702 |
-
?>jQuery("#dashboard_activity").css("display","block");<?php
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
<?php } //end of apply for any user except admin ?>
|
1777 |
-
/*Add user buttons*/
|
1778 |
-
jQuery('#ag_add_adminmenu').append(buttonsJq);
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
if($this->saveAfterImport == true){
|
1789 |
?>savePluginSettings();<?php
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
});
|
1794 |
-
|
1795 |
-
<?php if(get_option('agca_colorizer_turnonoff') == 'on'){
|
1796 |
-
$this->updateAllColors();
|
1797 |
-
}else{
|
1798 |
-
?>function updateAllColors(){}; <?php
|
1799 |
-
} ?>
|
1800 |
-
|
1801 |
-
|
1802 |
-
/* ]]> */
|
1803 |
-
</script>
|
1804 |
-
<style type="text/css">
|
1805 |
-
.underline_text{
|
1806 |
-
text-decoration:underline;
|
1807 |
-
}
|
1808 |
-
.form-table th{
|
1809 |
-
width:300px;
|
1810 |
-
}
|
1811 |
-
|
1812 |
-
#dashboard-widgets div.empty-container{
|
1813 |
-
border:none;
|
1814 |
-
}
|
1815 |
-
</style>
|
1816 |
-
<?php
|
1817 |
-
}
|
1818 |
-
|
1819 |
-
function print_login_head(){
|
1820 |
-
$this->context = "login";
|
1821 |
-
$this->error_check();
|
1822 |
-
$wpversion = $this->get_wp_version();
|
1823 |
-
|
1824 |
-
?>
|
1825 |
-
<script type="text/javascript">
|
1826 |
-
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
1827 |
-
var agca_version = "<?php echo $this->agca_version; ?>";
|
1828 |
-
<?php //var wpversion = "echo $wpversion; ?>
|
1829 |
-
var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
|
1830 |
-
var isSettingsImport = false;
|
1831 |
-
var agca_context = "login";
|
1832 |
-
</script>
|
1833 |
-
<?php
|
1834 |
-
$this->prepareAGCALoginTemplates();
|
1835 |
-
$this->agca_get_includes();
|
1836 |
-
|
1837 |
-
?>
|
1838 |
-
|
1839 |
-
<script type="text/javascript">
|
1840 |
-
|
1841 |
-
|
1842 |
-
/* <![CDATA[ */
|
1843 |
-
jQuery(document).ready(function() {
|
1844 |
-
try{
|
1845 |
-
<?php if(get_option('agca_login_round_box')==true){ ?>
|
1846 |
-
jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
|
1847 |
-
jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
|
1848 |
-
jQuery("#login h1 a").css("margin-bottom",'10px');
|
1849 |
-
jQuery("#login h1 a").css("padding-bottom",'0');
|
1850 |
-
jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
|
1851 |
-
<?php } ?>
|
1852 |
-
<?php if(get_option('agca_login_banner')==true){ ?>
|
1853 |
-
jQuery("#backtoblog").css("display","none");
|
1854 |
-
<?php } ?>
|
1855 |
-
<?php if(get_option('agca_login_banner_text')==true){ ?>
|
1856 |
-
jQuery("#backtoblog").html('<?php echo addslashes(get_option('agca_login_banner_text')); ?>');
|
1857 |
-
<?php } ?>
|
1858 |
-
<?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
|
1859 |
-
advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
|
1860 |
-
var $url = "url(" + advanced_url + ")";
|
1861 |
-
jQuery("#login h1 a").css("background",$url+' no-repeat');
|
1862 |
-
jQuery("#login h1 a").hide();
|
1863 |
-
image = jQuery("<img />").attr("src",advanced_url);
|
1864 |
-
jQuery(image).load(function() {
|
1865 |
-
var originalWidth = 326;
|
1866 |
-
var widthDiff = this.width - originalWidth;
|
1867 |
-
jQuery("#login h1 a").height(this.height);
|
1868 |
-
jQuery("#login h1 a").width(this.width);
|
1869 |
-
jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
|
1870 |
-
|
1871 |
-
var loginWidth = jQuery('#login').width();
|
1872 |
-
var originalLoginWidth = 320;
|
1873 |
-
var photoWidth = this.width;
|
1874 |
-
|
1875 |
-
if(loginWidth > photoWidth){
|
1876 |
-
jQuery("#login h1 a").css('margin','auto');
|
1877 |
-
}else{
|
1878 |
-
jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
|
1879 |
-
}
|
1880 |
-
|
1881 |
-
jQuery("#login h1 a").show();
|
1882 |
-
});
|
1883 |
-
<?php } ?>
|
1884 |
-
<?php if(get_option('agca_login_photo_href')==true){ ?>
|
1885 |
-
var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
|
1886 |
-
$href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
|
1887 |
-
|
1888 |
-
jQuery("#login h1 a").attr("href",$href);
|
1889 |
-
<?php } ?>
|
1890 |
-
<?php if(get_option('agca_login_photo_remove')==true){ ?>
|
1891 |
-
jQuery("#login h1 a").css("display","none");
|
1892 |
-
<?php } ?>
|
1893 |
-
|
1894 |
-
jQuery("#login h1 a").attr("title","");
|
1895 |
-
|
1896 |
-
<?php if(get_option('agca_login_register_remove')==true){ ?>
|
1897 |
-
if(jQuery('p#nav').size() > 0){
|
1898 |
-
jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
|
1899 |
-
}
|
1900 |
-
jQuery('p#nav a').each(function(){
|
1901 |
-
if(jQuery(this).attr('href').indexOf('register') != -1){
|
1902 |
-
jQuery(this).remove();
|
1903 |
-
}
|
1904 |
-
});
|
1905 |
-
|
1906 |
-
<?php } ?>
|
1907 |
-
<?php if(get_option('agca_login_register_href')!=""){ ?>
|
1908 |
-
jQuery('p#nav a').each(function(){
|
1909 |
-
if(jQuery(this).attr('href').indexOf('register') != -1){
|
1910 |
-
jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
|
1911 |
-
}
|
1912 |
-
});
|
1913 |
-
|
1914 |
-
<?php } ?>
|
1915 |
-
|
1916 |
-
<?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
|
1917 |
-
if(jQuery('p#nav').size() > 0){
|
1918 |
-
jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
|
1919 |
-
}
|
1920 |
-
jQuery('p#nav a').each(function(){
|
1921 |
-
if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
|
1922 |
-
jQuery(this).remove();
|
1923 |
-
}
|
1924 |
-
});
|
1925 |
-
|
1926 |
-
<?php } ?>
|
1927 |
-
|
1928 |
-
|
1929 |
-
<?php //COLORIZER ?>
|
1930 |
-
<?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
|
1931 |
-
jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
|
1932 |
-
jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
|
1933 |
-
|
1934 |
-
|
1935 |
-
<?php
|
1936 |
-
|
1937 |
-
|
1938 |
-
} ?>
|
1939 |
-
<?php //COLORIZER END ?>
|
1940 |
-
}catch(err){
|
1941 |
-
console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
|
1942 |
-
}finally{
|
1943 |
-
jQuery('html').show();
|
1944 |
-
jQuery('html').css('visibility','visible');
|
1945 |
-
}
|
1946 |
});
|
1947 |
-
|
1948 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1949 |
</script>
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
|
2432 |
-
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
|
2552 |
-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
|
2583 |
-
|
2584 |
-
|
2585 |
-
|
2586 |
-
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
|
2696 |
-
|
2697 |
-
|
2698 |
-
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
2746 |
-
|
2747 |
-
|
2748 |
-
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
2773 |
-
|
2774 |
-
|
2775 |
-
|
2776 |
-
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
2794 |
-
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
|
2836 |
-
|
2837 |
-
|
2838 |
-
|
2839 |
-
|
2840 |
-
|
2841 |
-
|
2842 |
-
|
2843 |
-
|
2844 |
-
|
2845 |
-
|
2846 |
-
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
2890 |
-
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
-
|
2895 |
-
|
2896 |
-
|
2897 |
-
|
2898 |
-
|
2899 |
-
|
2900 |
-
|
2901 |
-
|
2902 |
-
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
2906 |
-
|
2907 |
-
|
2908 |
-
|
2909 |
-
|
2910 |
-
|
2911 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2912 |
|
2913 |
}
|
|
|
2914 |
?>
|
4 |
Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
|
5 |
Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
|
6 |
Author: WAP
|
7 |
+
Version: 1.5.3
|
8 |
Author URI: http://www.wordpressadminpanel.com/
|
9 |
|
10 |
Copyright 2015. WAP (email : info@wordpressadminpanel.com)
|
22 |
You should have received a copy of the GNU General Public License
|
23 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
24 |
*/
|
25 |
+
|
26 |
$agca = new AGCA();
|
27 |
|
28 |
+
class AGCA
|
29 |
+
{
|
30 |
+
private $colorizer = "";
|
31 |
+
private $active_plugin;
|
32 |
+
private $agca_version;
|
33 |
+
private $agca_debug = false;
|
34 |
+
private $admin_capabilities;
|
35 |
private $context = "";
|
36 |
+
private $saveAfterImport = false;
|
37 |
+
private $templateCustomizations = "";
|
38 |
+
private $templates_ep = "http://wordpressadminpanel.com/configuration.php";
|
39 |
+
|
40 |
+
public function __construct()
|
41 |
+
{
|
42 |
+
$this->reloadScript();
|
43 |
+
$this->checkPOST();
|
44 |
+
$this->checkGET();
|
45 |
+
|
46 |
+
if (function_exists("add_filter")) {
|
47 |
+
add_filter('admin_title', array(&$this, 'change_title'), 10, 2);
|
48 |
+
add_filter('plugin_row_meta', array(&$this, 'jk_filter_plugin_links'), 10, 2);
|
49 |
+
}
|
50 |
+
|
51 |
+
add_action('admin_init', array(&$this, 'agca_register_settings'));
|
52 |
+
add_action('admin_init', array(&$this, 'agca_init_session'));
|
53 |
+
add_action('admin_head', array(&$this, 'print_admin_css'));
|
54 |
+
add_action('login_head', array(&$this, 'print_login_head'));
|
55 |
+
add_action('admin_menu', array(&$this, 'agca_create_menu'));
|
56 |
+
add_action('wp_head', array(&$this, 'print_page'));
|
57 |
+
add_action('wp_before_admin_bar_render', array(&$this, 'admin_bar_changes'));
|
58 |
+
register_deactivation_hook(__FILE__, array(&$this, 'agca_deactivate'));
|
59 |
+
|
60 |
+
add_action('customize_controls_enqueue_scripts', array(&$this, 'agca_customizer_php'));
|
61 |
+
|
62 |
+
/*Initialize properties*/
|
63 |
+
$this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'), 'colorizer');
|
64 |
+
|
65 |
+
$this->agca_version = "1.5.3";
|
66 |
+
|
67 |
+
//TODO:upload images programmatically
|
68 |
+
}
|
69 |
+
|
70 |
+
// Add donate and support information
|
71 |
+
function jk_filter_plugin_links($links, $file)
|
72 |
+
{
|
73 |
+
if ($file == plugin_basename(__FILE__)) {
|
74 |
+
$links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php">' . __('Settings') . '</a>';
|
75 |
+
$links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php#ag-templates">' . __('Admin Themes') . '</a>';
|
76 |
+
$links[] = '<a href="http://wordpressadminpanel.com/agca-support/">' . __('Support') . '</a>';
|
77 |
+
$links[] = '<a href="http://wordpressadminpanel.com/agca-support/support-for-future-development">' . __('Donate') . '</a>';
|
78 |
+
}
|
79 |
+
return $links;
|
80 |
+
}
|
81 |
+
|
82 |
+
function change_admin_color()
|
83 |
+
{
|
84 |
+
return 'default';
|
85 |
+
}
|
86 |
+
|
87 |
+
function agca_customizer_php()
|
88 |
+
{
|
89 |
+
$this->agca_get_includes();
|
90 |
+
}
|
91 |
+
|
92 |
+
function agca_init_session()
|
93 |
+
{
|
94 |
+
if (!session_id())
|
95 |
+
session_start();
|
96 |
+
}
|
97 |
+
|
98 |
+
function checkGET()
|
99 |
+
{
|
100 |
+
if (isset($_GET['agca_action'])) {
|
101 |
+
if ($_GET['agca_action'] == "remove_templates") {
|
102 |
+
$this->delete_template_images_all();
|
103 |
+
update_option('agca_templates', "");
|
104 |
+
update_option('agca_selected_template', "");
|
105 |
+
}
|
106 |
+
}
|
107 |
+
if (isset($_GET['agca_debug'])) {
|
108 |
+
if ($_GET['agca_debug'] == "true") {
|
109 |
+
$this->agca_debug = true;
|
110 |
+
} else {
|
111 |
+
$this->agca_debug = false;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
function checkPOST()
|
117 |
+
{
|
118 |
+
|
119 |
+
if (isset($_POST['_agca_save_template'])) {
|
120 |
+
//print_r($_POST);
|
121 |
+
$data = $_POST['templates_data'];
|
122 |
+
$parts = explode("|||", $data);
|
123 |
+
|
124 |
+
$common_data = $parts [0];
|
125 |
+
$admin_js = $parts [1];
|
126 |
+
$admin_css = $parts [2];
|
127 |
+
$login_js = $parts [3];
|
128 |
+
$login_css = $parts [4];
|
129 |
+
$settings = $parts [5];
|
130 |
+
$images = $parts [6];
|
131 |
+
|
132 |
+
$template_name = $_POST['templates_name'];
|
133 |
+
|
134 |
+
update_option('agca_selected_template', $template_name);
|
135 |
+
|
136 |
+
$templates = get_option('agca_templates');
|
137 |
+
if ($templates == "") {
|
138 |
+
$templates = array();
|
139 |
+
}
|
140 |
+
|
141 |
+
$templates[$template_name] = array(
|
142 |
+
'common' => $common_data,
|
143 |
+
'admin' => "",
|
144 |
+
'adminjs' => $admin_js,
|
145 |
+
'admincss' => $admin_css,
|
146 |
+
'login' => "",
|
147 |
+
'loginjs' => $login_js,
|
148 |
+
'logincss' => $login_css,
|
149 |
+
'images' => $images,
|
150 |
+
'settings' => $settings
|
151 |
+
);
|
152 |
+
update_option('agca_templates', $templates);
|
153 |
+
|
154 |
+
$_POST = array();
|
155 |
+
|
156 |
+
} else if (isset($_POST['_agca_templates_session'])) {
|
157 |
+
$this->agcaAdminSession();
|
158 |
+
if ($_POST['template'] != "")
|
159 |
+
$_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license" => $_POST['license']);
|
160 |
+
|
161 |
+
print_r($_SESSION);
|
162 |
+
echo "_agca_templates_session:OK";
|
163 |
+
exit;
|
164 |
+
} else if (isset($_POST['_agca_templates_session_remove_license'])) {
|
165 |
+
$this->agcaAdminSession();
|
166 |
+
if ($_POST['template'] != "")
|
167 |
+
$_SESSION["AGCA"]["Templates"][$_POST['template']] = null;
|
168 |
+
print_r($_SESSION);
|
169 |
+
echo "_agca_templates_session_remove_license:OK";
|
170 |
+
exit;
|
171 |
+
} else if (isset($_POST['_agca_get_templates'])) {
|
172 |
+
$templates = get_option('agca_templates');
|
173 |
+
if ($templates == "") $templates = array();
|
174 |
+
$results = array();
|
175 |
+
foreach ($templates as $key => $val) {
|
176 |
+
$results[] = $key;
|
177 |
+
}
|
178 |
+
echo json_encode($results);
|
179 |
+
exit;
|
180 |
+
} else if (isset($_POST['_agca_activate_template'])) {
|
181 |
+
update_option('agca_selected_template', $_POST['_agca_activate_template']);
|
182 |
+
$_POST = array();
|
183 |
+
//unset($_POST);
|
184 |
+
exit;
|
185 |
+
} else if (isset($_POST['_agca_template_settings'])) {
|
186 |
+
$settings = $_POST['_agca_template_settings'];
|
187 |
+
|
188 |
+
$templates = get_option('agca_templates');
|
189 |
+
if ($templates == "") {
|
190 |
+
$templates = array();
|
191 |
+
}
|
192 |
+
$template_name = $_POST["_agca_current_template"];
|
193 |
+
|
194 |
+
$templates[$template_name]["settings"] = $settings;
|
195 |
+
update_option('agca_templates', $templates);
|
196 |
+
|
197 |
+
$_POST = array();
|
198 |
+
//print_r($templates);
|
199 |
+
exit;
|
200 |
+
} else if (isset($_POST['_agca_upload_image'])) {
|
201 |
+
function my_sideload_image()
|
202 |
+
{
|
203 |
+
$remoteurl = $_POST['_agca_upload_image'];
|
204 |
+
$file = media_sideload_image($remoteurl, 0, "AG Custom Admin Template Image (do not delete)");
|
205 |
+
$fileparts = explode("src='", $file);
|
206 |
+
$url = explode("'", $fileparts[1]);
|
207 |
+
echo $url[0];
|
208 |
+
exit;
|
209 |
+
}
|
210 |
+
|
211 |
+
add_action('admin_init', 'my_sideload_image');
|
212 |
+
|
213 |
+
} else if (isset($_POST['_agca_remove_template_images'])) {
|
214 |
+
$this->delete_template_images($_POST['_agca_remove_template_images']);
|
215 |
+
exit;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
function admin_bar_changes()
|
220 |
+
{
|
221 |
+
if (current_user_can('manage_options')) {
|
222 |
+
global $wp_admin_bar;
|
223 |
+
$wp_admin_bar->add_menu(array(
|
224 |
+
'id' => 'agca-admin-themes',
|
225 |
+
'title' => '<span class="ab-icon"></span>' . __('Admin Themes', 'agca-admin-themes'),
|
226 |
+
'href' => 'tools.php?page=ag-custom-admin/plugin.php#ag-templates'
|
227 |
+
));
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
function delete_template_images_all()
|
232 |
+
{
|
233 |
+
$templates = get_option('agca_templates');
|
234 |
+
if ($templates != null && $templates != "") {
|
235 |
+
foreach ($templates as $template) {
|
236 |
+
if ($template != null && $template['images'] != null && $template['images'] != "") {
|
237 |
+
//print_r($template['images']);
|
238 |
+
$imgs = explode(',', $template['images']);
|
239 |
+
foreach ($imgs as $imageSrc) {
|
240 |
+
$this->delete_attachment_by_src($imageSrc);
|
241 |
+
}
|
242 |
+
//print_r($imgs);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
}
|
246 |
+
//print_r($templates);
|
247 |
+
}
|
248 |
+
|
249 |
+
function delete_template_images($template_name)
|
250 |
+
{
|
251 |
+
$templates = get_option('agca_templates');
|
252 |
+
if ($templates != null && $templates != "") {
|
253 |
+
$template = $templates[$template_name];
|
254 |
+
if ($template != null && $template['images'] != null && $template['images'] != "") {
|
255 |
+
//print_r($template['images']); exit;
|
256 |
+
$imgs = explode(',', $template['images']);
|
257 |
+
foreach ($imgs as $imageSrc) {
|
258 |
+
$this->delete_attachment_by_src($imageSrc);
|
259 |
+
}
|
260 |
+
//print_r($imgs);
|
261 |
+
}
|
262 |
+
}
|
263 |
+
//print_r($templates);
|
264 |
+
}
|
265 |
+
|
266 |
+
function delete_attachment_by_src($image_src)
|
267 |
+
{
|
268 |
+
global $wpdb;
|
269 |
+
$query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
|
270 |
+
$id = $wpdb->get_var($query);
|
271 |
+
wp_delete_attachment($id, $true);
|
272 |
+
}
|
273 |
+
|
274 |
+
function get_installed_agca_templates()
|
275 |
+
{
|
276 |
+
$templates = get_option('agca_templates');
|
277 |
+
if ($templates == "") return '[]';
|
278 |
+
$results = array();
|
279 |
+
foreach ($templates as $key => $val) {
|
280 |
+
$results[] = $key;
|
281 |
+
}
|
282 |
+
return json_encode($results);
|
283 |
+
}
|
284 |
+
|
285 |
+
function isGuest()
|
286 |
+
{
|
287 |
+
global $user_login;
|
288 |
+
if ($user_login) {
|
289 |
+
return false;
|
290 |
+
} else {
|
291 |
+
return true;
|
292 |
+
}
|
293 |
+
}
|
294 |
+
|
295 |
+
function check_active_plugin()
|
296 |
+
{
|
297 |
+
|
298 |
+
$ozh = false;
|
299 |
+
|
300 |
+
if (is_plugin_active('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')) {
|
301 |
+
$ozh = true;
|
302 |
+
}
|
303 |
+
|
304 |
+
$this->active_plugin = array(
|
305 |
+
"ozh" => $ozh
|
306 |
+
);
|
307 |
+
}
|
308 |
+
|
309 |
+
function change_title($admin_title, $title)
|
310 |
+
{
|
311 |
+
//return get_bloginfo('name').' - '.$title;
|
312 |
+
if (get_option('agca_custom_title') != "") {
|
313 |
+
$blog = get_bloginfo('name');
|
314 |
+
$page = $title;
|
315 |
+
$customTitle = get_option('agca_custom_title');
|
316 |
+
$customTitle = str_replace('%BLOG%', $blog, $customTitle);
|
317 |
+
$customTitle = str_replace('%PAGE%', $page, $customTitle);
|
318 |
+
return $customTitle;
|
319 |
+
} else {
|
320 |
+
return $admin_title;
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
function agca_get_includes()
|
325 |
+
{
|
326 |
+
?>
|
327 |
+
<script type="text/javascript">
|
328 |
+
<?php
|
329 |
+
//AGCA GLOBALS
|
330 |
+
echo "var agca_global_plugin_url = '" . trailingslashit(plugins_url(basename(dirname(__FILE__)))) . "';";
|
331 |
+
?>
|
332 |
+
</script>
|
333 |
+
<link rel="stylesheet" type="text/css"
|
334 |
+
href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>"/>
|
335 |
+
<link rel="stylesheet" type="text/css"
|
336 |
+
href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"/>
|
337 |
+
<script type="text/javascript"
|
338 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
|
339 |
+
<script type="text/javascript"
|
340 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
|
341 |
+
|
342 |
+
<?php
|
343 |
+
if ($this->context == "login") {
|
344 |
+
?>
|
345 |
+
<link rel="stylesheet" type="text/css"
|
346 |
+
href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/login.min.css"/>
|
347 |
+
<?php
|
348 |
+
} else {
|
349 |
+
?>
|
350 |
+
<link rel="stylesheet" type="text/css"
|
351 |
+
href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/admin.min.css"/>
|
352 |
+
<?php
|
353 |
+
}
|
354 |
+
?>
|
355 |
+
<?php
|
356 |
+
echo $this->templateCustomizations;
|
357 |
+
|
358 |
+
if (!((get_option('agca_role_allbutadmin') == true) and (current_user_can($this->admin_capability())))) {
|
359 |
+
?>
|
360 |
+
<style type="text/css">
|
361 |
+
<?php
|
362 |
+
echo get_option('agca_custom_css');
|
363 |
?>
|
364 |
+
</style>
|
365 |
+
<script type="text/javascript">
|
366 |
+
try {
|
367 |
+
eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
|
368 |
+
} catch (e) {
|
369 |
+
alert('AG CUSTOM ADMIN : There is an error in your custom JS script. Please fix it: \n\n' + e + '\n\n (AG CUSTOM ADMIN -> Advanced -> Custom JavaScript)');
|
370 |
+
console.log(e);
|
371 |
+
}
|
372 |
+
</script>
|
373 |
+
<?php
|
374 |
+
}
|
375 |
+
}
|
376 |
+
|
377 |
+
function agca_enqueue_scripts()
|
378 |
+
{
|
379 |
+
wp_enqueue_script('jquery');
|
380 |
+
}
|
381 |
+
|
382 |
+
function reloadScript()
|
383 |
+
{
|
384 |
+
$isAdmin = false;
|
385 |
+
if (defined('WP_ADMIN') && WP_ADMIN == 1) {
|
386 |
+
$isAdmin = true;
|
387 |
+
}
|
388 |
+
if (in_array((isset($GLOBALS['pagenow']) ? $GLOBALS['pagenow'] : ""), array('wp-login.php', 'wp-register.php')) || $isAdmin) {
|
389 |
+
add_action('init', array(&$this, 'agca_enqueue_scripts'));
|
390 |
+
}
|
391 |
+
}
|
392 |
+
|
393 |
+
function agca_register_settings()
|
394 |
+
{
|
395 |
+
register_setting('agca-options-group', 'agca_role_allbutadmin');
|
396 |
+
register_setting('agca-options-group', 'agca_screen_options_menu');
|
397 |
+
register_setting('agca-options-group', 'agca_help_menu');
|
398 |
+
register_setting('agca-options-group', 'agca_logout');
|
399 |
+
register_setting('agca-options-group', 'agca_remove_your_profile');
|
400 |
+
register_setting('agca-options-group', 'agca_logout_only');
|
401 |
+
register_setting('agca-options-group', 'agca_custom_title');
|
402 |
+
register_setting('agca-options-group', 'agca_howdy');
|
403 |
+
register_setting('agca-options-group', 'agca_header');
|
404 |
+
register_setting('agca-options-group', 'agca_header_show_logout');
|
405 |
+
register_setting('agca-options-group', 'agca_footer');
|
406 |
+
register_setting('agca-options-group', 'agca_privacy_options');
|
407 |
+
register_setting('agca-options-group', 'agca_header_logo');
|
408 |
+
register_setting('agca-options-group', 'agca_header_logo_custom');
|
409 |
+
register_setting('agca-options-group', 'agca_wp_logo_custom');
|
410 |
+
register_setting('agca-options-group', 'agca_remove_site_link');
|
411 |
+
register_setting('agca-options-group', 'agca_wp_logo_custom_link');
|
412 |
+
|
413 |
+
register_setting('agca-options-group', 'agca_site_heading');
|
414 |
+
register_setting('agca-options-group', 'agca_custom_site_heading');
|
415 |
+
register_setting('agca-options-group', 'agca_update_bar');
|
416 |
+
|
417 |
+
register_setting('agca-options-group', 'agca_footer_left');
|
418 |
+
register_setting('agca-options-group', 'agca_footer_left_hide');
|
419 |
+
register_setting('agca-options-group', 'agca_footer_right');
|
420 |
+
register_setting('agca-options-group', 'agca_footer_right_hide');
|
421 |
+
|
422 |
+
register_setting('agca-options-group', 'agca_login_banner');
|
423 |
+
register_setting('agca-options-group', 'agca_login_banner_text');
|
424 |
+
register_setting('agca-options-group', 'agca_login_photo_remove');
|
425 |
+
register_setting('agca-options-group', 'agca_login_photo_url');
|
426 |
+
register_setting('agca-options-group', 'agca_login_photo_href');
|
427 |
+
register_setting('agca-options-group', 'agca_login_round_box');
|
428 |
+
register_setting('agca-options-group', 'agca_login_round_box_size');
|
429 |
+
|
430 |
+
register_setting('agca-options-group', 'agca_dashboard_icon');
|
431 |
+
register_setting('agca-options-group', 'agca_dashboard_text');
|
432 |
+
register_setting('agca-options-group', 'agca_dashboard_text_paragraph');
|
433 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_welcome');
|
434 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_activity');
|
435 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_il');
|
436 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_plugins');
|
437 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_qp');
|
438 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_rn');
|
439 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_rd');
|
440 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_primary');
|
441 |
+
register_setting('agca-options-group', 'agca_dashboard_widget_secondary');
|
442 |
+
|
443 |
+
//WP3.3
|
444 |
+
register_setting('agca-options-group', 'agca_admin_bar_comments');
|
445 |
+
register_setting('agca-options-group', 'agca_admin_bar_new_content');
|
446 |
+
register_setting('agca-options-group', 'agca_admin_bar_new_content_post');
|
447 |
+
register_setting('agca-options-group', 'agca_admin_bar_new_content_link');
|
448 |
+
register_setting('agca-options-group', 'agca_admin_bar_new_content_page');
|
449 |
+
register_setting('agca-options-group', 'agca_admin_bar_new_content_user');
|
450 |
+
register_setting('agca-options-group', 'agca_admin_bar_new_content_media');
|
451 |
+
register_setting('agca-options-group', 'agca_admin_bar_update_notifications');
|
452 |
+
register_setting('agca-options-group', 'agca_admin_bar_admin_themes');
|
453 |
+
register_setting('agca-options-group', 'agca_remove_top_bar_dropdowns');
|
454 |
+
register_setting('agca-options-group', 'agca_admin_bar_frontend');
|
455 |
+
register_setting('agca-options-group', 'agca_admin_bar_frontend_hide');
|
456 |
+
register_setting('agca-options-group', 'agca_login_register_remove');
|
457 |
+
register_setting('agca-options-group', 'agca_login_register_href');
|
458 |
+
register_setting('agca-options-group', 'agca_login_lostpassword_remove');
|
459 |
+
register_setting('agca-options-group', 'agca_admin_capability');
|
460 |
+
register_setting('agca-options-group', 'agca_disablewarning');
|
461 |
+
register_setting('agca-template-group', 'agca_selected_template');
|
462 |
+
register_setting('agca-template-group', 'agca_templates');
|
463 |
+
//delete_option( 'agca_templates' );
|
464 |
+
|
465 |
+
|
466 |
+
/*Admin menu*/
|
467 |
+
register_setting('agca-options-group', 'agca_admin_menu_turnonoff');
|
468 |
+
register_setting('agca-options-group', 'agca_admin_menu_agca_button_only');
|
469 |
+
register_setting('agca-options-group', 'agca_admin_menu_separators');
|
470 |
+
register_setting('agca-options-group', 'agca_admin_menu_icons');
|
471 |
+
register_setting('agca-options-group', 'agca_admin_menu_collapse_button');
|
472 |
+
register_setting('agca-options-group', 'agca_admin_menu_arrow');
|
473 |
+
register_setting('agca-options-group', 'agca_admin_menu_submenu_round');
|
474 |
+
register_setting('agca-options-group', 'agca_admin_menu_submenu_round_size');
|
475 |
+
register_setting('agca-options-group', 'agca_admin_menu_brand');
|
476 |
+
register_setting('agca-options-group', 'agca_admin_menu_brand_link');
|
477 |
+
register_setting('agca-options-group', 'agca_admin_menu_autofold');
|
478 |
+
register_setting('agca-options-group', 'ag_edit_adminmenu_json');
|
479 |
+
register_setting('agca-options-group', 'ag_edit_adminmenu_json_new');
|
480 |
+
register_setting('agca-options-group', 'ag_add_adminmenu_json');
|
481 |
+
register_setting('agca-options-group', 'ag_colorizer_json');
|
482 |
+
register_setting('agca-options-group', 'agca_colorizer_turnonoff');
|
483 |
+
|
484 |
+
register_setting('agca-options-group', 'agca_custom_js');
|
485 |
+
register_setting('agca-options-group', 'agca_custom_css');
|
486 |
+
|
487 |
+
|
488 |
+
if (!empty($_POST)) {
|
489 |
+
// fb($_POST);
|
490 |
+
if (isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings'] == "true") {
|
491 |
+
if (isset($_FILES) && isset($_FILES['settings_import_file'])) {
|
492 |
+
if ($_FILES["settings_import_file"]["error"] > 0) {
|
493 |
+
} else {
|
494 |
+
$file = $_FILES['settings_import_file'];
|
495 |
+
if ($this->startsWith($file['name'], 'AGCA_Settings')) {
|
496 |
+
if (file_exists($file['tmp_name'])) {
|
497 |
+
$fh = fopen($file['tmp_name'], 'r');
|
498 |
+
$theData = "";
|
499 |
+
if (filesize($file['tmp_name']) > 0) {
|
500 |
+
$theData = fread($fh, filesize($file['tmp_name']));
|
501 |
+
}
|
502 |
+
fclose($fh);
|
503 |
+
$this->importSettings($theData);
|
504 |
}
|
505 |
+
}
|
506 |
+
}
|
507 |
+
}
|
508 |
+
} else if (isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings'] == "true") {
|
509 |
+
$this->exportSettings();
|
510 |
+
}
|
511 |
+
}
|
512 |
+
|
513 |
+
if (isset($_GET['agca_action'])) {
|
514 |
+
if ($_GET['agca_action'] == "disablewarning") {
|
515 |
+
update_option('agca_disablewarning', true);
|
516 |
+
}
|
517 |
+
}
|
518 |
+
}
|
519 |
+
|
520 |
+
function agca_deactivate()
|
521 |
+
{
|
522 |
+
|
523 |
+
}
|
524 |
+
|
525 |
+
function getOptions()
|
526 |
+
{
|
527 |
+
return Array(
|
528 |
+
'agca_role_allbutadmin',
|
529 |
+
'agca_admin_bar_frontend',
|
530 |
+
'agca_admin_bar_frontend_hide',
|
531 |
+
'agca_login_register_remove',
|
532 |
+
'agca_login_register_href',
|
533 |
+
'agca_login_lostpassword_remove',
|
534 |
+
'agca_admin_capability',
|
535 |
+
'agca_screen_options_menu',
|
536 |
+
'agca_help_menu',
|
537 |
+
'agca_logout',
|
538 |
+
'agca_remove_your_profile',
|
539 |
+
'agca_logout_only',
|
540 |
+
'agca_custom_title',
|
541 |
+
'agca_howdy',
|
542 |
+
'agca_header',
|
543 |
+
'agca_header_show_logout',
|
544 |
+
'agca_footer',
|
545 |
+
'agca_privacy_options',
|
546 |
+
'agca_header_logo',
|
547 |
+
'agca_header_logo_custom',
|
548 |
+
'agca_remove_site_link',
|
549 |
+
'agca_wp_logo_custom',
|
550 |
+
'agca_wp_logo_custom_link',
|
551 |
+
'agca_site_heading',
|
552 |
+
'agca_custom_site_heading',
|
553 |
+
'agca_update_bar',
|
554 |
+
'agca_footer_left',
|
555 |
+
'agca_footer_left_hide',
|
556 |
+
'agca_footer_right',
|
557 |
+
'agca_footer_right_hide',
|
558 |
+
'agca_login_banner',
|
559 |
+
'agca_login_banner_text',
|
560 |
+
'agca_login_photo_remove',
|
561 |
+
'agca_login_photo_url',
|
562 |
+
'agca_login_photo_href',
|
563 |
+
'agca_login_round_box',
|
564 |
+
'agca_login_round_box_size',
|
565 |
+
'agca_dashboard_icon',
|
566 |
+
'agca_dashboard_text',
|
567 |
+
'agca_dashboard_text_paragraph',
|
568 |
+
'agca_dashboard_widget_welcome',
|
569 |
+
'agca_dashboard_widget_activity',
|
570 |
+
'agca_dashboard_widget_il',
|
571 |
+
'agca_dashboard_widget_plugins',
|
572 |
+
'agca_dashboard_widget_qp',
|
573 |
+
'agca_dashboard_widget_rn',
|
574 |
+
'agca_dashboard_widget_rd',
|
575 |
+
'agca_dashboard_widget_primary',
|
576 |
+
'agca_dashboard_widget_secondary',
|
577 |
+
'agca_admin_bar_comments',
|
578 |
+
'agca_admin_bar_new_content',
|
579 |
+
'agca_admin_bar_new_content_post',
|
580 |
+
'agca_admin_bar_new_content_link',
|
581 |
+
'agca_admin_bar_new_content_page',
|
582 |
+
'agca_admin_bar_new_content_user',
|
583 |
+
'agca_admin_bar_new_content_media',
|
584 |
+
'agca_admin_bar_update_notifications',
|
585 |
+
'agca_admin_bar_admin_themes',
|
586 |
+
'agca_remove_top_bar_dropdowns',
|
587 |
+
'agca_admin_menu_turnonoff',
|
588 |
+
'agca_admin_menu_agca_button_only',
|
589 |
+
'agca_admin_menu_separators',
|
590 |
+
'agca_admin_menu_icons',
|
591 |
+
'agca_admin_menu_arrow',
|
592 |
+
'agca_admin_menu_submenu_round',
|
593 |
+
'agca_admin_menu_submenu_round_size',
|
594 |
+
'agca_admin_menu_brand',
|
595 |
+
'agca_admin_menu_brand_link',
|
596 |
+
'agca_admin_menu_autofold',
|
597 |
+
'agca_admin_menu_collapse_button',
|
598 |
+
'ag_edit_adminmenu_json',
|
599 |
+
'ag_edit_adminmenu_json_new',
|
600 |
+
'ag_add_adminmenu_json',
|
601 |
+
'ag_colorizer_json',
|
602 |
+
'agca_colorizer_turnonof',
|
603 |
+
'agca_custom_js',
|
604 |
+
'agca_custom_css',
|
605 |
+
'agca_colorizer_turnonoff',
|
606 |
+
'agca_disablewarning',
|
607 |
+
'agca_selected_template',
|
608 |
+
'agca_templates',
|
609 |
+
);
|
610 |
+
}
|
611 |
+
|
612 |
+
function getTextEditor($name)
|
613 |
+
{
|
614 |
+
$settings = array(
|
615 |
+
'textarea_name' => $name,
|
616 |
+
'media_buttons' => true,
|
617 |
+
'tinymce' => array(
|
618 |
+
'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
|
619 |
+
'bullist,blockquote,|,justifyleft,justifycenter' .
|
620 |
+
',justifyright,justifyfull,|,link,unlink,|' .
|
621 |
+
',spellchecker,wp_fullscreen,wp_adv'
|
622 |
+
)
|
623 |
+
);
|
624 |
+
wp_editor(get_option($name), $name, $settings);
|
625 |
+
}
|
626 |
+
|
627 |
+
function importSettings($settings)
|
628 |
+
{
|
629 |
+
$exploaded = explode("|^|^|", $settings);
|
630 |
+
// $str = "EEE: ";
|
631 |
+
|
632 |
+
$savedOptions = array();
|
633 |
+
|
634 |
+
foreach ($exploaded as $setting) {
|
635 |
+
|
636 |
+
$key = current(explode(':', $setting));
|
637 |
+
$value = substr($setting, strlen($key) + 1);
|
638 |
+
$cleanedValue = str_replace('|^|^|', '', $value);
|
639 |
+
$savedOptions[$key] = $cleanedValue;
|
640 |
+
}
|
641 |
+
|
642 |
+
// print_r($savedOptions);
|
643 |
+
|
644 |
+
$optionNames = $this->getOptions();
|
645 |
+
|
646 |
+
foreach ($optionNames as $optionName) {
|
647 |
+
$optionValue = "";
|
648 |
+
$optionValue = $savedOptions[$optionName];
|
649 |
+
|
650 |
+
if ($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new" || $optionName == "ag_add_adminmenu_json" || $optionName == "ag_colorizer_json") {
|
651 |
+
$optionValue = str_replace("\\\"", "\"", $optionValue);
|
652 |
+
$optionValue = str_replace("\\\'", "\'", $optionValue);
|
653 |
+
} else if ($optionName == "agca_custom_js" || $optionName == "agca_custom_css") {
|
654 |
+
//fb($optionValue);
|
655 |
+
$optionValue = htmlspecialchars_decode($optionValue);
|
656 |
+
$optionValue = str_replace("\'", '"', $optionValue);
|
657 |
+
$optionValue = str_replace('\"', "'", $optionValue);
|
658 |
+
//fb($optionValue);
|
659 |
+
} else {
|
660 |
+
|
661 |
+
}
|
662 |
+
update_option($optionName, $optionValue);
|
663 |
+
$str .= "/" . $optionName . "/" . $optionValue . "\n";
|
664 |
+
}
|
665 |
+
|
666 |
+
//Migration from 1.2.6. to 1.2.5.1 - remove in later versions
|
667 |
+
//agca_script_css
|
668 |
+
//
|
669 |
+
// fb($savedOptions);
|
670 |
+
if ($savedOptions['agca_script_css'] != null) {
|
671 |
+
$optionValue = "";
|
672 |
+
$optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
|
673 |
+
$optionValue = str_replace('\"', "'", $optionValue);
|
674 |
+
update_option('agca_custom_css', $optionValue);
|
675 |
+
}
|
676 |
+
if ($savedOptions['agca_script_js'] != null) {
|
677 |
+
$optionValue = "";
|
678 |
+
$optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
|
679 |
+
$optionValue = str_replace('\"', "'", $optionValue);
|
680 |
+
update_option('agca_custom_js', $optionValue);
|
681 |
+
}
|
682 |
+
|
683 |
+
//echo $str;
|
684 |
+
|
685 |
+
//save imported settings
|
686 |
+
$this->saveAfterImport = true;
|
687 |
+
}
|
688 |
+
|
689 |
+
function exportSettings()
|
690 |
+
{
|
691 |
+
$str = "";
|
692 |
+
|
693 |
+
$include_menu_settings = false;
|
694 |
+
if (isset($_POST['export_settings_include_admin_menu'])) {
|
695 |
+
if ($_POST['export_settings_include_admin_menu'] == 'on') {
|
696 |
+
$include_menu_settings = true;
|
697 |
+
}
|
698 |
+
}
|
699 |
+
|
700 |
+
foreach ($_POST as $key => $value) {
|
701 |
+
if ($this->startsWith($key, 'ag') || $this->startsWith($key, 'color')) {
|
702 |
+
if ($this->startsWith($key, 'ag_edit_adminmenu')) {
|
703 |
+
if ($include_menu_settings) $str .= $key . ":" . $value . "|^|^|";
|
704 |
+
} else {
|
705 |
+
$str .= $key . ":" . $value . "|^|^|";
|
706 |
}
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
$filename = 'AGCA_Settings_' . date("Y-M-d_H-i-s") . '.agca';
|
711 |
+
header("Cache-Control: public");
|
712 |
+
header("Content-Description: File Transfer");
|
713 |
+
header("Content-Disposition: attachment; filename=$filename");
|
714 |
+
header("Content-Type: text/plain; ");
|
715 |
+
header("Content-Transfer-Encoding: binary");
|
716 |
+
echo $str;
|
717 |
+
die();
|
718 |
+
}
|
719 |
+
|
720 |
+
function startsWith($haystack, $needle)
|
721 |
+
{
|
722 |
+
$length = strlen($needle);
|
723 |
+
return (substr($haystack, 0, $length) === $needle);
|
724 |
+
}
|
725 |
+
|
726 |
+
|
727 |
+
function agca_create_menu()
|
728 |
+
{
|
729 |
+
add_management_page('AG Custom Admin', 'AG Custom Admin', 'administrator', __FILE__, array(&$this, 'agca_admin_page'));
|
730 |
+
}
|
731 |
+
|
732 |
+
function agca_create_admin_button($name, $arr)
|
733 |
+
{
|
734 |
+
|
735 |
+
$href = $arr["value"];
|
736 |
+
$target = $arr["target"];
|
737 |
+
$button = "<li class=\"wp-not-current-submenu menu-top menu-top-last\" id=\"menu-$name\"><a href=\"$href\" target=\"$target\" class=\"wp-not-current-submenu menu-top\"><div class=\"wp-menu-arrow\"><div></div></div><div class=\"wp-menu-image dashicons-before dashicons-admin-$name\"><br></div><div class=\"wp-menu-name\">$name</div></a></li>";
|
738 |
+
|
739 |
+
return $button;
|
740 |
+
}
|
741 |
+
|
742 |
+
function agca_decode($code)
|
743 |
+
{
|
744 |
+
$code = str_replace("{", "", $code);
|
745 |
+
$code = str_replace("}", "", $code);
|
746 |
+
$code = str_replace("\", \"", "\"|||\"", $code);
|
747 |
+
$elements = explode("|||", $code);
|
748 |
+
|
749 |
+
return $elements;
|
750 |
+
}
|
751 |
+
|
752 |
+
function jsonMenuArray($json, $type)
|
753 |
+
{
|
754 |
+
$arr = explode("|", $json);
|
755 |
+
$elements = "";
|
756 |
+
$array = "";
|
757 |
+
$first = true;
|
758 |
+
//print_r($json);
|
759 |
+
if ($type == "colorizer") {
|
760 |
+
$elements = json_decode($arr[0], true);
|
761 |
+
if ($elements != "") {
|
762 |
+
return $elements;
|
763 |
+
}
|
764 |
+
} else if ($type == "buttons") {
|
765 |
+
$elements = json_decode($arr[0], true);
|
766 |
+
if ($elements != "") {
|
767 |
+
foreach ($elements as $k => $v) {
|
768 |
+
$array .= $this->agca_create_admin_button($k, $v);
|
769 |
}
|
770 |
+
}
|
771 |
+
} else if ($type == "buttonsJq") {
|
772 |
+
$elements = json_decode($arr[0], true);
|
773 |
+
if ($elements != "") {
|
774 |
+
foreach ($elements as $k => $v) {
|
775 |
+
$array .= '<tr><td colspan="2"><button target="' . $v['target'] . '" title="' . $v['value'] . '" type="button">' . $k . '</button> <a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a> <a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
776 |
}
|
777 |
}
|
778 |
+
} else {
|
779 |
+
if (isset($arr[$type])) {
|
780 |
+
$elements = $this->agca_decode($arr[$type]);
|
781 |
+
}
|
782 |
|
783 |
+
if ($elements != "") {
|
784 |
+
foreach ($elements as $element) {
|
785 |
+
if (!$first) {
|
786 |
+
$array .= ",";
|
|
|
|
|
787 |
}
|
788 |
+
$parts = explode(" : ", $element);
|
789 |
+
if (isset($parts[0]) && isset($parts[1])) {
|
790 |
+
$array .= "[" . $parts[0] . ", " . $parts[1] . "]";
|
791 |
+
}
|
792 |
+
$first = false;
|
793 |
+
}
|
794 |
}
|
795 |
+
}
|
796 |
+
|
797 |
+
return $array;
|
798 |
+
}
|
799 |
+
|
800 |
+
function remove_dashboard_widget($widget, $side)
|
801 |
+
{
|
802 |
+
//side can be 'normal' or 'side'
|
803 |
+
global $wp_meta_boxes;
|
804 |
+
remove_meta_box($widget, 'dashboard', $side);
|
805 |
+
}
|
806 |
+
|
807 |
+
function get_wp_version()
|
808 |
+
{
|
809 |
+
global $wp_version;
|
810 |
+
$array = explode('-', $wp_version);
|
811 |
+
$version = $array[0];
|
812 |
+
return $version;
|
813 |
+
}
|
814 |
+
|
815 |
+
function print_page()
|
816 |
+
{
|
817 |
+
if ($this->isGuest() && get_option('agca_admin_bar_frontend_hide')) {
|
818 |
+
return false;
|
819 |
+
}
|
820 |
+
|
821 |
+
if (get_option('agca_admin_bar_frontend_hide') == true) {
|
822 |
+
add_filter('show_admin_bar', '__return_false');
|
823 |
+
?>
|
824 |
+
<style type="text/css">
|
825 |
+
#wpadminbar {
|
826 |
+
display: none;
|
827 |
+
}
|
828 |
+
</style>
|
829 |
+
<script type="text/javascript">
|
830 |
+
window.setTimeout(function () {
|
831 |
+
document.getElementsByTagName('html')[0].setAttribute('style', "margin-top:0px !important");
|
832 |
+
}, 50);
|
833 |
+
</script>
|
834 |
+
<?php
|
835 |
+
}
|
836 |
+
if (get_option('agca_admin_bar_frontend') != true) {
|
837 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
838 |
$this->context = "page";
|
839 |
$wpversion = $this->get_wp_version();
|
840 |
|
841 |
+
?>
|
842 |
+
|
843 |
+
|
844 |
+
<script type="text/javascript">
|
845 |
+
var wpversion = "<?php echo $wpversion; ?>";
|
846 |
+
var agca_version = "<?php echo $this->agca_version; ?>";
|
847 |
+
var agca_debug = <?php echo ($this->agca_debug) ? "true" : "false"; ?>;
|
848 |
+
var jQueryScriptOutputted = false;
|
849 |
+
var agca_context = "page";
|
850 |
+
var agca_orig_admin_menu = [];
|
851 |
+
function initJQuery() {
|
852 |
+
//if the jQuery object isn't available
|
853 |
+
if (typeof(jQuery) == 'undefined') {
|
854 |
+
if (!jQueryScriptOutputted) {
|
855 |
+
//only output the script once..
|
856 |
+
jQueryScriptOutputted = true;
|
857 |
+
//output the script (load it from google api)
|
858 |
+
document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></scr" + "ipt>");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
859 |
}
|
860 |
+
setTimeout("initJQuery()", 50);
|
861 |
+
} else {
|
862 |
+
jQuery(function () {
|
863 |
+
try {
|
864 |
+
<?php if(get_option('agca_header') != true){ ?>
|
865 |
+
jQuery('#wpadminbar').show();
|
866 |
+
<?php } ?>
|
867 |
+
|
868 |
+
<?php $this->print_admin_bar_scripts(); ?>
|
869 |
+
} catch (ex) {
|
870 |
+
}
|
871 |
+
});
|
872 |
}
|
873 |
+
}
|
874 |
+
initJQuery();
|
875 |
+
</script>
|
876 |
+
<script type="text/javascript">
|
877 |
+
<?php echo "var agca_global_plugin_url = '" . trailingslashit(plugins_url(basename(dirname(__FILE__)))) . "';"; ?>
|
878 |
+
</script>
|
879 |
+
<script type="text/javascript"
|
880 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
|
881 |
+
<script type="text/javascript">
|
882 |
+
jQuery(document).ready(function () {
|
883 |
+
<?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide') != true)){
|
884 |
+
foreach($this->colorizer as $k => $v){
|
885 |
+
if(($k != "") and ($v != "")){
|
886 |
+
if(
|
887 |
+
$k == "color_header" ||
|
888 |
+
$k == "color_font_header"
|
889 |
+
){
|
890 |
+
?> updateTargetColor("<?php echo $k;?>", "<?php echo $v;?>"); <?php
|
891 |
+
}
|
892 |
+
|
893 |
+
}
|
894 |
+
}
|
895 |
+
?>
|
896 |
+
|
|
|
|
|
|
|
897 |
<?php
|
898 |
+
}
|
899 |
+
?>
|
900 |
+
});
|
901 |
+
</script>
|
902 |
+
<?php
|
903 |
+
}
|
904 |
+
|
905 |
+
}
|
906 |
+
|
907 |
+
function print_admin_bar_scripts()
|
908 |
+
{
|
909 |
+
?>
|
910 |
+
<?php if (get_option('agca_remove_top_bar_dropdowns') == true) { ?>
|
911 |
+
jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
|
912 |
+
jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
|
913 |
+
jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
|
914 |
+
|
915 |
+
<?php if (get_option('agca_admin_bar_new_content') != "") { ?>
|
916 |
+
jQuery(".new_content_header_submenu").hide();
|
917 |
+
<?php } ?>
|
918 |
+
|
919 |
+
<?php } ?>
|
920 |
+
|
921 |
+
<?php if (get_option('agca_admin_bar_comments') != "") { ?>
|
922 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
|
923 |
+
<?php } ?>
|
924 |
+
<?php if (get_option('agca_admin_bar_new_content') != "") { ?>
|
925 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
|
926 |
+
<?php } ?>
|
927 |
+
<?php if (get_option('agca_admin_bar_new_content_post') != "") { ?>
|
928 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
|
929 |
+
<?php } ?>
|
930 |
+
<?php if (get_option('agca_admin_bar_new_content_link') != "") { ?>
|
931 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
|
932 |
+
<?php } ?>
|
933 |
+
<?php if (get_option('agca_admin_bar_new_content_page') != "") { ?>
|
934 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
|
935 |
+
<?php } ?>
|
936 |
+
<?php if (get_option('agca_admin_bar_new_content_user') != "") { ?>
|
937 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
|
938 |
+
<?php } ?>
|
939 |
+
<?php if (get_option('agca_admin_bar_new_content_media') != "") { ?>
|
940 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
|
941 |
+
<?php } ?>
|
942 |
+
<?php if (get_option('agca_admin_bar_update_notifications') != "") { ?>
|
943 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
|
944 |
+
<?php } ?>
|
945 |
+
<?php if (get_option('agca_admin_bar_admin_themes') != "") { ?>
|
946 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
|
947 |
+
<?php } ?>
|
948 |
+
|
949 |
+
|
950 |
+
<?php if (get_option('agca_header_logo') == true) { ?>
|
951 |
+
jQuery("#wphead #header-logo").css("display","none");
|
952 |
+
jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
|
953 |
+
|
954 |
+
<?php } ?>
|
955 |
+
<?php if (get_option('agca_header_logo_custom') != "") { ?>
|
956 |
+
|
957 |
+
var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
|
958 |
+
|
959 |
+
advanced_url = img_url;
|
960 |
+
image = jQuery("<img/>").attr("src",advanced_url);
|
961 |
+
jQuery(image).load(function() {
|
962 |
+
jQuery("#wpbody-content").prepend(image);
|
963 |
+
});
|
964 |
+
|
965 |
+
<?php } ?>
|
966 |
+
<?php if (get_option('agca_wp_logo_custom') != "") { ?>
|
967 |
+
jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").html("<img style=\"height:28px;margin-top:-4px\"
|
968 |
+
src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\"/>");
|
969 |
+
jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('background-image','none');
|
970 |
+
jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('width','auto');
|
971 |
+
jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',"<?php echo get_bloginfo('wpurl'); ?>");
|
972 |
+
jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
|
973 |
+
jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
|
974 |
+
<?php } ?>
|
975 |
+
<?php if (get_option('agca_remove_site_link') == true) { ?>
|
976 |
+
jQuery("#wp-admin-bar-site-name").css("display","none");
|
977 |
+
|
978 |
+
<?php } ?>
|
979 |
+
<?php if (get_option('agca_wp_logo_custom_link') != "") { ?>
|
980 |
+
var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
|
981 |
+
href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
|
982 |
+
if(href == "%SWITCH%"){
|
983 |
+
href = "<?php echo get_bloginfo('wpurl'); ?>";
|
984 |
+
<?php if ($this->context == "page") {
|
985 |
+
?>href+="/wp-admin";<?php
|
986 |
+
}
|
987 |
+
?>
|
988 |
+
}
|
989 |
+
jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
|
990 |
+
|
991 |
+
<?php } ?>
|
992 |
+
<?php if (get_option('agca_site_heading') == true) { ?>
|
993 |
+
jQuery("#wphead #site-heading").css("display","none");
|
994 |
+
<?php } ?>
|
995 |
+
<?php if (get_option('agca_custom_site_heading') != "") { ?>
|
996 |
+
jQuery("#wphead #site-heading").after('
|
997 |
+
<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
|
998 |
+
jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
|
999 |
+
|
1000 |
+
<?php } ?>
|
1001 |
+
<?php if (get_option('agca_header') == true && $this->context == 'admin') {
|
1002 |
+
?>
|
1003 |
+
jQuery("#wpadminbar").css("display","none");
|
1004 |
+
jQuery("body.admin-bar").css("padding-top","0");
|
1005 |
+
jQuery("#wphead").css("display","none");
|
1006 |
+
jQuery('html.wp-toolbar').css("padding-top","0");
|
1007 |
+
|
1008 |
+
<?php } ?>
|
1009 |
+
<?php if ((get_option('agca_header') == true) && (get_option('agca_header_show_logout') == true)) { ?>
|
1010 |
+
<?php
|
1011 |
+
$agca_logout_text = ((get_option('agca_logout') == "") ? "Log Out" : get_option('agca_logout'));
|
1012 |
+
?>
|
1013 |
+
jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10"
|
1014 |
+
style="float:right;margin-right:20px"
|
1015 |
+
class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
|
1016 |
+
|
1017 |
+
|
1018 |
+
<?php } ?>
|
1019 |
+
<?php if (get_option('agca_howdy') != "") { ?>
|
1020 |
+
var alltext="";
|
1021 |
+
alltext="";
|
1022 |
+
jQuery('li#wp-admin-bar-my-account').css('cursor','default');
|
1023 |
+
alltext = jQuery('li#wp-admin-bar-my-account').html();
|
1024 |
+
if(alltext!=null){
|
1025 |
+
var parts = alltext.split(',');
|
1026 |
+
alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
|
1027 |
+
}
|
1028 |
+
jQuery("li#wp-admin-bar-my-account").html("<a href=\"#\" class=\"ab-item\">"+alltext+"</a>");
|
1029 |
+
|
1030 |
+
<?php } ?>
|
1031 |
+
<?php
|
1032 |
+
if (get_option('agca_custom_title') != "") {
|
1033 |
+
//add_filter('admin_title', '$this->change_title', 10, 2);
|
1034 |
+
|
1035 |
+
}
|
1036 |
+
?>
|
1037 |
+
<?php if (get_option('agca_logout') != "") { ?>
|
1038 |
+
jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
|
1039 |
+
<?php } ?>
|
1040 |
+
<?php if (get_option('agca_remove_your_profile') == true) { ?>
|
1041 |
+
jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
|
1042 |
+
jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
|
1043 |
+
jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
|
1044 |
+
jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
|
1045 |
+
jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
|
1046 |
+
<?php } ?>
|
1047 |
+
<?php if (get_option('agca_logout_only') == true) { ?>
|
1048 |
+
var logout_content = jQuery("li#wp-admin-bar-logout").html();
|
1049 |
+
jQuery("ul#wp-admin-bar-top-secondary").html('
|
1050 |
+
<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
|
1051 |
+
|
1052 |
+
<?php } ?>
|
1053 |
+
|
1054 |
+
<?php
|
1055 |
+
|
1056 |
+
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
function updateAllColors()
|
1060 |
+
{
|
1061 |
+
|
1062 |
+
?>
|
1063 |
+
function updateAllColors(){
|
1064 |
+
<?php
|
1065 |
+
foreach ($this->colorizer as $k => $v) {
|
1066 |
+
if (($k != "") and ($v != "")) {
|
1067 |
+
?> updateTargetColor("<?php echo $k; ?>","<?php echo $v; ?>"); <?php
|
1068 |
+
}
|
1069 |
+
}
|
1070 |
+
?>
|
1071 |
+
jQuery('.color_picker').each(function(){
|
1072 |
+
updateColor(jQuery(this).attr('id'),jQuery(this).val())
|
1073 |
+
});
|
1074 |
+
jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
|
1075 |
+
jQuery('#adminmenu li.wp-menu-open').css('border','none');
|
1076 |
+
jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
|
1077 |
+
}<?php
|
1078 |
+
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
function admin_capabilities()
|
1082 |
+
{
|
1083 |
+
global $wp_roles;
|
1084 |
+
$capabs = $wp_roles->roles['administrator']['capabilities'];
|
1085 |
+
$capabilitySelector = "";
|
1086 |
+
|
1087 |
+
$selectedValue = get_option('agca_admin_capability');
|
1088 |
+
if ($selectedValue == "") {
|
1089 |
+
$selectedValue = "edit_dashboard";
|
1090 |
+
}
|
1091 |
+
/*echo $selectedValue;
|
1092 |
die;*/
|
1093 |
+
ksort($capabs);
|
1094 |
+
foreach ($capabs as $k => $v) {
|
1095 |
+
$selected = "";
|
1096 |
+
if ($this->startsWith($k, 'level_')) continue;
|
1097 |
+
if ($selectedValue == $k) {
|
1098 |
+
$selected = " selected=\"selected\" ";
|
1099 |
+
}
|
1100 |
+
//TODO:Find out why this does not work
|
1101 |
+
//$capabilitySelector .="<option val=\"$k\" $selected >".str_replace(' ', ' ', ucwords(str_replace('_', ' ', $k))) ."</option>\n";
|
1102 |
+
$capabilitySelector .= "<option val=\"$k\" $selected >" . $k . "</option>\n";
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
$this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">" . $capabilitySelector . "</select>";
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
function admin_capability()
|
1109 |
+
{
|
1110 |
+
$selectedValue = get_option('agca_admin_capability');
|
1111 |
+
if ($selectedValue == "") {
|
1112 |
+
$selectedValue = "edit_dashboard";
|
1113 |
+
}
|
1114 |
+
return $selectedValue;
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
function JSPrintAGCATemplateSettingsVar($settings)
|
1118 |
+
{
|
1119 |
+
echo "\n<script type=\"text/javascript\">\n";
|
1120 |
+
echo "var agca_template_settings = " . preg_replace('#<script(.*?)>(.*?)</script>#is', '', $settings) . ";\n"; //TODO: think about this
|
1121 |
+
echo "</script>";
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
function appendSettingsToAGCATemplateCustomizations($customizations, $settings)
|
1125 |
+
{
|
1126 |
+
$template_settings = json_decode($settings);
|
1127 |
+
//print_r($template_settings);
|
1128 |
+
foreach ($template_settings as $sett) {
|
1129 |
+
$key = $sett->code;
|
1130 |
+
|
1131 |
+
//use default value if user's value is not set
|
1132 |
+
$value = "";
|
1133 |
+
if ($sett->value != "") {
|
1134 |
+
$value = $sett->value;
|
1135 |
+
} else {
|
1136 |
+
$value = $sett->default_value;
|
1137 |
+
}
|
1138 |
+
|
1139 |
+
//Prepare settings
|
1140 |
+
if ($sett->type == 6) {
|
1141 |
+
if ($value !== null && (strtolower($value) == "on" || $value == "1")) {
|
1142 |
+
$value = "true";
|
1143 |
+
} else {
|
1144 |
+
$value = "false";
|
1145 |
+
}
|
1146 |
+
}
|
1147 |
+
$customizations = str_replace("%" . $key . "%", $value, $customizations);
|
1148 |
+
}
|
1149 |
+
return $customizations;
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
function enableSpecificWPVersionCustomizations($customizations)
|
1153 |
+
{
|
1154 |
+
/*enable special CSS for this WP version*/
|
1155 |
+
$ver = $this->get_wp_version();
|
1156 |
+
$customizations = str_replace("/*" . $ver, " ", $customizations);
|
1157 |
+
$customizations = str_replace($ver . "*/", " ", $customizations);
|
1158 |
+
return $customizations;
|
1159 |
+
}
|
1160 |
+
|
1161 |
+
function removeCSSComments($customizations)
|
1162 |
+
{
|
1163 |
+
$customizations = preg_replace('#/\*.*?\*/#si', '', $customizations);
|
1164 |
+
return $customizations;
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
function prepareAGCAAdminTemplates()
|
1168 |
+
{
|
1169 |
+
if (get_option('agca_templates') != "") {
|
1170 |
+
//print_r(get_option( 'agca_templates' ));
|
1171 |
+
$themes = get_option('agca_templates');
|
1172 |
+
$selectedTheme = get_option('agca_selected_template');
|
1173 |
+
if (isset($themes[$selectedTheme])) {
|
1174 |
+
$theme = $themes[$selectedTheme];
|
1175 |
+
add_filter('get_user_option_admin_color', array(&$this, 'change_admin_color'));
|
1176 |
+
|
1177 |
+
echo(stripslashes($theme['common']));
|
1178 |
+
echo "<!--AGCAIMAGES: " . $theme['images'] . "-->";
|
1179 |
+
|
1180 |
+
//KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
|
1181 |
+
if (!((get_option('agca_role_allbutadmin') == true) and (current_user_can($this->admin_capability())))) {
|
1182 |
+
if ($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
|
1183 |
+
//print_r($templdata);
|
1184 |
+
|
1185 |
+
$this->JSPrintAGCATemplateSettingsVar($theme['settings']);
|
1186 |
+
|
1187 |
+
$admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
|
1188 |
+
$admindata = $this->enableSpecificWPVersionCustomizations($admindata);
|
1189 |
+
$admindata = $this->removeCSSComments($admindata);
|
1190 |
+
|
1191 |
+
//echo $admindata;
|
1192 |
+
//REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
|
1193 |
+
$this->templateCustomizations = $admindata;
|
1194 |
+
}
|
1195 |
+
//KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
|
1196 |
+
}
|
1197 |
+
}
|
1198 |
+
}
|
1199 |
+
|
1200 |
+
function agcaAdminSession()
|
1201 |
+
{
|
1202 |
+
$agcaTemplatesSession = array();
|
1203 |
+
|
1204 |
+
//session_destroy();
|
1205 |
+
//session_unset();
|
1206 |
+
|
1207 |
+
/*if(!session_id()){
|
1208 |
+
session_start();
|
1209 |
}*/
|
1210 |
+
|
1211 |
+
if (!isset($_SESSION["AGCA"])) {
|
1212 |
+
$_SESSION["AGCA"] = array();
|
1213 |
+
$_SESSION["AGCA"]["Templates"] = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1214 |
}
|
1215 |
+
//print_r($_SESSION);
|
1216 |
+
|
1217 |
+
if (isset($_SESSION["AGCA"])) {
|
1218 |
+
if (isset($_SESSION["AGCA"]["Templates"])) {
|
1219 |
+
//print_r($_SESSION["AGCA"]["Templates"]);
|
1220 |
+
$agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
|
1221 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1222 |
}
|
1223 |
|
1224 |
+
|
1225 |
+
if ($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"') {
|
1226 |
+
$agcaTemplatesSession = array();
|
1227 |
+
}
|
1228 |
+
|
1229 |
+
|
1230 |
+
return $agcaTemplatesSession;
|
1231 |
+
|
1232 |
+
}
|
1233 |
+
|
1234 |
+
function getAGCAColor($name)
|
1235 |
+
{
|
1236 |
+
if (isset($this->colorizer[$name])) {
|
1237 |
+
echo htmlspecialchars($this->colorizer[$name]);
|
1238 |
+
}
|
1239 |
+
}
|
1240 |
+
|
1241 |
+
function prepareAGCALoginTemplates()
|
1242 |
+
{
|
1243 |
+
if (get_option('agca_templates') != "") {
|
1244 |
+
//print_r(get_option( 'agca_templates' ));
|
1245 |
+
$templates = get_option('agca_templates');
|
1246 |
+
foreach ($templates as $templname => $templdata) {
|
1247 |
+
if ($templname == get_option('agca_selected_template')) {
|
1248 |
+
echo(stripslashes($templdata['common']));
|
1249 |
+
|
1250 |
+
if ($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
|
1251 |
+
$this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
|
1252 |
+
|
1253 |
+
$logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
|
1254 |
+
$logindata = $this->enableSpecificWPVersionCustomizations($logindata);
|
1255 |
+
$logindata = $this->removeCSSComments($logindata);
|
1256 |
+
|
1257 |
+
echo($logindata);
|
1258 |
+
break;
|
1259 |
+
}
|
1260 |
+
}
|
1261 |
+
}
|
1262 |
+
}
|
1263 |
+
|
1264 |
+
function agca_error_check()
|
1265 |
+
{
|
1266 |
+
?>
|
1267 |
+
<script type="text/javascript">
|
1268 |
+
function AGCAErrorPage(msg, url, line) {
|
1269 |
+
var agca_error_details = "___________________________________________________<br/>";
|
1270 |
+
agca_error_details += '<br/>' + msg + '<br/>source:' + url + '<br/>line:' + line + '<br/>';
|
1271 |
+
agca_error_details += "___________________________________________________<br/>";
|
1272 |
+
window.agca_error_details_text = agca_error_details + '<br/>This JavaScript error could stop AG Custom Admin plugin to work properly. If everything still works, you can ignore this notification. <br/><br/>Possible solutions:<br/><br/>1) Make sure to have everything up to date: WordPress site, plugins and themes.<br/><br/>2) Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.<br/><br/>3) Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.<br/><br/>4) If it\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support. <br/><br/>5) Try activating default WordPress theme instead of your current theme.<br/><br/>6) Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.<br/><br/>7) Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AG Custom Admin plugin, or something unexpected happens, please report that on our <a href="http://wordpressadminpanel.com/agca-support/ag_custom_admin/error-ocurred-javascript-error-caught/" target="_blank">SUPPORT PAGE</a>';
|
1273 |
+
document.getElementsByTagName('html')[0].style.visibility = "visible";
|
1274 |
+
var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
|
1275 |
+
AG Custom Admin caught an error on your site! <a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(show/hide more...)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">' + agca_error_details_text + '</div></div>';
|
1276 |
+
|
1277 |
+
var ph = document.getElementById('agca_error_placeholder');
|
1278 |
+
ph.innerHTML = errorDivHtml;
|
1279 |
+
document.getElementById('agca_news').style.visibility = "hidden";
|
1280 |
+
}
|
1281 |
+
window.onerror = function (msg, url, line) {
|
1282 |
+
window.onload = function () {
|
1283 |
+
AGCAErrorPage(msg, url, line);
|
1284 |
+
}
|
1285 |
+
return true;
|
1286 |
+
};
|
1287 |
+
</script>
|
1288 |
+
<?php
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
function error_check()
|
1292 |
+
{
|
1293 |
+
?>
|
1294 |
+
<script type="text/javascript">
|
1295 |
+
function AGCAErrorOtherPages(msg, url, line) {
|
1296 |
+
var agca_error_details = "___________________________________________________\n";
|
1297 |
+
agca_error_details += '\n' + msg + '\nsource:' + url + '\nline:' + line + '\n';
|
1298 |
+
|
1299 |
+
document.getElementsByTagName('html')[0].style.visibility = "visible";
|
1300 |
+
|
1301 |
+
if (typeof window.console === "object") {
|
1302 |
+
console.log("___________________________________________________");
|
1303 |
+
console.log("AG Custom Admin caught a JavaScript on your site:");
|
1304 |
+
console.log(agca_error_details);
|
1305 |
+
}
|
1306 |
+
}
|
1307 |
+
window.onerror = function (msg, url, line) {
|
1308 |
+
window.onload = function () {
|
1309 |
+
AGCAErrorOtherPages(msg, url, line);
|
1310 |
+
}
|
1311 |
+
return true;
|
1312 |
+
};
|
1313 |
+
</script>
|
1314 |
+
<?php
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
function menu_item_cleartext($name)
|
1318 |
+
{
|
1319 |
+
if (strpos($name, ' <span') !== false) {
|
1320 |
+
$parts = explode(' <span', $name);
|
1321 |
+
$name = $parts[0];
|
1322 |
+
}
|
1323 |
+
$name = trim($name);
|
1324 |
+
return $name;
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
/**
|
1328 |
+
* Loops through all original menu items, and creates customizations array
|
1329 |
+
* applies previous customizations if set
|
1330 |
+
* @return array|mixed|object
|
1331 |
+
*/
|
1332 |
+
function get_menu_customizations()
|
1333 |
+
{
|
1334 |
+
global $menu;
|
1335 |
+
global $submenu;
|
1336 |
+
|
1337 |
+
//var_dump($menu); die;
|
1338 |
+
$previousCustomizations = json_decode(get_option('ag_edit_adminmenu_json_new'), true);
|
1339 |
+
|
1340 |
+
$customizationsSet = true;
|
1341 |
+
if ($previousCustomizations == null) {
|
1342 |
+
$customizationsSet = false;
|
1343 |
+
}
|
1344 |
+
|
1345 |
+
//set default menu configuration
|
1346 |
+
//and apply previously saved customizations
|
1347 |
+
$m = array();
|
1348 |
+
foreach ($menu as $top) {
|
1349 |
+
$name = $top[0];
|
1350 |
+
$url = $top[2];
|
1351 |
+
$cls = isset($top[5]) ? $top[5] : "";
|
1352 |
+
$remove = false;
|
1353 |
+
if ($name == '') continue;
|
1354 |
+
$pc = null;
|
1355 |
+
$name = $this->menu_item_cleartext($name);
|
1356 |
+
|
1357 |
+
//apply previous submenu customizations
|
1358 |
+
if ($customizationsSet) {
|
1359 |
+
$pc = $previousCustomizations[$url];
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
//get submenu
|
1363 |
+
$s = array();
|
1364 |
+
if (isset($submenu[$url])) {
|
1365 |
+
$sitems = $submenu[$url];
|
1366 |
+
foreach ($sitems as $key => $sub) {
|
1367 |
+
$nameSub = $sub[0];
|
1368 |
+
$urlSub = $sub[2];
|
1369 |
+
$removeSub = false;
|
1370 |
+
$nameSub = $this->menu_item_cleartext($nameSub);
|
1371 |
+
$s[$key] = array(
|
1372 |
+
'name' => $nameSub,
|
1373 |
+
'new' => '',
|
1374 |
+
'remove' => $removeSub,
|
1375 |
+
'url' => $urlSub
|
1376 |
+
);
|
1377 |
+
|
1378 |
+
if (isset($pc) && isset($pc['submenus'])) {
|
1379 |
+
$s[$key]['new'] = $pc['submenus'][$key]['new'];
|
1380 |
+
$s[$key]['remove'] = $pc['submenus'][$key]['remove'];
|
1381 |
+
|
1382 |
+
if ($s[$key]['new'] == null) {
|
1383 |
+
$s[$key]['new'] = '';
|
1384 |
+
}
|
1385 |
+
if ($s[$key]['remove'] == null) {
|
1386 |
+
$s[$key]['remove'] = false;
|
1387 |
+
}
|
1388 |
+
}
|
1389 |
+
}
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
$m[$url] = array(
|
1393 |
+
'name' => $name,
|
1394 |
+
'remove' => $remove,
|
1395 |
+
'new' => '',
|
1396 |
+
'url' => $url,
|
1397 |
+
'cls' => $cls,
|
1398 |
+
'submenus' => $s
|
1399 |
+
);
|
1400 |
+
|
1401 |
+
//apply previous top menu customizations
|
1402 |
+
if ($customizationsSet) {
|
1403 |
+
$pc = $previousCustomizations[$url];
|
1404 |
+
if (isset($pc)) {
|
1405 |
+
$m[$url]['remove'] = $pc['remove'];
|
1406 |
+
$m[$url]['new'] = $pc['new'];
|
1407 |
+
}
|
1408 |
+
}
|
1409 |
+
}
|
1410 |
+
return $m;
|
1411 |
+
}
|
1412 |
+
|
1413 |
+
/**
|
1414 |
+
* Applies customizations to admin menu
|
1415 |
+
*/
|
1416 |
+
function customized_menu()
|
1417 |
+
{
|
1418 |
+
$customizations = $this->get_menu_customizations();
|
1419 |
+
global $menu;
|
1420 |
+
global $submenu;
|
1421 |
+
|
1422 |
+
//print_r($submenu);die;
|
1423 |
+
//apply customizations to original admin menu
|
1424 |
+
foreach ($menu as $key => $top) {
|
1425 |
+
$url = $top[2];
|
1426 |
+
if (isset($customizations[$url])) {
|
1427 |
+
$topCustomized = $customizations[$url];
|
1428 |
+
if ($topCustomized['new']) {
|
1429 |
+
$menu[$key][0] = $topCustomized['new'];
|
1430 |
+
}
|
1431 |
+
if ($topCustomized['remove']) {
|
1432 |
+
unset($menu[$key]);
|
1433 |
+
}
|
1434 |
+
}
|
1435 |
+
}
|
1436 |
+
foreach ($submenu as $topkey => $subs) {
|
1437 |
+
foreach ($subs as $subkey => $sub) {
|
1438 |
+
if (isset($customizations[$topkey]['submenus'][$subkey])) {
|
1439 |
+
$cs = $customizations[$topkey]['submenus'][$subkey];
|
1440 |
+
if ($cs['new']) {
|
1441 |
+
$submenu[$topkey][$subkey][0] = preg_replace("/" . $cs['name'] . "/", $cs['new'], $submenu[$topkey][$subkey][0], 1);
|
1442 |
+
}
|
1443 |
+
if ($cs['remove']) {
|
1444 |
+
unset($submenu[$topkey][$subkey]);
|
1445 |
+
}
|
1446 |
+
}
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
}
|
1450 |
+
|
1451 |
+
/**
|
1452 |
+
* Used only for removing admin menu customizations to AGCA 1.5 version or later
|
1453 |
+
* @param $checkboxes
|
1454 |
+
* @param $textboxes
|
1455 |
+
*/
|
1456 |
+
function migrate_menu_customizations($checkboxes, $textboxes)
|
1457 |
+
{
|
1458 |
+
$customizations = $this->get_menu_customizations();
|
1459 |
+
global $menu;
|
1460 |
+
/*print_r($menu);
|
1461 |
print_r($customizations);
|
1462 |
print_r($textboxes);*/
|
1463 |
|
1464 |
+
$oldTopValue = "";
|
1465 |
+
|
1466 |
+
|
1467 |
+
//Migrate checkboxes
|
1468 |
+
foreach ($checkboxes as $key => $value) {
|
1469 |
+
$isTop = false;
|
1470 |
+
$oldSubValue = "";
|
1471 |
+
if (strpos($key, '<-TOP->') !== false) {
|
1472 |
+
$oldTopValue = str_replace('<-TOP->', '', $key);
|
1473 |
+
$isTop = true;
|
1474 |
+
} else {
|
1475 |
+
$oldSubValue = $key;
|
1476 |
+
}
|
1477 |
+
if ($value == 'checked') {
|
1478 |
+
$topIndex = "";
|
1479 |
+
foreach ($customizations as $k => $c) {
|
1480 |
+
if ($c['cls'] == $oldTopValue) {
|
1481 |
+
$topIndex = $k;
|
1482 |
+
break;
|
1483 |
+
}
|
1484 |
+
}
|
1485 |
+
if ($topIndex == "") continue;
|
1486 |
+
if ($isTop) {
|
1487 |
+
$customizations[$topIndex]['remove'] = true;
|
1488 |
+
} else {
|
1489 |
+
if (is_array($customizations[$topIndex]['submenus'])) {
|
1490 |
+
foreach ($customizations[$topIndex]['submenus'] as $skey => $sval) {
|
1491 |
+
if ($sval['name'] == $oldSubValue) {
|
1492 |
+
$customizations[$topIndex]['submenus'][$skey]['remove'] = true;
|
1493 |
+
}
|
1494 |
+
}
|
1495 |
+
}
|
1496 |
+
}
|
1497 |
+
}
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
//Migrate textboxes
|
1501 |
+
foreach ($textboxes as $key => $value) {
|
1502 |
+
$isTop = false;
|
1503 |
+
$oldSubValue = "";
|
1504 |
+
if (strpos($key, '<-TOP->') !== false) {
|
1505 |
+
$oldTopValue = str_replace('<-TOP->', '', $key);
|
1506 |
+
$isTop = true;
|
1507 |
+
} else {
|
1508 |
+
$oldSubValue = $key;
|
1509 |
+
}
|
1510 |
+
if ($value != '') {
|
1511 |
+
$topIndex = "";
|
1512 |
+
foreach ($customizations as $k => $c) {
|
1513 |
+
if ($c['cls'] == $oldTopValue) {
|
1514 |
+
$topIndex = $k;
|
1515 |
+
break;
|
1516 |
+
}
|
1517 |
+
}
|
1518 |
+
if ($topIndex == "") continue;
|
1519 |
+
if ($isTop) {
|
1520 |
+
$customizations[$topIndex]['new'] = $value;
|
1521 |
+
} else {
|
1522 |
+
if (is_array($customizations[$topIndex]['submenus'])) {
|
1523 |
+
foreach ($customizations[$topIndex]['submenus'] as $skey => $sval) {
|
1524 |
+
if ($sval['name'] == $oldSubValue) {
|
1525 |
+
if ($customizations[$topIndex]['submenus'][$skey]['name'] != $value) {
|
1526 |
+
$customizations[$topIndex]['submenus'][$skey]['new'] = $value;
|
1527 |
+
}
|
1528 |
+
}
|
1529 |
+
}
|
1530 |
+
}
|
1531 |
+
}
|
1532 |
+
}
|
1533 |
+
}
|
1534 |
+
update_option('ag_edit_adminmenu_json', '');//remove previous admin menu configuration
|
1535 |
+
update_option('ag_edit_adminmenu_json_new', json_encode($customizations));
|
1536 |
+
}
|
1537 |
+
|
1538 |
+
function print_admin_css()
|
1539 |
+
{
|
1540 |
+
$agcaTemplateSession = $this->agcaAdminSession();
|
1541 |
+
$wpversion = $this->get_wp_version();
|
1542 |
+
$this->context = "admin";
|
1543 |
+
$this->error_check();
|
1544 |
+
?>
|
1545 |
+
<script type="text/javascript">
|
1546 |
+
var wpversion = "<?php echo $wpversion; ?>";
|
1547 |
+
var agca_debug = <?php echo ($this->agca_debug) ? "true" : "false"; ?>;
|
1548 |
+
var agca_version = "<?php echo $this->agca_version; ?>";
|
1549 |
+
var agcaTemplatesSession = <?php echo ($agcaTemplateSession == null) ? "[]" : $agcaTemplateSession; ?>;
|
1550 |
+
var errors = false;
|
1551 |
+
var isSettingsImport = false;
|
1552 |
+
var agca_context = "admin";
|
1553 |
+
var roundedSidberSize = 0;
|
1554 |
+
var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
|
1555 |
+
var agca_admin_menu = <?php echo json_encode($this->get_menu_customizations()) ?>;
|
1556 |
+
</script>
|
1557 |
+
<?php
|
1558 |
+
$this->prepareAGCAAdminTemplates();
|
1559 |
+
$this->agca_get_includes();
|
1560 |
+
$this->admin_capabilities();
|
1561 |
+
get_currentuserinfo();
|
1562 |
+
|
1563 |
+
?>
|
1564 |
+
<?php
|
1565 |
+
//in case that javaScript is disabled only admin can access admin menu
|
1566 |
+
if (!current_user_can($this->admin_capability())) {
|
1567 |
+
?>
|
1568 |
+
<style type="text/css">
|
1569 |
+
#adminmenu {
|
1570 |
+
display: none;
|
1571 |
+
}
|
1572 |
+
</style>
|
1573 |
+
<?php
|
1574 |
+
}
|
1575 |
+
?>
|
1576 |
+
<script type="text/javascript">
|
1577 |
+
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
1578 |
+
<?php
|
1579 |
+
if (isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings'] == 'true') {
|
1580 |
+
echo 'isSettingsImport = true;';
|
1581 |
+
}
|
1582 |
+
?>
|
1583 |
+
</script>
|
1584 |
+
<?php if (get_option('agca_admin_menu_arrow') == true) { ?>
|
1585 |
+
<style type="text/css">
|
1586 |
+
.wp-has-current-submenu:after {
|
1587 |
+
border: none !important;
|
1588 |
+
}
|
1589 |
+
|
1590 |
+
#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
|
1591 |
+
border: none !important;
|
1592 |
+
}
|
1593 |
+
</style>
|
1594 |
+
<?php } ?>
|
1595 |
+
<script type="text/javascript">
|
1596 |
+
/* <![CDATA[ */
|
1597 |
+
jQuery(document).ready(function () {
|
1598 |
+
try {
|
1599 |
+
|
1600 |
+
<?php /*CHECK OTHER PLUGINS*/
|
1601 |
+
$this->check_active_plugin();
|
1602 |
+
|
1603 |
+
if($this->active_plugin["ozh"]){
|
1604 |
+
?>
|
1605 |
+
jQuery('ul#adminmenu').css('display', 'none');
|
1606 |
+
jQuery('#footer-ozh-oam').css('display', 'none');
|
1607 |
+
jQuery('#ag_main_menu li').each(function () {
|
1608 |
+
if (jQuery(this).text() == "Admin Menu") {
|
1609 |
+
jQuery(this).hide();
|
1610 |
+
}
|
1611 |
+
});
|
1612 |
+
<?php
|
1613 |
+
}
|
1614 |
+
?>
|
1615 |
+
|
1616 |
+
|
1617 |
+
//get saved onfigurations
|
1618 |
+
|
1619 |
+
<?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'), 'buttons'); ?>
|
1620 |
+
var buttons = '<?php echo $buttons; ?>';
|
1621 |
+
|
1622 |
+
<?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'), 'buttonsJq'); ?>
|
1623 |
+
var buttonsJq = '<?php echo $buttonsJq; ?>';
|
1624 |
+
|
1625 |
+
createEditMenuPageNew(agca_admin_menu);
|
1626 |
+
//createEditMenuPageV32(checkboxes, textboxes);
|
1627 |
+
|
1628 |
+
<?php
|
1629 |
+
//if admin, and option to hide settings for admin is set
|
1630 |
+
|
1631 |
+
if((get_option('agca_role_allbutadmin') == true) and current_user_can($this->admin_capability())){
|
1632 |
+
?>
|
1633 |
+
<?php } else{ ?>
|
1634 |
+
<?php if(get_option('agca_admin_menu_brand') != ""){ ?>
|
1635 |
+
additionalStyles = ' style="margin-bottom:-4px" ';
|
1636 |
+
jQuery("#adminmenu").before('<div ' + additionalStyles + ' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
|
1637 |
+
<?php } ?>
|
1638 |
+
<?php if(get_option('agca_admin_menu_brand_link') != ""){ ?>
|
1639 |
+
|
1640 |
+
var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
|
1641 |
+
href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
|
1642 |
+
|
1643 |
+
jQuery("#sidebar_adminmenu_logo").attr('onclick', 'window.open(\"' + href + '\");');
|
1644 |
+
jQuery("#sidebar_adminmenu_logo").attr('title', href);
|
1645 |
+
|
1646 |
+
<?php }else{ ?>
|
1647 |
+
href = "<?php echo get_bloginfo('wpurl'); ?>";
|
1648 |
+
jQuery("#sidebar_adminmenu_logo").attr('onclick', 'window.open(\"' + href + '\");');
|
1649 |
+
jQuery("#sidebar_adminmenu_logo").attr('title', href);
|
1650 |
+
<?php } ?>
|
1651 |
+
|
1652 |
+
<?php if(get_option('agca_admin_menu_submenu_round') == true){ ?>
|
1653 |
+
jQuery("#adminmenu .wp-submenu").css("border-radius", "<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
|
1654 |
+
jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius', '');
|
1655 |
+
<?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
|
1656 |
+
roundedSidberSize = <?php echo ($roundedSidebarSize == "") ? "0" : $roundedSidebarSize; ?>;
|
1657 |
+
|
1658 |
+
|
1659 |
+
<?php } ?>
|
1660 |
+
<?php if(get_option('agca_admin_menu_autofold') == "force"){ ?>
|
1661 |
+
jQuery("body").addClass("auto-fold");
|
1662 |
+
<?php } else if(get_option('agca_admin_menu_autofold') == "disable"){ ?>
|
1663 |
+
jQuery("body").removeClass("auto-fold");
|
1664 |
+
<?php } ?>
|
1665 |
+
|
1666 |
+
<?php $this->print_admin_bar_scripts(); ?>
|
1667 |
+
|
1668 |
+
<?php if(get_option('agca_screen_options_menu') == true){ ?>
|
1669 |
+
jQuery("#screen-options-link-wrap").css("display", "none");
|
1670 |
+
<?php } ?>
|
1671 |
+
<?php if(get_option('agca_help_menu') == true){ ?>
|
1672 |
+
jQuery("#contextual-help-link-wrap").css("display", "none");
|
1673 |
+
jQuery("#contextual-help-link").css("display", "none");
|
1674 |
+
<?php } ?>
|
1675 |
+
<?php if(get_option('agca_privacy_options') == true){ ?>
|
1676 |
+
jQuery("#privacy-on-link").css("display", "none");
|
1677 |
+
<?php } ?>
|
1678 |
+
|
1679 |
+
<?php if(get_option('agca_update_bar') == true){ ?>
|
1680 |
+
<?php
|
1681 |
+
if (!function_exists('c2c_no_update_nag')) :
|
1682 |
+
function c2c_no_update_nag()
|
1683 |
+
{
|
1684 |
+
remove_action('admin_notices', 'update_nag', 3);
|
1685 |
+
}
|
1686 |
+
endif;
|
1687 |
+
add_action('admin_init', 'c2c_no_update_nag');
|
1688 |
+
?>
|
1689 |
+
jQuery("#update-nag").css("display", "none");
|
1690 |
+
jQuery(".update-nag").css("display", "none");
|
1691 |
+
<?php } ?>
|
1692 |
+
|
1693 |
+
<?php if(get_option('agca_footer') == true){ ?>
|
1694 |
+
jQuery("#footer,#wpfooter").css("display", "none");
|
1695 |
+
<?php } ?>
|
1696 |
+
|
1697 |
+
<?php if(get_option('agca_footer_left') != ""){ ?>
|
1698 |
+
jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
|
1699 |
+
<?php } ?>
|
1700 |
+
<?php if(get_option('agca_footer_left_hide') == true){ ?>
|
1701 |
+
jQuery("#footer-left").css("display", "none");
|
1702 |
+
<?php } ?>
|
1703 |
+
<?php if(get_option('agca_footer_right') != ""){ ?>
|
1704 |
+
jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
|
1705 |
+
<?php } ?>
|
1706 |
+
<?php if(get_option('agca_footer_right_hide') == true){ ?>
|
1707 |
+
jQuery("#footer-upgrade").css("display", "none");
|
1708 |
+
<?php } ?>
|
1709 |
+
|
1710 |
+
<?php if(get_option('agca_language_bar') == true){ ?>
|
1711 |
+
jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
|
1712 |
+
<?php } ?>
|
1713 |
+
<?php if(get_option('agca_dashboard_icon') == true){ ?>
|
1714 |
+
var className = jQuery("#icon-index").attr("class");
|
1715 |
+
if (className == 'icon32') {
|
1716 |
+
jQuery("#icon-index").attr("id", "icon-index-removed");
|
1717 |
+
}
|
1718 |
+
<?php } ?>
|
1719 |
+
<?php if(get_option('agca_dashboard_text') != ""){ ?>
|
1720 |
+
jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
|
1721 |
+
<?php } ?>
|
1722 |
+
<?php if(get_option('agca_dashboard_text_paragraph') != ""){
|
1723 |
+
require_once(ABSPATH . 'wp-includes/formatting.php');
|
1724 |
+
?>
|
1725 |
+
jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
|
1726 |
+
|
1727 |
+
jQuery("#agca_custom_dashboard_content").html('<br /><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(wpautop(get_option('agca_dashboard_text_paragraph')))); ?>');
|
1728 |
+
<?php } ?>
|
1729 |
+
|
1730 |
+
<?php /*Remove Dashboard widgets*/ ?>
|
1731 |
+
<?php
|
1732 |
|
1733 |
if(get_option('agca_dashboard_widget_welcome')==true){
|
1734 |
+
?>jQuery("#welcome-panel").css("display", "none");
|
1735 |
+
<?php
|
1736 |
}else{
|
1737 |
+
?>jQuery("#welcome-panel").css("display", "block");
|
1738 |
+
<?php
|
1739 |
+
}
|
1740 |
if(get_option('agca_dashboard_widget_il')==true){
|
1741 |
$this->remove_dashboard_widget('dashboard_incoming_links','normal');
|
1742 |
}else{
|
1743 |
+
?>jQuery("#dashboard_incoming_links").css("display", "block");
|
1744 |
+
<?php
|
1745 |
}
|
1746 |
if(get_option('agca_dashboard_widget_plugins')==true){
|
1747 |
$this->remove_dashboard_widget('dashboard_plugins','normal');
|
1748 |
}else{
|
1749 |
+
?>jQuery("#dashboard_plugins").css("display", "block");
|
1750 |
+
<?php
|
1751 |
}
|
1752 |
if(get_option('agca_dashboard_widget_qp')==true){
|
1753 |
$this->remove_dashboard_widget('dashboard_quick_press','side');
|
1754 |
}else{
|
1755 |
+
?>jQuery("#dashboard_quick_press").css("display", "block");
|
1756 |
+
<?php
|
1757 |
}
|
1758 |
if(get_option('agca_dashboard_widget_rn')==true){
|
1759 |
$this->remove_dashboard_widget('dashboard_right_now','normal');
|
1760 |
}else{
|
1761 |
+
?>jQuery("#dashboard_right_now").css("display", "block");
|
1762 |
+
<?php
|
1763 |
}
|
1764 |
if(get_option('agca_dashboard_widget_rd')==true){
|
1765 |
$this->remove_dashboard_widget('dashboard_recent_drafts','side');
|
1766 |
}else{
|
1767 |
+
?>jQuery("#dashboard_recent_drafts").css("display", "block");
|
1768 |
+
<?php
|
1769 |
}
|
1770 |
if(get_option('agca_dashboard_widget_primary')==true){
|
1771 |
$this->remove_dashboard_widget('dashboard_primary','side');
|
1772 |
}else{
|
1773 |
+
?>jQuery("#dashboard_primary").css("display", "block");
|
1774 |
+
<?php
|
1775 |
}
|
1776 |
if(get_option('agca_dashboard_widget_secondary')==true){
|
1777 |
$this->remove_dashboard_widget('dashboard_secondary','side');
|
1778 |
}else{
|
1779 |
+
?>jQuery("#dashboard_secondary").css("display", "block");
|
1780 |
+
<?php
|
1781 |
+
}
|
1782 |
if(get_option('agca_dashboard_widget_activity')==true){
|
1783 |
remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
|
1784 |
}else{
|
1785 |
+
?>jQuery("#dashboard_activity").css("display", "block");<?php
|
1786 |
+
}
|
1787 |
+
|
1788 |
+
?>
|
1789 |
+
|
1790 |
+
<?php /*ADMIN MENU*/ ?>
|
1791 |
+
|
1792 |
+
<?php if(get_option('agca_admin_menu_separators') == true){ ?>
|
1793 |
+
jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
|
1794 |
+
<?php } ?>
|
1795 |
+
<?php if(get_option('agca_admin_menu_icons') == true){ ?>
|
1796 |
+
jQuery(".wp-menu-image").each(function () {
|
1797 |
+
jQuery(this).css("display", "none");
|
1798 |
+
});
|
1799 |
+
jQuery('#adminmenu div.wp-menu-name').css('padding', '8px');
|
1800 |
+
<?php } ?>
|
1801 |
+
<?php if(get_option('agca_admin_menu_arrow') == true){ ?>
|
1802 |
+
jQuery("#adminmenu .wp-menu-arrow").css("visibility", "hidden");
|
1803 |
+
|
1804 |
+
<?php } ?>
|
1805 |
+
<?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
|
1806 |
+
|
1807 |
+
<?php /*If Turned on*/ ?>
|
1808 |
+
|
1809 |
+
<?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
|
1810 |
+
jQuery('#adminmenu > li').each(function () {
|
1811 |
+
if (!jQuery(this).hasClass('agca_button_only')) {
|
1812 |
+
jQuery(this).addClass('noclass');
|
1813 |
+
}
|
1814 |
+
});
|
1815 |
+
<?php /*Only admin see button*/
|
1816 |
+
if (current_user_can($this->admin_capability())){ ?>
|
1817 |
+
jQuery('#adminmenu').append('<?php echo $this->agca_create_admin_button('AG Custom Admin', array('value' => 'tools.php?page=ag-custom-admin/plugin.php', 'target' => '_self')); ?>');
|
1818 |
+
<?php } ?>
|
1819 |
+
<?php } ?>
|
1820 |
+
|
1821 |
+
|
1822 |
+
<?php /*EDIT MENU ITEMS*/?>
|
1823 |
+
<?php if (get_option('ag_edit_adminmenu_json') != "") {
|
1824 |
+
|
1825 |
+
$arr = explode("|", get_option('ag_edit_adminmenu_json'));
|
1826 |
+
|
1827 |
+
$checkboxes = json_decode($arr[0]);
|
1828 |
+
$textboxes = json_decode($arr[1]);
|
1829 |
+
|
1830 |
+
$this->migrate_menu_customizations($checkboxes, $textboxes);
|
1831 |
+
|
1832 |
+
} ?>
|
1833 |
+
|
1834 |
+
<?php if (get_option('ag_edit_adminmenu_json_new') != "") {
|
1835 |
+
$this->customized_menu();
|
1836 |
+
} ?>
|
1837 |
+
|
1838 |
+
|
1839 |
+
|
1840 |
+
|
1841 |
+
/*Add user buttons*/
|
1842 |
+
jQuery('#adminmenu').append(buttons);
|
1843 |
+
|
1844 |
+
<?php /*END If Turned on*/ ?>
|
1845 |
+
<?php } else{ ?>
|
1846 |
+
jQuery("#adminmenu").removeClass("noclass");
|
1847 |
+
<?php } ?>
|
1848 |
+
|
1849 |
+
reloadRemoveButtonEvents();
|
1850 |
+
|
1851 |
+
<?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
|
1852 |
+
//remove collapse menu button
|
1853 |
+
jQuery('#collapse-menu').remove();
|
1854 |
+
<?php } ?>
|
1855 |
+
|
1856 |
+
<?php //COLORIZER ?>
|
1857 |
+
updateAllColors();
|
1858 |
+
<?php //COLORIZER END ?>
|
1859 |
+
<?php } //end of apply for any user except admin ?>
|
1860 |
+
/*Add user buttons*/
|
1861 |
+
jQuery('#ag_add_adminmenu').append(buttonsJq);
|
1862 |
+
|
1863 |
+
|
1864 |
+
} catch (err) {
|
1865 |
+
errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
|
1866 |
+
console.log(errors);
|
1867 |
+
} finally {
|
1868 |
+
jQuery('html').css('visibility', 'visible');
|
1869 |
+
}
|
1870 |
+
<?php
|
1871 |
if($this->saveAfterImport == true){
|
1872 |
?>savePluginSettings();<?php
|
1873 |
+
}
|
1874 |
+
?>
|
1875 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1876 |
});
|
1877 |
+
|
1878 |
+
<?php if(get_option('agca_colorizer_turnonoff') == 'on'){
|
1879 |
+
$this->updateAllColors();
|
1880 |
+
}else{
|
1881 |
+
?>function updateAllColors() {
|
1882 |
+
}
|
1883 |
+
; <?php
|
1884 |
+
} ?>
|
1885 |
+
|
1886 |
+
|
1887 |
+
/* ]]> */
|
1888 |
</script>
|
1889 |
+
<style type="text/css">
|
1890 |
+
.underline_text {
|
1891 |
+
text-decoration: underline;
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
.form-table th {
|
1895 |
+
width: 300px;
|
1896 |
+
}
|
1897 |
+
|
1898 |
+
#dashboard-widgets div.empty-container {
|
1899 |
+
border: none;
|
1900 |
+
}
|
1901 |
+
</style>
|
1902 |
+
<?php
|
1903 |
+
}
|
1904 |
+
|
1905 |
+
function print_login_head()
|
1906 |
+
{
|
1907 |
+
$this->context = "login";
|
1908 |
+
$this->error_check();
|
1909 |
+
$wpversion = $this->get_wp_version();
|
1910 |
+
|
1911 |
+
?>
|
1912 |
+
<script type="text/javascript">
|
1913 |
+
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
1914 |
+
var agca_version = "<?php echo $this->agca_version; ?>";
|
1915 |
+
<?php //var wpversion = "echo $wpversion; ?>
|
1916 |
+
var agca_debug = <?php echo ($this->agca_debug) ? "true" : "false"; ?>;
|
1917 |
+
var isSettingsImport = false;
|
1918 |
+
var agca_context = "login";
|
1919 |
+
</script>
|
1920 |
+
<?php
|
1921 |
+
$this->prepareAGCALoginTemplates();
|
1922 |
+
$this->agca_get_includes();
|
1923 |
+
|
1924 |
+
?>
|
1925 |
+
|
1926 |
+
<script type="text/javascript">
|
1927 |
+
|
1928 |
+
|
1929 |
+
/* <![CDATA[ */
|
1930 |
+
jQuery(document).ready(function () {
|
1931 |
+
try {
|
1932 |
+
<?php if(get_option('agca_login_round_box') == true){ ?>
|
1933 |
+
jQuery("form#loginform").css("border-radius", "<?php echo get_option('agca_login_round_box_size'); ?>px");
|
1934 |
+
jQuery("#login h1 a").css("border-radius", "<?php echo get_option('agca_login_round_box_size'); ?>px");
|
1935 |
+
jQuery("#login h1 a").css("margin-bottom", '10px');
|
1936 |
+
jQuery("#login h1 a").css("padding-bottom", '0');
|
1937 |
+
jQuery("form#lostpasswordform").css("border-radius", "<?php echo get_option('agca_login_round_box_size'); ?>px");
|
1938 |
+
<?php } ?>
|
1939 |
+
<?php if(get_option('agca_login_banner') == true){ ?>
|
1940 |
+
jQuery("#backtoblog").css("display", "none");
|
1941 |
+
<?php } ?>
|
1942 |
+
<?php if(get_option('agca_login_banner_text') == true){ ?>
|
1943 |
+
jQuery("#backtoblog").html('<?php echo addslashes(get_option('agca_login_banner_text')); ?>');
|
1944 |
+
<?php } ?>
|
1945 |
+
<?php if(get_option('agca_login_photo_url') == true && get_option('agca_login_photo_remove') != true){ ?>
|
1946 |
+
advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
|
1947 |
+
var $url = "url(" + advanced_url + ")";
|
1948 |
+
jQuery("#login h1 a").css("background", $url + ' no-repeat');
|
1949 |
+
jQuery("#login h1 a").hide();
|
1950 |
+
image = jQuery("<img />").attr("src", advanced_url);
|
1951 |
+
jQuery(image).load(function () {
|
1952 |
+
var originalWidth = 326;
|
1953 |
+
var widthDiff = this.width - originalWidth;
|
1954 |
+
jQuery("#login h1 a").height(this.height);
|
1955 |
+
jQuery("#login h1 a").width(this.width);
|
1956 |
+
jQuery("#login h1 a").css("background-size", this.width + "px " + this.height + "px");
|
1957 |
+
|
1958 |
+
var loginWidth = jQuery('#login').width();
|
1959 |
+
var originalLoginWidth = 320;
|
1960 |
+
var photoWidth = this.width;
|
1961 |
+
|
1962 |
+
if (loginWidth > photoWidth) {
|
1963 |
+
jQuery("#login h1 a").css('margin', 'auto');
|
1964 |
+
} else {
|
1965 |
+
jQuery("#login h1 a").css('margin-left', -(widthDiff / 2) + ((loginWidth - originalLoginWidth) / 2) + "px");
|
1966 |
+
}
|
1967 |
+
|
1968 |
+
jQuery("#login h1 a").show();
|
1969 |
+
});
|
1970 |
+
<?php } ?>
|
1971 |
+
<?php if(get_option('agca_login_photo_href') == true){ ?>
|
1972 |
+
var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
|
1973 |
+
$href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
|
1974 |
+
|
1975 |
+
jQuery("#login h1 a").attr("href", $href);
|
1976 |
+
<?php } ?>
|
1977 |
+
<?php if(get_option('agca_login_photo_remove') == true){ ?>
|
1978 |
+
jQuery("#login h1 a").css("display", "none");
|
1979 |
+
<?php } ?>
|
1980 |
+
|
1981 |
+
jQuery("#login h1 a").attr("title", "");
|
1982 |
+
|
1983 |
+
<?php if(get_option('agca_login_register_remove') == true){ ?>
|
1984 |
+
if (jQuery('p#nav').size() > 0) {
|
1985 |
+
jQuery('p#nav').html(jQuery('p#nav').html().replace('|', ''));
|
1986 |
+
}
|
1987 |
+
jQuery('p#nav a').each(function () {
|
1988 |
+
if (jQuery(this).attr('href').indexOf('register') != -1) {
|
1989 |
+
jQuery(this).remove();
|
1990 |
+
}
|
1991 |
+
});
|
1992 |
+
|
1993 |
+
<?php } ?>
|
1994 |
+
<?php if(get_option('agca_login_register_href') != ""){ ?>
|
1995 |
+
jQuery('p#nav a').each(function () {
|
1996 |
+
if (jQuery(this).attr('href').indexOf('register') != -1) {
|
1997 |
+
jQuery(this).attr('href', '<?php echo get_option('agca_login_register_href'); ?>');
|
1998 |
+
}
|
1999 |
+
});
|
2000 |
+
|
2001 |
+
<?php } ?>
|
2002 |
+
|
2003 |
+
<?php if(get_option('agca_login_lostpassword_remove') == true){ ?>
|
2004 |
+
if (jQuery('p#nav').size() > 0) {
|
2005 |
+
jQuery('p#nav').html(jQuery('p#nav').html().replace('|', ''));
|
2006 |
+
}
|
2007 |
+
jQuery('p#nav a').each(function () {
|
2008 |
+
if (jQuery(this).attr('href').indexOf('lostpassword') != -1) {
|
2009 |
+
jQuery(this).remove();
|
2010 |
+
}
|
2011 |
+
});
|
2012 |
+
|
2013 |
+
<?php } ?>
|
2014 |
+
|
2015 |
+
|
2016 |
+
<?php //COLORIZER ?>
|
2017 |
+
<?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
|
2018 |
+
jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow', 'none');
|
2019 |
+
jQuery("body.login, html").css("background", "<?php echo $this->colorizer['login_color_background'];?>");
|
2020 |
+
|
2021 |
+
|
2022 |
+
<?php
|
2023 |
+
|
2024 |
+
|
2025 |
+
} ?>
|
2026 |
+
<?php //COLORIZER END ?>
|
2027 |
+
} catch (err) {
|
2028 |
+
console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
|
2029 |
+
} finally {
|
2030 |
+
jQuery('html').show();
|
2031 |
+
jQuery('html').css('visibility', 'visible');
|
2032 |
+
}
|
2033 |
+
});
|
2034 |
+
/* ]]> */
|
2035 |
+
|
2036 |
+
</script>
|
2037 |
+
<?php
|
2038 |
+
}
|
2039 |
+
|
2040 |
+
function agca_admin_page()
|
2041 |
+
{
|
2042 |
+
|
2043 |
+
$wpversion = $this->get_wp_version();
|
2044 |
+
$this->agca_error_check();
|
2045 |
+
?>
|
2046 |
+
<?php //includes ?>
|
2047 |
+
<link rel="stylesheet" type="text/css"
|
2048 |
+
href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>"/>
|
2049 |
+
<script type="text/javascript"
|
2050 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
|
2051 |
+
|
2052 |
+
<link rel="stylesheet" type="text/css"
|
2053 |
+
href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>"/>
|
2054 |
+
<script type="text/javascript"
|
2055 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
|
2056 |
+
<script type="text/javascript"
|
2057 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
|
2058 |
+
<script type="text/javascript">
|
2059 |
+
var templates_ep = "<?php echo $this->templates_ep; ?>";
|
2060 |
+
var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
|
2061 |
+
</script>
|
2062 |
+
<script type="text/javascript"
|
2063 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
|
2064 |
+
<?php //includes ?>
|
2065 |
+
<div class="wrap">
|
2066 |
+
<h1 id="agca-title">AG Custom Admin Settings <span
|
2067 |
+
style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
|
2068 |
+
<div id="agca_error_placeholder"></div>
|
2069 |
+
<div id="agca_news"> </div>
|
2070 |
+
<br/>
|
2071 |
+
<form method="post" id="agca_form" action="options.php">
|
2072 |
+
<?php settings_fields('agca-options-group'); ?>
|
2073 |
+
<div id="agca-your-feedback">
|
2074 |
+
<strong>
|
2075 |
+
<span style="color:#005B69">Your feedback:</span>
|
2076 |
+
</strong>
|
2077 |
+
<a class="feedback positive" target="_blank" title="POSITIVE FEEDBACK: I like this plugin!"
|
2078 |
+
href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-positive-feedback/">
|
2079 |
+
<span class="dashicons dashicons-thumbs-up"></span>
|
2080 |
+
</a>
|
2081 |
+
<a class="feedback negative" target="_blank" title="NEGATIVE FEEDBACK: I don't like this plugin."
|
2082 |
+
href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-negative-feedback/">
|
2083 |
+
<span class="dashicons dashicons-thumbs-down"></span>
|
2084 |
+
</a>
|
2085 |
+
</div>
|
2086 |
+
<br/>
|
2087 |
+
<ul id="ag_main_menu">
|
2088 |
+
<li class="selected"><a href="#general-settings" title="General Settings">General</a></li>
|
2089 |
+
<li class="normal"><a href="#admin-bar-settings" title="Settings for admin bar">Admin Bar</a></li>
|
2090 |
+
<li class="normal"><a href="#admin-footer-settings" title="Settings for admin footer">Admin
|
2091 |
+
Footer</a></li>
|
2092 |
+
<li class="normal"><a href="#dashboad-page-settings" title="Settings for Dashboard page">Dashboard
|
2093 |
+
Page</a></li>
|
2094 |
+
<li class="normal"><a href="#login-page-settings" title="Settings for Login page">Login Page</a>
|
2095 |
+
</li>
|
2096 |
+
<li class="normal"><a href="#admin-menu-settings" title="Settings for main admin menu">Admin
|
2097 |
+
Menu</a></li>
|
2098 |
+
<li class="normal"><a href="#ag-colorizer-setttings" title="AG colorizer settings">Colorizer</a>
|
2099 |
+
</li>
|
2100 |
+
<li class="normal"><a href="#ag-advanced" title="My custom scripts">Advanced</a></li>
|
2101 |
+
<li class="normal" style=""><a style="color:#DB6014;font-weight:bolder;" href="#ag-templates"
|
2102 |
+
title="AG Custom Admin Themes">Admin Themes</a></li>
|
2103 |
+
|
2104 |
+
<li style="background:none;border:none;padding:0;"><a id="agca_donate_button" target="_blank"
|
2105 |
+
style="margin-left:8px"
|
2106 |
+
title="Like this plugin? You can support its future development by giving a donation by your wish "
|
2107 |
+
href="http://wordpressadminpanel.com/agca-support/support-for-future-development/"><img
|
2108 |
+
alt="Donate"
|
2109 |
+
src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>images/btn_donate_LG.gif"/></a>
|
2110 |
+
</li>
|
2111 |
+
<li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
|
2112 |
+
</ul>
|
2113 |
+
<div id="agca_advertising">
|
2114 |
+
<ul>
|
2115 |
+
<li style="min-height:105px;display: block"></li>
|
2116 |
+
</ul>
|
2117 |
+
</div>
|
2118 |
+
<div class="agca-clear"></div>
|
2119 |
+
<div id="section_general" style="display:none" class="ag_section">
|
2120 |
+
<h2 class="section_title">General Settings</h2>
|
2121 |
+
<p tabindex="0" class="agca-clear agca-tip"><i><strong>Tip: </strong>Move mouse cursor over the
|
2122 |
+
option label to see more information about an option</i></p>
|
2123 |
+
<table class="agca-clear form-table" width="500px">
|
2124 |
+
<?php
|
2125 |
+
|
2126 |
+
$this->print_checkbox(array(
|
2127 |
+
'name' => 'agca_role_allbutadmin',
|
2128 |
+
'label' => 'Exclude AGCA admin from customizations',
|
2129 |
+
'title' => '<h3>Applying customizations</h3><br><strong>Checked</strong> - apply to all users, except admin<br><strong>Not checked</strong> - apply to everyone</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>Advanced</i> tab and change capability option to define administrators. Only the users with selected capability will be AGCA administrators.</br>'
|
2130 |
+
));
|
2131 |
+
|
2132 |
+
$this->print_options_h3('Pages');
|
2133 |
+
|
2134 |
+
$this->print_checkbox(array(
|
2135 |
+
'hide' => true,
|
2136 |
+
'name' => 'agca_screen_options_menu',
|
2137 |
+
'label' => '"Screen Options" menu',
|
2138 |
+
'title' => 'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
|
2139 |
+
));
|
2140 |
+
|
2141 |
+
$this->print_checkbox(array(
|
2142 |
+
'hide' => true,
|
2143 |
+
'name' => 'agca_help_menu',
|
2144 |
+
'label' => '"Help" menu',
|
2145 |
+
'title' => 'Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)'
|
2146 |
+
));
|
2147 |
+
|
2148 |
+
$this->print_options_h3('Security');
|
2149 |
+
|
2150 |
+
?>
|
2151 |
+
|
2152 |
+
<tr valign="center">
|
2153 |
+
<th scope="row">
|
2154 |
+
<label
|
2155 |
+
title="Choose which WordPress capability will be used to distinguish AGCA admin users from other users.</br>AGCA admin users have access to AGCA settings. AGCA administrators can be excluded from customizations if that option is checked"
|
2156 |
+
for="agca_admin_capability">AGCA admin capability:</label>
|
2157 |
+
</th>
|
2158 |
+
<td><?php echo $this->admin_capabilities; ?> <i>(<strong>Edit Dashboard</strong>
|
2159 |
+
- selected by default)</i>
|
2160 |
+
<p style="margin-left:5px;"><i>Find more information about <a
|
2161 |
+
href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank">WordPress
|
2162 |
+
capabilities</a></i></p>
|
2163 |
+
</td>
|
2164 |
+
<td>
|
2165 |
+
</td>
|
2166 |
+
</tr>
|
2167 |
+
<?php
|
2168 |
+
$this->print_options_h3('Feedback and Support');
|
2169 |
+
|
2170 |
+
?>
|
2171 |
+
<tr valign="center">
|
2172 |
+
<td colspan="2">
|
2173 |
+
<div class="agca-feedback-and-support">
|
2174 |
+
<ul>
|
2175 |
+
<li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=feature"
|
2176 |
+
target="_blank"><span class="dashicons dashicons-lightbulb"></span> Idea
|
2177 |
+
for improvement</a> - submit your idea for improvement
|
2178 |
+
</li>
|
2179 |
+
</ul>
|
2180 |
+
<ul>
|
2181 |
+
<li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=bug"
|
2182 |
+
target="_blank"><span class="dashicons dashicons-megaphone"></span> Report
|
2183 |
+
an issue</a> - if plugin does not work as expected
|
2184 |
+
</li>
|
2185 |
+
</ul>
|
2186 |
+
<ul>
|
2187 |
+
<li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=theme"
|
2188 |
+
target="_blank"><span class="dashicons dashicons-art"></span> Idea
|
2189 |
+
for admin theme</a> - submit your idea for admin theme
|
2190 |
+
</li>
|
2191 |
+
</ul>
|
2192 |
+
<ul>
|
2193 |
+
<li><a href="https://wordpress.org/support/view/plugin-reviews/ag-custom-admin"
|
2194 |
+
target="_blank"><span class="dashicons dashicons-awards"></span> Add
|
2195 |
+
a review on WordPress.org</a> - add your review and rate us on
|
2196 |
+
WordPress.org
|
2197 |
+
</li>
|
2198 |
+
</ul>
|
2199 |
+
<ul>
|
2200 |
+
<li><a href="http://wordpressadminpanel.com/agca-support/" target="_blank"><span
|
2201 |
+
class="dashicons dashicons-shield-alt"></span> Visit our
|
2202 |
+
support site</a> - for any other questions, feel free to contact us
|
2203 |
+
</li>
|
2204 |
+
</ul>
|
2205 |
+
<ul>
|
2206 |
+
<li>
|
2207 |
+
<a href="http://wordpressadminpanel.com/agca-support/support-for-future-development/"
|
2208 |
+
target="_blank"><span class="dashicons dashicons-palmtree"></span> Donate</a>
|
2209 |
+
- only if you find this plugin helpful for your needs
|
2210 |
+
</li>
|
2211 |
+
</ul>
|
2212 |
+
</div>
|
2213 |
+
</td>
|
2214 |
+
<td></td>
|
2215 |
+
</tr>
|
2216 |
+
</table>
|
2217 |
+
</div>
|
2218 |
+
<div id="section_admin_bar" class="ag_section">
|
2219 |
+
<h2 class="section_title">Admin Bar Settings</h2>
|
2220 |
+
<table class="form-table" width="500px">
|
2221 |
+
|
2222 |
+
<?php
|
2223 |
+
$this->print_checkbox(array(
|
2224 |
+
'attributes' => array(
|
2225 |
+
'class' => 'ag_table_major_options',
|
2226 |
+
),
|
2227 |
+
'hide' => true,
|
2228 |
+
'title' => 'Hides admin bar completely from the admin panel',
|
2229 |
+
'name' => 'agca_header',
|
2230 |
+
'label' => '<strong>Admin bar</strong>',
|
2231 |
+
'input-attributes' => 'data-dependant="#agca_header_show_logout_content"',
|
2232 |
+
'input-class' => 'has-dependant',
|
2233 |
+
));
|
2234 |
+
|
2235 |
+
$this->print_checkbox(array(
|
2236 |
+
'attributes' => array(
|
2237 |
+
'class' => 'ag_table_major_options',
|
2238 |
+
'style' => ((get_option('agca_header') != 'true') ? 'display:none' : ''),
|
2239 |
+
'id' => 'agca_header_show_logout_content',
|
2240 |
+
),
|
2241 |
+
'title' => 'Check this if you want to show Log Out button in top right corner of the admin page',
|
2242 |
+
'name' => 'agca_header_show_logout',
|
2243 |
+
'checked' => ((get_option('agca_header') == true) && (get_option('agca_header_show_logout') == true)),
|
2244 |
+
'label' => '<strong>(but show Log Out button)</strong>'
|
2245 |
+
));
|
2246 |
+
|
2247 |
+
$this->print_checkbox(array(
|
2248 |
+
'title' => 'Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.',
|
2249 |
+
'name' => 'agca_admin_bar_frontend',
|
2250 |
+
'hide' => true,
|
2251 |
+
'label' => 'Site pages: Admin bar customizations'
|
2252 |
+
));
|
2253 |
+
|
2254 |
+
$this->print_checkbox(array(
|
2255 |
+
'title' => 'Hides admin bar completely for authenticated users on site pages.',
|
2256 |
+
'name' => 'agca_admin_bar_frontend_hide',
|
2257 |
+
'hide' => true,
|
2258 |
+
'label' => 'Site pages: Admin bar'
|
2259 |
+
));
|
2260 |
+
|
2261 |
+
$this->print_options_h3('Left Side');
|
2262 |
+
|
2263 |
+
$this->print_input(array(
|
2264 |
+
'title' => 'Change default WordPress logo with custom image.',
|
2265 |
+
'name' => 'agca_wp_logo_custom',
|
2266 |
+
'label' => 'Admin bar logo',
|
2267 |
+
'hint' => 'Image URL (maximum height is 28px)'
|
2268 |
+
));
|
2269 |
+
|
2270 |
+
$this->print_input(array(
|
2271 |
+
'title' => 'Custom link on admin bar logo.</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL</br><strong>%SWITCH%</strong> - to switch betweent admin and site area',
|
2272 |
+
'name' => 'agca_wp_logo_custom_link',
|
2273 |
+
'label' => 'Admin bar logo link',
|
2274 |
+
'hint' => 'Link'
|
2275 |
+
));
|
2276 |
+
|
2277 |
+
$this->print_input(array(
|
2278 |
+
'title' => 'Customize WordPress title using custom title template.</br></br>Examples:</br><strong>%BLOG% -- %PAGE%</strong> (will be) <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> (will be) <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> (will be) <i>My Company > My Blog > Tools</i>',
|
2279 |
+
'name' => 'agca_custom_title',
|
2280 |
+
'label' => 'Page title template',
|
2281 |
+
'hint' => 'Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.'
|
2282 |
+
));
|
2283 |
+
|
2284 |
+
$this->print_input(array(
|
2285 |
+
'title' => 'Add custom image on the top of the admin content.',
|
2286 |
+
'name' => 'agca_header_logo_custom',
|
2287 |
+
'label' => 'Header image',
|
2288 |
+
'hint' => 'Image URL'
|
2289 |
+
));
|
2290 |
+
|
2291 |
+
|
2292 |
+
$this->print_checkbox(array(
|
2293 |
+
'hide' => true,
|
2294 |
+
'title' => 'Hides small Wordpress logo from the admin bar',
|
2295 |
+
'name' => 'agca_header_logo',
|
2296 |
+
'label' => 'WordPress logo'
|
2297 |
+
));
|
2298 |
+
|
2299 |
+
$this->print_checkbox(array(
|
2300 |
+
'hide' => true,
|
2301 |
+
'title' => 'Hides WordPress context menu on WordPress logo icon from admin bar',
|
2302 |
+
'name' => 'agca_remove_top_bar_dropdowns',
|
2303 |
+
'label' => 'WordPress logo context menu'
|
2304 |
+
));
|
2305 |
+
|
2306 |
+
$this->print_checkbox(array(
|
2307 |
+
'hide' => true,
|
2308 |
+
'title' => 'Hides site name link from the admin bar',
|
2309 |
+
'name' => 'agca_remove_site_link',
|
2310 |
+
'label' => 'Site name'
|
2311 |
+
));
|
2312 |
+
|
2313 |
+
$this->print_checkbox(array(
|
2314 |
+
'hide' => true,
|
2315 |
+
'title' => 'Hides update notifications from admin bar',
|
2316 |
+
'name' => 'agca_admin_bar_update_notifications',
|
2317 |
+
'label' => 'Update notifications'
|
2318 |
+
));
|
2319 |
+
|
2320 |
+
$this->print_checkbox(array(
|
2321 |
+
'hide' => true,
|
2322 |
+
'title' => 'Hides comments block from admin bar',
|
2323 |
+
'name' => 'agca_admin_bar_comments',
|
2324 |
+
'label' => '"Comments" block'
|
2325 |
+
));
|
2326 |
+
|
2327 |
+
$this->print_checkbox(array(
|
2328 |
+
'hide' => true,
|
2329 |
+
'attributes' => array(
|
2330 |
+
'style' => 'margin-top:20px;'
|
2331 |
+
),
|
2332 |
+
'title' => 'Hides "+ New" block and its context menu from admin bar',
|
2333 |
+
'name' => 'agca_admin_bar_new_content',
|
2334 |
+
'label' => '"+ New" block',
|
2335 |
+
'input-attributes' => 'data-dependant=".new_content_header_submenu"',
|
2336 |
+
'input-class' => 'has-dependant dependant-opposite'
|
2337 |
+
));
|
2338 |
+
|
2339 |
+
$this->print_checkbox(array(
|
2340 |
+
'hide' => true,
|
2341 |
+
'attributes' => array(
|
2342 |
+
'class' => 'new_content_header_submenu'
|
2343 |
+
),
|
2344 |
+
'title' => 'Hides "Post" sub-menu from "+ New" block on admin bar',
|
2345 |
+
'name' => 'agca_admin_bar_new_content_post',
|
2346 |
+
'label' => ' "+ New" -> Post sub-menu'
|
2347 |
+
));
|
2348 |
+
|
2349 |
+
$this->print_checkbox(array(
|
2350 |
+
'hide' => true,
|
2351 |
+
'attributes' => array(
|
2352 |
+
'class' => 'new_content_header_submenu'
|
2353 |
+
),
|
2354 |
+
'title' => 'Hides "Link" sub-menu from "+ New" block on admin bar',
|
2355 |
+
'name' => 'agca_admin_bar_new_content_link',
|
2356 |
+
'label' => ' "+ New" -> Link sub-menu'
|
2357 |
+
));
|
2358 |
+
|
2359 |
+
$this->print_checkbox(array(
|
2360 |
+
'hide' => true,
|
2361 |
+
'attributes' => array(
|
2362 |
+
'class' => 'new_content_header_submenu'
|
2363 |
+
),
|
2364 |
+
'title' => 'Hides "Page" sub-menu from "+ New" block on admin bar',
|
2365 |
+
'name' => 'agca_admin_bar_new_content_page',
|
2366 |
+
'label' => ' "+ New" -> Page sub-menu'
|
2367 |
+
));
|
2368 |
+
|
2369 |
+
$this->print_checkbox(array(
|
2370 |
+
'hide' => true,
|
2371 |
+
'attributes' => array(
|
2372 |
+
'class' => 'new_content_header_submenu'
|
2373 |
+
),
|
2374 |
+
'title' => 'Hides "User" sub-menu from "+ New" block on admin bar',
|
2375 |
+
'name' => 'agca_admin_bar_new_content_user',
|
2376 |
+
'label' => ' "+ New" -> User sub-menu'
|
2377 |
+
));
|
2378 |
+
|
2379 |
+
$this->print_checkbox(array(
|
2380 |
+
'hide' => true,
|
2381 |
+
'attributes' => array(
|
2382 |
+
'class' => 'new_content_header_submenu'
|
2383 |
+
),
|
2384 |
+
'title' => 'Hides "Media" sub-menu from "+ New" block on admin bar',
|
2385 |
+
'name' => 'agca_admin_bar_new_content_media',
|
2386 |
+
'label' => ' "+ New" -> Media sub-menu'
|
2387 |
+
));
|
2388 |
+
|
2389 |
+
$this->print_checkbox(array(
|
2390 |
+
'hide' => true,
|
2391 |
+
'title' => 'Hides "Admin themes" from admin bar',
|
2392 |
+
'name' => 'agca_admin_bar_admin_themes',
|
2393 |
+
'label' => '"Admin themes"'
|
2394 |
+
));
|
2395 |
+
|
2396 |
+
$this->print_textarea(array(
|
2397 |
+
'title' => 'Adds custom text in admin top bar.',
|
2398 |
+
'name' => 'agca_custom_site_heading',
|
2399 |
+
'label' => 'Custom blog heading',
|
2400 |
+
'hint' => "<strong>Tip: </strong>You can use HTML tags like <h1> or <a>"
|
2401 |
+
));
|
2402 |
+
|
2403 |
+
|
2404 |
+
$this->print_checkbox(array(
|
2405 |
+
'hide' => true,
|
2406 |
+
'title' => 'Hides yellow bar with information about new WordPress release',
|
2407 |
+
'name' => 'agca_update_bar',
|
2408 |
+
'label' => 'Update WordPress notification'
|
2409 |
+
));
|
2410 |
+
|
2411 |
+
$this->print_options_h3('Right Side');
|
2412 |
+
|
2413 |
+
$this->print_input(array(
|
2414 |
+
'name' => 'agca_howdy',
|
2415 |
+
'label' => 'Change Howdy text',
|
2416 |
+
));
|
2417 |
+
|
2418 |
+
$this->print_input(array(
|
2419 |
+
'title' => 'Put \'Exit\', for example',
|
2420 |
+
'name' => 'agca_logout',
|
2421 |
+
'label' => 'Change Log out text',
|
2422 |
+
));
|
2423 |
+
|
2424 |
+
$this->print_checkbox(array(
|
2425 |
+
'hide' => true,
|
2426 |
+
'name' => 'agca_remove_your_profile',
|
2427 |
+
'label' => '"Edit My Profile" option from dropdown menu'
|
2428 |
+
));
|
2429 |
+
|
2430 |
+
$this->print_checkbox(array(
|
2431 |
+
'title' => 'If selected, hides all elements in top right corner, except Log Out button',
|
2432 |
+
'name' => 'agca_logout_only',
|
2433 |
+
'label' => 'Log out only'
|
2434 |
+
));
|
2435 |
+
|
2436 |
+
?>
|
2437 |
+
|
2438 |
+
</table>
|
2439 |
+
</div>
|
2440 |
+
|
2441 |
+
<div id="section_admin_footer" style="display:none" class="ag_section">
|
2442 |
+
<h2 class="section_title">Admin Footer Settings</h2>
|
2443 |
+
<table class="form-table" width="500px">
|
2444 |
+
<?php
|
2445 |
+
$this->print_checkbox(array(
|
2446 |
+
'hide' => true,
|
2447 |
+
'attributes' => array(
|
2448 |
+
'class' => 'ag_table_major_options'
|
2449 |
+
),
|
2450 |
+
'title' => 'Hides footer with all elements',
|
2451 |
+
'name' => 'agca_footer',
|
2452 |
+
'label' => '<strong>Footer</strong>'
|
2453 |
+
));
|
2454 |
+
|
2455 |
+
$this->print_options_h3('Footer Options');
|
2456 |
+
|
2457 |
+
$this->print_checkbox(array(
|
2458 |
+
'hide' => true,
|
2459 |
+
'title' => 'Hides default text in footer',
|
2460 |
+
'name' => 'agca_footer_left_hide',
|
2461 |
+
'label' => 'Footer text'
|
2462 |
+
));
|
2463 |
+
|
2464 |
+
$this->print_textarea(array(
|
2465 |
+
'title' => 'Replaces text \'Thank you for creating with WordPress\' with custom text',
|
2466 |
+
'name' => 'agca_footer_left',
|
2467 |
+
'label' => 'Change footer text'
|
2468 |
+
));
|
2469 |
+
|
2470 |
+
$this->print_checkbox(array(
|
2471 |
+
'hide' => true,
|
2472 |
+
'title' => 'Hides text \'Get Version ...\' on right',
|
2473 |
+
'name' => 'agca_footer_right_hide',
|
2474 |
+
'label' => 'Version text'
|
2475 |
+
));
|
2476 |
+
|
2477 |
+
$this->print_textarea(array(
|
2478 |
+
'title' => 'Replaces text \'Get Version ...\' with custom text',
|
2479 |
+
'name' => 'agca_footer_right',
|
2480 |
+
'label' => 'Change version text'
|
2481 |
+
));
|
2482 |
+
|
2483 |
+
?>
|
2484 |
+
|
2485 |
+
</table>
|
2486 |
+
</div>
|
2487 |
+
<div id="section_dashboard_page" style="display:none" class="ag_section">
|
2488 |
+
<h2 class="section_title">Dashboard Page Settings</h2>
|
2489 |
+
<table class="form-table" width="500px">
|
2490 |
+
<?php
|
2491 |
+
|
2492 |
+
$this->print_options_h3('Dashboard Page Options');
|
2493 |
+
|
2494 |
+
$this->print_input(array(
|
2495 |
+
'title' => "Main heading ('Dashboard') on Dashboard page",
|
2496 |
+
'name' => 'agca_dashboard_text',
|
2497 |
+
'label' => 'Change Dashboard heading text',
|
2498 |
+
));
|
2499 |
+
|
2500 |
+
?>
|
2501 |
+
<tr valign="center">
|
2502 |
+
<th scope="row">
|
2503 |
+
<label
|
2504 |
+
title="Adds custom text (or HTML) between heading and widgets area on Dashboard page"
|
2505 |
+
for="agca_dashboard_text_paragraph">Add custom Dashboard content<br> <em>(text or
|
2506 |
+
HTML content)</em></label>
|
2507 |
+
</th>
|
2508 |
+
<td class="agca_editor">
|
2509 |
+
<?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
|
2510 |
+
</td>
|
2511 |
+
</tr>
|
2512 |
+
<?php
|
2513 |
+
|
2514 |
+
$this->print_options_h3('Dashboard Widgets Options');
|
2515 |
+
|
2516 |
+
?>
|
2517 |
+
<tr>
|
2518 |
+
<td colspan="2">
|
2519 |
+
<p tabindex="0" class="agca-tip"><i><strong>Note:</strong> These settings override
|
2520 |
+
settings in Screen options on Dashboard page.</i></p>
|
2521 |
+
</td>
|
2522 |
+
</tr>
|
2523 |
+
<?php
|
2524 |
+
$this->print_checkbox(array(
|
2525 |
+
'hide' => true,
|
2526 |
+
'title' => 'Hides Welcome WordPress widget',
|
2527 |
+
'name' => 'agca_dashboard_widget_welcome',
|
2528 |
+
'label' => '"Welcome" widget'
|
2529 |
+
));
|
2530 |
+
|
2531 |
+
$this->print_checkbox(array(
|
2532 |
+
'hide' => true,
|
2533 |
+
'title' => 'Hides Activity dashboard widget',
|
2534 |
+
'name' => 'agca_dashboard_widget_activity',
|
2535 |
+
'label' => '"Activity" widget'
|
2536 |
+
));
|
2537 |
+
|
2538 |
+
$this->print_checkbox(array(
|
2539 |
+
'hide' => true,
|
2540 |
+
'title' => 'Hides Quick Draft dashboard widget',
|
2541 |
+
'name' => 'agca_dashboard_widget_qp',
|
2542 |
+
'label' => '"Quick Draft" widget'
|
2543 |
+
));
|
2544 |
+
|
2545 |
+
$this->print_checkbox(array(
|
2546 |
+
'hide' => true,
|
2547 |
+
'title' => 'Hides At a Glance dashboard widget',
|
2548 |
+
'name' => 'agca_dashboard_widget_rn',
|
2549 |
+
'label' => '"At a Glance" widget'
|
2550 |
+
));
|
2551 |
+
|
2552 |
+
$this->print_checkbox(array(
|
2553 |
+
'hide' => true,
|
2554 |
+
'name' => 'agca_dashboard_widget_primary',
|
2555 |
+
'title' => "This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions",
|
2556 |
+
'label' => '"WordPress News" widget'
|
2557 |
+
));
|
2558 |
+
|
2559 |
+
$this->print_checkbox(array(
|
2560 |
+
'hide' => true,
|
2561 |
+
'name' => 'agca_dashboard_widget_secondary',
|
2562 |
+
'title' => "This is 'Other WordPress News' widget by default",
|
2563 |
+
'label' => 'Secondary widget area'
|
2564 |
+
));
|
2565 |
+
|
2566 |
+
?>
|
2567 |
+
</table>
|
2568 |
+
</div>
|
2569 |
+
<div id="section_login_page" style="display:none" class="ag_section">
|
2570 |
+
<h2 class="section_title">Login Page Settings</h2>
|
2571 |
+
<table class="form-table" width="500px">
|
2572 |
+
<?php
|
2573 |
+
|
2574 |
+
$this->print_options_h3('Login Page Options');
|
2575 |
+
|
2576 |
+
$this->print_checkbox(array(
|
2577 |
+
'hide' => true,
|
2578 |
+
'name' => 'agca_login_banner',
|
2579 |
+
'title' => "Hide back to blog block",
|
2580 |
+
'label' => 'Back to blog text'
|
2581 |
+
));
|
2582 |
+
|
2583 |
+
$this->print_textarea(array(
|
2584 |
+
'name' => 'agca_login_banner_text',
|
2585 |
+
'title' => "Changes '<- Back to ...' text in top bar on Login page",
|
2586 |
+
'label' => 'Change back to blog text',
|
2587 |
+
'hint' => 'Should be wrapped with an anchor tag <a></a>'
|
2588 |
+
));
|
2589 |
+
|
2590 |
+
$this->print_input(array(
|
2591 |
+
'title' => 'If this field is not empty, image from provided url will be visible on Login page',
|
2592 |
+
'name' => 'agca_login_photo_url',
|
2593 |
+
'label' => 'Change Login header image',
|
2594 |
+
'hint' => 'Image URL'
|
2595 |
+
));
|
2596 |
+
|
2597 |
+
$this->print_input(array(
|
2598 |
+
'title' => 'Put here custom link to a web location, that will be triggered on image click',
|
2599 |
+
'name' => 'agca_login_photo_href',
|
2600 |
+
'label' => 'Change link on login image',
|
2601 |
+
'hint' => 'For blog URL use %BLOG%'
|
2602 |
+
));
|
2603 |
+
|
2604 |
+
$this->print_checkbox(array(
|
2605 |
+
'hide' => true,
|
2606 |
+
'title' => 'Hides login image completely',
|
2607 |
+
'name' => 'agca_login_photo_remove',
|
2608 |
+
'label' => 'Login header image',
|
2609 |
+
));
|
2610 |
+
|
2611 |
+
$this->print_checkbox(array(
|
2612 |
+
'title' => 'Rounds box on login page',
|
2613 |
+
'name' => 'agca_login_round_box',
|
2614 |
+
'label' => 'Round box corners',
|
2615 |
+
'input-class' => 'has-dependant',
|
2616 |
+
'input-attributes' => 'data-dependant="#agca_login_round_box_size_block"'
|
2617 |
+
));
|
2618 |
+
|
2619 |
+
$this->print_input(array(
|
2620 |
+
'attributes' => array(
|
2621 |
+
'style' => ((get_option('agca_login_round_box') == 'true') ? 'display:none' : ''),
|
2622 |
+
'id' => 'agca_login_round_box_size_block'
|
2623 |
+
),
|
2624 |
+
'title' => 'Size of rounded box curve',
|
2625 |
+
'name' => 'agca_login_round_box_size',
|
2626 |
+
'label' => 'Round box corners - size',
|
2627 |
+
'input-class' => 'validateNumber',
|
2628 |
+
'hint' => '(Size in px)'
|
2629 |
+
));
|
2630 |
+
|
2631 |
+
$this->print_checkbox(array(
|
2632 |
+
'hide' => true,
|
2633 |
+
'title' => 'Hides register link on login page',
|
2634 |
+
'name' => 'agca_login_register_remove',
|
2635 |
+
'label' => 'Register link',
|
2636 |
+
'input-class' => 'has-dependant dependant-opposite',
|
2637 |
+
'input-attributes' => 'data-dependant="#agca_login_register_href_block"'
|
2638 |
+
));
|
2639 |
+
|
2640 |
+
$this->print_input(array(
|
2641 |
+
'attributes' => array(
|
2642 |
+
'style' => ((get_option('agca_login_register_remove') == 'true') ? 'display:none' : ''),
|
2643 |
+
'id' => 'agca_login_register_href_block'
|
2644 |
+
),
|
2645 |
+
'title' => 'Change register link on login page to point to your custom registration page.',
|
2646 |
+
'name' => 'agca_login_register_href',
|
2647 |
+
'label' => 'Change register link',
|
2648 |
+
'hint' => 'Link to new registration page'
|
2649 |
+
));
|
2650 |
+
|
2651 |
+
$this->print_checkbox(array(
|
2652 |
+
'hide' => true,
|
2653 |
+
'title' => 'Hides lost password link on login page',
|
2654 |
+
'name' => 'agca_login_lostpassword_remove',
|
2655 |
+
'label' => 'Lost password link',
|
2656 |
+
));
|
2657 |
+
?>
|
2658 |
+
</table>
|
2659 |
+
</div>
|
2660 |
+
<?php
|
2661 |
+
/*ADMIN MENU*/
|
2662 |
+
?>
|
2663 |
+
<div id="section_admin_menu" style="display:none" class="ag_section">
|
2664 |
+
<h2 class="section_title">Admin Menu Settings</h2>
|
2665 |
+
<table class="form-table" width="500px">
|
2666 |
+
<tr valign="center" class="ag_table_major_options">
|
2667 |
+
<td><label for="agca_admin_menu_turnonoff"><strong>Apply admin menu customizations</strong></label>
|
2668 |
+
</td>
|
2669 |
+
<td>
|
2670 |
+
<strong>
|
2671 |
+
|
2672 |
+
<input class="agca-radio" type="radio" id="agca_admin_menu_turnonoff_on"
|
2673 |
+
name="agca_admin_menu_turnonoff" title="Apply admin menu customizations"
|
2674 |
+
value="on" <?php if (get_option('agca_admin_menu_turnonoff') == 'on') echo 'checked="checked" '; ?> />
|
2675 |
+
<span class="agca-radio-text on">YES</span>
|
2676 |
+
|
2677 |
+
<input class="agca-radio" type="radio" name="agca_admin_menu_turnonoff"
|
2678 |
+
title="Do not apply admin menu customizations"
|
2679 |
+
value="off" <?php if (get_option('agca_admin_menu_turnonoff') != 'on') echo 'checked="checked"'; ?> />
|
2680 |
+
<span class="agca-radio-text off">NO</span>
|
2681 |
+
</strong>
|
2682 |
+
</td>
|
2683 |
+
</tr>
|
2684 |
+
<tr valign="center" class="ag_table_major_options">
|
2685 |
+
<td><label for="agca_admin_menu_agca_button_only"><strong>Admin menu</strong></label></td>
|
2686 |
+
<td><input class="agca-checkbox visibility" type="checkbox"
|
2687 |
+
name="agca_admin_menu_agca_button_only"
|
2688 |
+
title="Hides admin menu completly (administrator can see 'AG custom admin' button)"
|
2689 |
+
value="true" <?php if (get_option('agca_admin_menu_agca_button_only') == true) echo 'checked="checked" '; ?> />
|
2690 |
+
</td>
|
2691 |
+
</tr>
|
2692 |
+
<?php
|
2693 |
+
$this->print_options_h3('Edit / Remove Menu Items');
|
2694 |
+
?>
|
2695 |
+
<tr>
|
2696 |
+
<td colspan="2">
|
2697 |
+
<input type="button" class="agca_button" id="ag_edit_adminmenu_reset_button"
|
2698 |
+
title="Reset menu settings to default values"
|
2699 |
+
name="ag_edit_adminmenu_reset_button" value="Reset to default settings"/><br/>
|
2700 |
+
<p tabindex="0"><em>(click on the top menu item to show its sub-menus)</em></p>
|
2701 |
+
<table id="ag_edit_adminmenu">
|
2702 |
+
<tr style="background-color:#999;">
|
2703 |
+
<td width="300px">
|
2704 |
+
<div style="float:left;color:#fff;"><h3>Item</h3></div>
|
2705 |
+
<div style="float:right;color:#fff;"><h3>Visibility</h3></div>
|
2706 |
+
</td>
|
2707 |
+
<td width="300px" style="color:#fff;"><h3>Change Text</h3>
|
2708 |
+
</td>
|
2709 |
+
</tr>
|
2710 |
+
</table>
|
2711 |
+
<input type="hidden" size="47" id="ag_edit_adminmenu_json" name="ag_edit_adminmenu_json"
|
2712 |
+
value="<?php echo htmlspecialchars(get_option('ag_edit_adminmenu_json')); ?>"/>
|
2713 |
+
<input type="hidden" size="47" id="ag_edit_adminmenu_json_new"
|
2714 |
+
name="ag_edit_adminmenu_json_new" value=""/>
|
2715 |
+
</td>
|
2716 |
+
<td></td>
|
2717 |
+
</tr>
|
2718 |
+
<?php
|
2719 |
+
$this->print_options_h3('Add New Menu Items');
|
2720 |
+
?>
|
2721 |
+
<tr>
|
2722 |
+
<td colspan="2">
|
2723 |
+
<table id="ag_add_adminmenu">
|
2724 |
+
<tr>
|
2725 |
+
<td colspan="2">
|
2726 |
+
name:<input type="text" size="47" title="New button visible name"
|
2727 |
+
id="ag_add_adminmenu_name" name="ag_add_adminmenu_name"/>
|
2728 |
+
url:<input type="text" size="47" title="New button link"
|
2729 |
+
id="ag_add_adminmenu_url" name="ag_add_adminmenu_url"/>
|
2730 |
+
open in:<select id="ag_add_adminmenu_target" class="agca-selectbox"
|
2731 |
+
style="width:95px">
|
2732 |
+
<option value="_self" selected>same tab</option>
|
2733 |
+
<option value="_blank">new tab</option>
|
2734 |
+
</select>
|
2735 |
+
<input type="button" id="ag_add_adminmenu_button" class="agca_button"
|
2736 |
+
title="Add new item button" name="ag_add_adminmenu_button"
|
2737 |
+
value="Add new item"/>
|
2738 |
+
</td>
|
2739 |
+
<td></td>
|
2740 |
+
</tr>
|
2741 |
+
</table>
|
2742 |
+
<input type="hidden" size="47" id="ag_add_adminmenu_json" name="ag_add_adminmenu_json"
|
2743 |
+
value="<?php echo htmlspecialchars(get_option('ag_add_adminmenu_json')); ?>"/>
|
2744 |
+
</td>
|
2745 |
+
<td>
|
2746 |
+
</td>
|
2747 |
+
</tr>
|
2748 |
+
<?php
|
2749 |
+
$this->print_options_h3('Admin Menu Settings');
|
2750 |
+
?>
|
2751 |
+
<tr valign="center">
|
2752 |
+
<th scope="row">
|
2753 |
+
<label title="Choose how admin menu should behave on mobile devices / small screens"
|
2754 |
+
for="agca_admin_menu_autofold">Admin menu auto folding</label>
|
2755 |
+
</th>
|
2756 |
+
<td>
|
2757 |
+
<select title="Choose how admin menu should behave on mobile devices / small screens"
|
2758 |
+
class="agca-selectbox" name="agca_admin_menu_autofold">
|
2759 |
+
<option
|
2760 |
+
value="" <?php echo (get_option('agca_admin_menu_autofold') == "") ? " selected " : ""; ?> >
|
2761 |
+
Default
|
2762 |
+
</option>
|
2763 |
+
<option
|
2764 |
+
value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force") ? " selected " : ""; ?> >
|
2765 |
+
Force admin menu auto-folding
|
2766 |
+
</option>
|
2767 |
+
<option
|
2768 |
+
value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable") ? " selected " : ""; ?> >
|
2769 |
+
Disable admin menu auto-folding
|
2770 |
+
</option>
|
2771 |
+
</select>
|
2772 |
+
</td>
|
2773 |
+
</tr>
|
2774 |
+
<?php
|
2775 |
+
|
2776 |
+
$this->print_checkbox(array(
|
2777 |
+
'hide' => true,
|
2778 |
+
'title' => 'Removes empty space between some top menu items',
|
2779 |
+
'name' => 'agca_admin_menu_separators',
|
2780 |
+
'label' => 'Menu items separators',
|
2781 |
+
));
|
2782 |
+
|
2783 |
+
$this->print_checkbox(array(
|
2784 |
+
'hide' => true,
|
2785 |
+
'title' => 'Removes icons from dmin menu buttons',
|
2786 |
+
'name' => 'agca_admin_menu_icons',
|
2787 |
+
'label' => 'Menu icons',
|
2788 |
+
));
|
2789 |
+
|
2790 |
+
$this->print_checkbox(array(
|
2791 |
+
'hide' => true,
|
2792 |
+
'title' => 'Removes small arrow that appears on the top button hover',
|
2793 |
+
'name' => 'agca_admin_menu_arrow',
|
2794 |
+
'label' => 'Sub-menu arrow',
|
2795 |
+
));
|
2796 |
+
|
2797 |
+
$this->print_checkbox(array(
|
2798 |
+
'hide' => true,
|
2799 |
+
'title' => 'Removes collapse button at the end of admin menu',
|
2800 |
+
'name' => 'agca_admin_menu_collapse_button',
|
2801 |
+
'label' => '"Collapse menu" button',
|
2802 |
+
));
|
2803 |
+
|
2804 |
+
$this->print_checkbox(array(
|
2805 |
+
'title' => 'Rounds submenu pop-up box',
|
2806 |
+
'name' => 'agca_admin_menu_submenu_round',
|
2807 |
+
'label' => 'Round sub-menu pop-up box',
|
2808 |
+
'input-attributes' => 'data-dependant="#agca_admin_menu_submenu_round_size"',
|
2809 |
+
'input-class' => 'has-dependant',
|
2810 |
+
));
|
2811 |
+
|
2812 |
+
$this->print_input(array(
|
2813 |
+
'attributes' => array(
|
2814 |
+
'style' => ((get_option('agca_admin_menu_submenu_round') != 'true') ? 'display:none' : ''),
|
2815 |
+
'id' => 'agca_admin_menu_submenu_round_size'
|
2816 |
+
),
|
2817 |
+
'title' => 'Size of rounded box curve',
|
2818 |
+
'name' => 'agca_admin_menu_submenu_round_size',
|
2819 |
+
'label' => 'Round sub-menu pop-up box - size',
|
2820 |
+
'input-class' => 'validateNumber',
|
2821 |
+
'hint' => '(Size in px)'
|
2822 |
+
));
|
2823 |
+
|
2824 |
+
$this->print_input(array(
|
2825 |
+
'title' => 'Adds custom logo above the admin menu',
|
2826 |
+
'name' => 'agca_admin_menu_brand',
|
2827 |
+
'label' => 'Admin menu branding with logo',
|
2828 |
+
'hint' => 'Image URL'
|
2829 |
+
));
|
2830 |
+
|
2831 |
+
$this->print_input(array(
|
2832 |
+
'title' => 'Change branding logo link</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL',
|
2833 |
+
'name' => 'agca_admin_menu_brand_link',
|
2834 |
+
'label' => 'Branding logo link',
|
2835 |
+
'hint' => 'Branding image URL'
|
2836 |
+
));
|
2837 |
+
?>
|
2838 |
+
</table>
|
2839 |
+
</div>
|
2840 |
+
<div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
|
2841 |
+
<h2 class="section_title">Colorizer Page</h2>
|
2842 |
+
<table class="form-table" width="500px">
|
2843 |
+
<tr valign="center" class="ag_table_major_options">
|
2844 |
+
<td><label for="agca_colorizer_turnonoff"><strong>Apply Colorizer settings</strong></label>
|
2845 |
+
</td>
|
2846 |
+
<td><strong><input class="agca-radio" type="radio" name="agca_colorizer_turnonoff"
|
2847 |
+
title="Apply Colorizer customizations"
|
2848 |
+
value="on" <?php if (get_option('agca_colorizer_turnonoff') == 'on') echo 'checked="checked" '; ?> /><span
|
2849 |
+
class="agca-radio-text on">YES</span> <input
|
2850 |
+
class="agca-radio" type="radio" name="agca_colorizer_turnonoff"
|
2851 |
+
title="Do not apply Colorizer customizations"
|
2852 |
+
value="off" <?php if (get_option('agca_colorizer_turnonoff') != 'on') echo 'checked="checked"'; ?> /><span
|
2853 |
+
class="agca-radio-text off">NO</span></strong></td>
|
2854 |
+
</tr>
|
2855 |
+
<?php
|
2856 |
+
$this->print_options_h3('Global Color Options');
|
2857 |
+
|
2858 |
+
$this->print_color('color_background', 'Background:', 'Change admin page background color');
|
2859 |
+
$this->print_color('login_color_background', 'Login page background:', 'Change login page background color');
|
2860 |
+
$this->print_color('color_header', 'Admin bar:', 'Change admin bar (on top) color in admin panel');
|
2861 |
+
|
2862 |
+
$this->print_options_h3('Admin Menu Color Options');
|
2863 |
+
|
2864 |
+
$this->print_color('color_admin_menu_top_button_background', 'Button background:', 'Change button background color');
|
2865 |
+
$this->print_color('color_admin_menu_font', 'Button text:', 'Change button text color');
|
2866 |
+
$this->print_color('color_admin_menu_top_button_current_background', 'Selected button background:', 'Change button background color for current button');
|
2867 |
+
$this->print_color('color_admin_menu_top_button_hover_background', 'Hover button background:', 'Change button background color on mouseover');
|
2868 |
+
$this->print_color('color_admin_menu_submenu_background', 'Sub-menu button background:', 'Change submenu item background color');
|
2869 |
+
$this->print_color('color_admin_menu_submenu_background_hover', 'Sub-menu hover button background:', 'Change submenu item background color on mouseover');
|
2870 |
+
$this->print_color('color_admin_submenu_font', 'Sub-menu text:', 'Sub-menu text color');
|
2871 |
+
$this->print_color('color_admin_menu_behind_background', 'Wrapper background:', 'Change background color of element behind admin menu');
|
2872 |
+
|
2873 |
+
$this->print_options_h3('Font Color Options');
|
2874 |
+
|
2875 |
+
$this->print_color('color_font_content', 'Content text:', 'Change color in content text');
|
2876 |
+
$this->print_color('color_font_header', 'Admin bar text:', 'Change color of admin bar text');
|
2877 |
+
$this->print_color('color_font_footer', 'Footer text:', 'Change color in fotter text');
|
2878 |
+
|
2879 |
+
$this->print_options_h3('Widgets Color Options');
|
2880 |
+
|
2881 |
+
$this->print_color('color_widget_bar', 'Title bar background:', 'Change color in header text');
|
2882 |
+
$this->print_color('color_widget_background', 'Background:', 'Change widget background color');
|
2883 |
+
|
2884 |
+
?>
|
2885 |
+
</table>
|
2886 |
+
<input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json"
|
2887 |
+
value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>"/>
|
2888 |
+
<div id="picker"></div>
|
2889 |
+
</div>
|
2890 |
+
<div id="section_templates" style="display:none" class="ag_section">
|
2891 |
+
<h2 class="section_title"><span style="float:left">Admin Themes</span></h2>
|
2892 |
+
<table class="form-table" width="500px">
|
2893 |
+
<tr valign="center">
|
2894 |
+
<td>
|
2895 |
+
<div id="agca_templates"></div>
|
2896 |
+
</td>
|
2897 |
+
</tr>
|
2898 |
+
<tr>
|
2899 |
+
<td>
|
2900 |
+
<div id="advanced_template_options" style="display:none">
|
2901 |
+
<div class="agca-feedback-and-support">
|
2902 |
+
<ul>
|
2903 |
+
<li>
|
2904 |
+
<a href="http://wordpressadminpanel.com/agca-support/contact/?type=theme"
|
2905 |
+
title="If you have any ideas for theme improvements, or you have new themes requests, please feel free to send us a message"
|
2906 |
+
target="_blank"><span class="dashicons dashicons-art"></span> Submit
|
2907 |
+
your admin themes ideas</a></li>
|
2908 |
+
<li><a style="background: #f08080;color:#fff;"
|
2909 |
+
href="javascript:agca_removeAllTemplates();"
|
2910 |
+
title="WARNING: All installed themes will be removed. To activate them again, you would need to install theme and activate using valid license keys. Free themes can be installed again."><span
|
2911 |
+
style="color:#fff" class="dashicons dashicons-trash"></span> Uninstall
|
2912 |
+
all installed themes</a></li>
|
2913 |
+
</ul>
|
2914 |
+
</div>
|
2915 |
+
</div>
|
2916 |
+
</td>
|
2917 |
+
</tr>
|
2918 |
+
</table>
|
2919 |
+
</div>
|
2920 |
+
<div id="section_advanced" style="display:none" class="ag_section">
|
2921 |
+
<h2 class="section_title">Advanced</h2>
|
2922 |
+
<table class="form-table" width="500px">
|
2923 |
+
<tr valign="center">
|
2924 |
+
<td colspan="2">
|
2925 |
+
<p class="agca-tip"><i><strong>Note: </strong>These options will override existing
|
2926 |
+
customizations</i></p>
|
2927 |
+
</td>
|
2928 |
+
<td></td>
|
2929 |
+
</tr>
|
2930 |
+
<tr valign="center">
|
2931 |
+
<th scope="row">
|
2932 |
+
<label title="Add custom CSS script to override existing styles" for="agca_script_css">Custom
|
2933 |
+
CSS script</em></label>
|
2934 |
+
</th>
|
2935 |
+
<td>
|
2936 |
+
<textarea style="width:100%;height:200px"
|
2937 |
+
title="Add custom CSS script to override existing styles" rows="5"
|
2938 |
+
id="agca_custom_css" name="agca_custom_css"
|
2939 |
+
cols="40"><?php echo htmlspecialchars(get_option('agca_custom_css')); ?></textarea>
|
2940 |
+
</td>
|
2941 |
+
</tr>
|
2942 |
+
<tr valign="center">
|
2943 |
+
<th scope="row">
|
2944 |
+
<label title="Add additional custom JavaScript" for="agca_custom_js">Custom
|
2945 |
+
JavaScript</label>
|
2946 |
+
</th>
|
2947 |
+
<td>
|
2948 |
+
<textarea style="width:100%;height:200px" title="Add additional custom JavaScript"
|
2949 |
+
rows="5" name="agca_custom_js" id="agca_custom_js"
|
2950 |
+
cols="40"><?php echo htmlspecialchars(get_option('agca_custom_js')); ?></textarea>
|
2951 |
+
</td>
|
2952 |
+
</tr>
|
2953 |
+
<tr valign="center">
|
2954 |
+
<th scope="row">
|
2955 |
+
<label title="Export / import settings" for="agca_export_import">Export / import
|
2956 |
+
settings</label>
|
2957 |
+
</th>
|
2958 |
+
<td id="import_file_area">
|
2959 |
+
<input class="agca_button" type="button" name="agca_export_settings"
|
2960 |
+
value="Export Settings" onclick="exportSettings();"/></br>
|
2961 |
+
<input type="file" id="settings_import_file" name="settings_import_file"
|
2962 |
+
style="display: none"/>
|
2963 |
+
<input type="hidden" id="_agca_import_settings" name="_agca_import_settings"
|
2964 |
+
value="false"/>
|
2965 |
+
<input type="hidden" id="_agca_export_settings" name="_agca_export_settings"
|
2966 |
+
value="false"/>
|
2967 |
+
<input class="agca_button" type="button" name="agca_import_settings"
|
2968 |
+
value="Import Settings" onclick="importSettings();"/>
|
2969 |
+
</td>
|
2970 |
+
</tr>
|
2971 |
+
</table>
|
2972 |
+
</div>
|
2973 |
+
<p class="submit">
|
2974 |
+
<input type="button" id="save_plugin_settings" style="padding:0px"
|
2975 |
+
title="Save AG Custom Admin configuration" class="button-primary"
|
2976 |
+
value="<?php _e('Save Changes') ?>" onClick="savePluginSettings()"/>
|
2977 |
+
</p>
|
2978 |
+
|
2979 |
+
</form>
|
2980 |
+
<form id="agca_templates_form" name="agca_templates_form"
|
2981 |
+
action="<?php echo $_SERVER['PHP_SELF']; ?>?page=ag-custom-admin/plugin.php" method="post">
|
2982 |
+
<input type="hidden" name="_agca_save_template" value="true"/>
|
2983 |
+
<input type="hidden" id="templates_data" name="templates_data" value=""/>
|
2984 |
+
<input type="hidden" id="templates_name" name="templates_name" value=""/>
|
2985 |
+
</form>
|
2986 |
+
</div>
|
2987 |
+
<?php
|
2988 |
+
}
|
2989 |
+
|
2990 |
+
#region PRIVATE METHODS
|
2991 |
+
function print_checkbox($data)
|
2992 |
+
{
|
2993 |
+
$strAttributes = '';
|
2994 |
+
$strOnchange = '';
|
2995 |
+
$strInputClass = '';
|
2996 |
+
$strInputAttributes = '';
|
2997 |
+
$isChecked = false;
|
2998 |
+
|
2999 |
+
if (isset($data['attributes'])) {
|
3000 |
+
foreach ($data['attributes'] as $key => $val) {
|
3001 |
+
$strAttributes .= ' ' . $key . '="' . $val . '"';
|
3002 |
+
}
|
3003 |
+
}
|
3004 |
+
if (isset($data['input-class'])) {
|
3005 |
+
$strInputClass = $data['input-class'];
|
3006 |
+
}
|
3007 |
+
if (isset($data['hide'])) {
|
3008 |
+
$strInputClass .= " visibility";
|
3009 |
+
}
|
3010 |
+
if (isset($data['input-attributes'])) {
|
3011 |
+
$strInputAttributes = $data['input-attributes'];
|
3012 |
+
}
|
3013 |
+
if (isset($data['onchange'])) {
|
3014 |
+
$strOnchange = $data['onchange'];
|
3015 |
+
}
|
3016 |
+
if (!isset($data['title'])) {
|
3017 |
+
$data['title'] = $data['label'];
|
3018 |
+
}
|
3019 |
+
if (isset($data['checked'])) {
|
3020 |
+
$isChecked = $data['checked'];
|
3021 |
+
} else {
|
3022 |
+
//use default check with the option
|
3023 |
+
$isChecked = get_option($data['name']) == true;
|
3024 |
+
}
|
3025 |
+
?>
|
3026 |
+
<tr valign="center" <?php echo $strAttributes ?> >
|
3027 |
+
<th>
|
3028 |
+
<label tabindex="0" title=' <?php echo $data['title'] ?>'
|
3029 |
+
for=" <?php echo $data['name'] ?>"> <?php echo $data['label'] ?></label>
|
3030 |
+
</th>
|
3031 |
+
<td>
|
3032 |
+
<input type="checkbox"
|
3033 |
+
class="agca-checkbox <?php echo $strInputClass ?> " <?php echo $strOnchange ?> <?php echo $strInputAttributes ?>
|
3034 |
+
title='Toggle on/off' name=" <?php echo $data['name'] ?>"
|
3035 |
+
value="true" <?php echo ($isChecked) ? ' checked="checked"' : '' ?> />
|
3036 |
+
</td>
|
3037 |
+
</tr>
|
3038 |
+
<?php
|
3039 |
+
}
|
3040 |
+
|
3041 |
+
function print_input($data)
|
3042 |
+
{
|
3043 |
+
$strHint = '';
|
3044 |
+
$suffix = '';
|
3045 |
+
$strAttributes = '';
|
3046 |
+
$parentAttr = '';
|
3047 |
+
if (isset($data['hint'])) {
|
3048 |
+
$strHint = ' <p><i>' . $data['hint'] . '</i></p>';
|
3049 |
+
}
|
3050 |
+
if (!isset($data['title'])) {
|
3051 |
+
$data['title'] = $data['label'];
|
3052 |
+
}
|
3053 |
+
if (isset($data['suffix'])) {
|
3054 |
+
$suffix = $data['suffix'];
|
3055 |
+
}
|
3056 |
+
if (isset($data['attributes'])) {
|
3057 |
+
foreach ($data['attributes'] as $key => $val) {
|
3058 |
+
$strAttributes .= ' ' . $key . '="' . $val . '"';
|
3059 |
+
}
|
3060 |
+
}
|
3061 |
+
?>
|
3062 |
+
<tr valign="center" <?php echo $strAttributes ?> >
|
3063 |
+
<th>
|
3064 |
+
<label title=" <?php echo $data['title'] ?>"
|
3065 |
+
for=" <?php echo $data['name'] ?>"> <?php echo $data['label'] ?></label>
|
3066 |
+
</th>
|
3067 |
+
<td>
|
3068 |
+
<input id=" <?php echo $data['name'] ?>" title=" <?php echo $data['title'] ?>" type="text" size="47"
|
3069 |
+
name=" <?php echo $data['name'] ?>" value="<?php echo get_option($data['name']); ?>"/>
|
3070 |
+
<a title="Clear" class="agca_button clear"
|
3071 |
+
onClick="jQuery('# <?php echo $data['name'] ?>').val('');"><span
|
3072 |
+
class="dashicons clear dashicons-no-alt"></span></a> <?php echo $suffix ?>
|
3073 |
+
<?php echo $strHint ?>
|
3074 |
+
</td>
|
3075 |
+
</tr>
|
3076 |
+
<?php
|
3077 |
+
}
|
3078 |
+
|
3079 |
+
function print_textarea($data)
|
3080 |
+
{
|
3081 |
+
$strHint = '';
|
3082 |
+
if (isset($data['hint'])) {
|
3083 |
+
$strHint = ' <p><i>' . $data['hint'] . '</i>.</p>';
|
3084 |
+
}
|
3085 |
+
if (!isset($data['title'])) {
|
3086 |
+
$data['title'] = $data['label'];
|
3087 |
+
}
|
3088 |
+
?>
|
3089 |
+
<tr valign="center">
|
3090 |
+
<th scope="row">
|
3091 |
+
<label title=" <?php echo $data['title'] ?>"
|
3092 |
+
for=" <?php echo $data['name'] ?>"> <?php echo $data['label'] ?></label>
|
3093 |
+
</th>
|
3094 |
+
<td>
|
3095 |
+
<textarea title=" <?php echo $data['title'] ?>" rows="5" name=" <?php echo $data['name'] ?>"
|
3096 |
+
cols="40"><?php echo htmlspecialchars(get_option($data['name'])); ?></textarea>
|
3097 |
+
<?php echo $strHint ?>
|
3098 |
+
</td>
|
3099 |
+
</tr>
|
3100 |
+
<?php
|
3101 |
+
}
|
3102 |
+
|
3103 |
+
function print_color($name, $label, $title)
|
3104 |
+
{
|
3105 |
+
?>
|
3106 |
+
<tr valign="center" class="color">
|
3107 |
+
<th><label title=" <?php echo $title ?>" for=" <?php echo $name ?>"> <?php echo $label ?></label></th>
|
3108 |
+
<td><input type="text" id=" <?php echo $name ?>" name=" <?php echo $name ?>" class="color_picker"
|
3109 |
+
value="<?php echo $this->getAGCAColor($name); ?>"/>
|
3110 |
+
<a title="Pick Color" alt=" <?php echo $name ?>" class="pick_color_button agca_button"><span
|
3111 |
+
class="dashicons dashicons-art"></span></a>
|
3112 |
+
<a title="Clear" alt=" <?php echo $name ?>" class="pick_color_button_clear agca_button"><span
|
3113 |
+
class="dashicons clear dashicons-no-alt"></span></a>
|
3114 |
+
</td>
|
3115 |
+
</tr>
|
3116 |
+
<?php
|
3117 |
+
}
|
3118 |
+
|
3119 |
+
function print_options_h3($title)
|
3120 |
+
{
|
3121 |
+
?>
|
3122 |
+
<tr valign="center">
|
3123 |
+
<td colspan="2">
|
3124 |
+
<div class="ag_table_heading"><h3 tabindex="0"> <?php echo $title ?></h3></div>
|
3125 |
+
</td>
|
3126 |
+
<td></td>
|
3127 |
+
</tr>
|
3128 |
+
<?php
|
3129 |
+
}
|
3130 |
+
|
3131 |
+
function print_option_tr()
|
3132 |
+
{
|
3133 |
+
?>
|
3134 |
+
|
3135 |
+
<tr valign="center">
|
3136 |
+
<th><label title="Change submenu item background color" for="color_admin_menu_submenu_background">Submenu
|
3137 |
+
button background color:</label></th>
|
3138 |
+
<td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background"
|
3139 |
+
class="color_picker"
|
3140 |
+
value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_background'); ?>"/>
|
3141 |
+
<input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button agca_button"
|
3142 |
+
value="Pick color"/>
|
3143 |
+
<input type="button" alt="color_admin_menu_submenu_background"
|
3144 |
+
class="pick_color_button_clear agca_button" value="Clear"/>
|
3145 |
+
</td>
|
3146 |
+
</tr>
|
3147 |
+
<?php
|
3148 |
+
}
|
3149 |
+
#endregion
|
3150 |
|
3151 |
}
|
3152 |
+
|
3153 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpressadminpanel.com/ag-custom-admin/
|
|
4 |
Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.4
|
7 |
-
Stable tag: 1.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -155,6 +155,9 @@ If you have the latest WordPress and plugin versions and you still experience so
|
|
155 |
|
156 |
== Change Log ==
|
157 |
|
|
|
|
|
|
|
158 |
= 1.5.2 =
|
159 |
* Small UX improvements on options
|
160 |
|
@@ -457,6 +460,9 @@ If you have the latest WordPress and plugin versions and you still experience so
|
|
457 |
|
458 |
== Upgrade Notice ==
|
459 |
|
|
|
|
|
|
|
460 |
= 1.5.2 =
|
461 |
* Small UX improvements on options
|
462 |
|
4 |
Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 4.4
|
7 |
+
Stable tag: 1.5.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
155 |
|
156 |
== Change Log ==
|
157 |
|
158 |
+
= 1.5.3 =
|
159 |
+
* Fixed issue on PHP 5.3 when short PHP tags are not supported
|
160 |
+
|
161 |
= 1.5.2 =
|
162 |
* Small UX improvements on options
|
163 |
|
460 |
|
461 |
== Upgrade Notice ==
|
462 |
|
463 |
+
= 1.5.3 =
|
464 |
+
* Fixed issue on PHP 5.3 when short PHP tags are not supported
|
465 |
+
|
466 |
= 1.5.2 =
|
467 |
* Small UX improvements on options
|
468 |
|