Absolutely Glamorous Custom Admin - Version 1.2.6

Version Description

  • Fixed hidding top bar issue for site pages
  • Fixed issues with custom content on Dashboard page. Any custom HTML can be used now.
  • Custom CSS script support
  • Custom JAvaScript support
  • Exporting / importing AG Custom Admin customizations
  • Added custom branding field above the admin menu for adding custom brand images
  • Rounding admin menu popups and login page
  • Option for removing Welcome dashboard widget
  • New colorizer options for admin menu, top bar
  • New AGCA info area
  • Fixed caching issues on updates
Download this release

Release Info

Developer argonius
Plugin Icon 128x128 Absolutely Glamorous Custom Admin
Version 1.2.6
Comparing to
See all releases

Code changes from version 1.2.5.3 to 1.2.6

Files changed (9) hide show
  1. ajax.php +59 -0
  2. plugin.php +736 -248
  3. readme.txt +40 -13
  4. screenshot-1.jpg +0 -0
  5. screenshot-2.jpg +0 -0
  6. screenshot-3.jpg +0 -0
  7. screenshot-4.jpg +0 -0
  8. script/ag_script.js +840 -559
  9. style/ag_style.css +29 -0
ajax.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
3
+
4
+
5
+ function saveScript($data,$type){
6
+ $customScriptName =dirname(__FILE__)."/script/mine.js";
7
+ if($type == 'css'){
8
+ $customScriptName =dirname(__FILE__)."/style/mine.css";
9
+ }
10
+ $customScript = fopen($customScriptName, 'w');
11
+ fwrite($customScript, $data);
12
+ fclose($customScript);
13
+ }
14
+
15
+ ?>
16
+ <?php
17
+ require_once('../../../wp-load.php');
18
+ require_once('../../../wp-admin/includes/admin.php');
19
+
20
+ //$current_user = wp_get_current_user();
21
+ global $user_level;
22
+
23
+ //print_r($user_level);
24
+
25
+
26
+ define('DOING_AJAX', true);
27
+ define('WP_ADMIN', true);
28
+
29
+ if ( ! isset( $_POST['action'] ) )
30
+ die('-15');
31
+
32
+
33
+ @header('Content-Type: text/html; charset=' . get_option('blog_charset'));
34
+ send_nosniff_header();
35
+
36
+ do_action('admin_init');
37
+
38
+ if ( ! is_user_logged_in() ) {
39
+ die('-14');
40
+ }else{
41
+ //if user admin
42
+ if($user_level > 9){
43
+ if ( isset( $_POST['action'] ) ) {
44
+ if($_POST['action'] == 'savecss' ){
45
+ if(isset($_POST['data'])){
46
+ saveScript($_POST['data'], "css");
47
+ }
48
+ }else if($_POST['action'] == 'savejs'){
49
+ if(isset($_POST['data'])){
50
+ saveScript(stripslashes($_POST['data']), "js");
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }else{
57
+ echo 'Please do not try this any more. Thanks.';
58
+ }
59
+ ?>
plugin.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpress.org/extend/plugins/ag-custom-admin
5
  Description: Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
6
  Author: Argonius
7
- Version: 1.2.5.3
8
  Author URI: http://wordpress.argonius.com/ag-custom-admin
9
 
10
  Copyright 2011. Argonius (email : info@argonius.com)
@@ -23,8 +23,8 @@ Author URI: http://wordpress.argonius.com/ag-custom-admin
23
  along with this program. If not, see <http://www.gnu.org/licenses/>.
24
  */
25
 
26
- require_once('/../../../../FirePHPCore/lib/FirePHPCore/fb.php');
27
- //fb($var);
28
 
29
  $agca = new AGCA();
30
 
@@ -32,6 +32,8 @@ class AGCA{
32
  private $colorizer="";
33
  private $active_plugin;
34
  private $agca_version;
 
 
35
  public function __construct()
36
  {
37
 
@@ -49,7 +51,8 @@ class AGCA{
49
 
50
  /*Initialize properties*/
51
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
52
- $this->agca_version = "1.2.5.3";
 
53
  }
54
  // Add donate and support information
55
  function jk_filter_plugin_links($links, $file)
@@ -75,10 +78,25 @@ class AGCA{
75
  );
76
  }
77
  function agca_get_includes() {
78
- ?>
79
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css" />
80
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js"></script>
81
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  <?php
83
  }
84
 
@@ -119,11 +137,14 @@ class AGCA{
119
  register_setting( 'agca-options-group', 'agca_login_photo_remove' );
120
  register_setting( 'agca-options-group', 'agca_login_photo_url' );
121
  register_setting( 'agca-options-group', 'agca_login_photo_href' );
 
 
122
 
123
  //register_setting( 'agca-options-group', 'agca_menu_dashboard' ); DEPRECATED 1.2
124
  register_setting( 'agca-options-group', 'agca_dashboard_icon' );
125
  register_setting( 'agca-options-group', 'agca_dashboard_text' );
126
- register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
 
127
  register_setting( 'agca-options-group', 'agca_dashboard_widget_rc' );
128
  register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
129
  register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
@@ -150,12 +171,45 @@ class AGCA{
150
  register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
151
  register_setting( 'agca-options-group', 'agca_admin_menu_separator_first' );
152
  register_setting( 'agca-options-group', 'agca_admin_menu_separator_second' );
153
- register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
 
 
 
 
154
  register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
155
  register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
156
  register_setting( 'agca-options-group', 'ag_colorizer_json' );
157
- register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
158
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  }
160
 
161
  function agca_deactivate() {
@@ -187,12 +241,15 @@ class AGCA{
187
  delete_option( 'agca_login_banner_text' );
188
  delete_option( 'agca_login_photo_remove' );
189
  delete_option( 'agca_login_photo_url' );
190
- delete_option( 'agca_login_photo_href' );
 
 
191
 
192
  //delete_option( 'agca_menu_dashboard' ); DEPRECATED 1.2
193
  delete_option( 'agca_dashboard_icon' );
194
  delete_option( 'agca_dashboard_text' );
195
- delete_option( 'agca_dashboard_text_paragraph' );
 
196
  delete_option( 'agca_dashboard_widget_rc' );
197
  delete_option( 'agca_dashboard_widget_il' );
198
  delete_option( 'agca_dashboard_widget_plugins' );
@@ -219,11 +276,181 @@ class AGCA{
219
  delete_option( 'agca_admin_menu_separator_first' );
220
  delete_option( 'agca_admin_menu_separator_second' );
221
  delete_option( 'agca_admin_menu_icons' );
 
 
 
 
222
  delete_option( 'ag_edit_adminmenu_json' );
223
  delete_option( 'ag_add_adminmenu_json' );
224
  delete_option( 'ag_colorizer_json' );
225
  delete_option( 'agca_colorizer_turnonoff' );
226
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  function agca_create_menu() {
228
  //create new top-level menu
229
  add_management_page( 'AG Custom Admin', 'AG Custom Admin', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
@@ -239,12 +466,9 @@ class AGCA{
239
  $href = $arr;
240
  }
241
  $button ="";
242
- $button .= '<li id="menu-'.$name.'" class="ag-custom-button menu-top menu-top-first '.$class.' menu-top-last">';
243
- /*<div class="wp-menu-image">
244
- <a href="edit-comments.php"><br></a>
245
- </div>*/
246
  $button .= '<div class="wp-menu-toggle" style="display: none;"><br></div>';
247
- $button .= '<a tabindex="1" target="'.$target.'" class="menu-top menu-top-last" href="'.$href.'">'.$name.'<a>';
248
  $button .= '</li>';
249
 
250
  return $button;
@@ -316,12 +540,241 @@ class AGCA{
316
 
317
  function print_page()
318
  {
 
319
  ?><style type="text/css">
320
- #wpadminbar{
321
- display:none;
322
- }
323
- </style><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
 
326
  function print_admin_css()
327
  {
@@ -347,7 +800,13 @@ document.write('<style type="text/css">html{visibility:hidden;}</style>');
347
  var wpversion = "<?php echo $wpversion; ?>";
348
  var agca_version = "<?php echo $this->agca_version; ?>";
349
  var errors = false;
 
350
 
 
 
 
 
 
351
  /* <![CDATA[ */
352
  jQuery(document).ready(function() {
353
 
@@ -398,22 +857,20 @@ try
398
  if((get_option('agca_role_allbutadmin')==true) and ($user_level > 9)){
399
  ?>
400
  <?php } else{ ?>
401
-
402
- if(isWPHigherOrEqualThan("3.3")){
403
- <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
404
-
405
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").hover("visibility","hidden");
406
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo a").attr("href","");
407
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo a").attr("title","");
408
-
409
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-site-name").hover("visibility","hidden");
410
-
411
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
412
- jQuery(".new_content_header_submenu").hide();
413
- <?php } ?>
414
 
415
- <?php } ?>
416
- }
417
 
418
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
419
  jQuery("#screen-options-link-wrap").css("display","none");
@@ -428,173 +885,27 @@ try
428
  <?php if(get_option('agca_privacy_options')==true){ ?>
429
  jQuery("#privacy-on-link").css("display","none");
430
  <?php } ?>
431
- <?php if(get_option('agca_header_logo')==true){ ?>
432
- jQuery("#wphead #header-logo").css("display","none");
433
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
434
-
435
- <?php } ?>
436
- <?php if(get_option('agca_header_logo_custom')!=""){ ?>
437
 
438
-
439
- if(isWPHigherOrEqualThan("3.3")){
440
- var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
441
-
442
- advanced_url = img_url;
443
- image = jQuery("<img />").attr("src",advanced_url);
444
- jQuery(image).load(function() {
445
- jQuery("#wpbody-content").prepend(image);
446
- });
447
- }else{
448
- jQuery("#wphead img#header-logo").attr('src','');
449
- jQuery("#wphead img#header-logo").hide();
450
- var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
451
- advanced_url = img_url+ "?" + new Date().getTime();
452
- image = jQuery("<img />").attr("src",advanced_url);
453
- jQuery(image).load(function() {
454
- jQuery("#wphead img#header-logo").attr('src', advanced_url);
455
- jQuery("#wphead img#header-logo").attr('width',this.width);
456
- jQuery("#wphead img#header-logo").attr('height',this.height);
457
- jQuery("#wphead").css('height', (14 + this.height)+'px');
458
- jQuery("#wphead img#header-logo").show();
459
- });
460
- }
461
-
462
- <?php } ?>
463
- <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
464
- if(isWPHigherOrEqualThan("3.3")){
465
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css("background-image","url('<?php echo get_option('agca_wp_logo_custom'); ?>')");
466
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css("background-position","0");
467
- }
468
- <?php }?>
469
- <?php if(get_option('agca_site_heading')==true){ ?>
470
- jQuery("#wphead #site-heading").css("display","none");
471
- <?php } ?>
472
- <?php if(get_option('agca_custom_site_heading')!=""){ ?>
473
- jQuery("#wphead #site-heading").after('<h1><?php echo get_option('agca_custom_site_heading'); ?></h1>');
474
- //3.3FIX
475
- if(isWPHigherOrEqualThan("3.3")){
476
- jQuery("#wp-admin-bar-site-name a:first").html('<?php echo get_option('agca_custom_site_heading'); ?>');
477
- }
478
- <?php } ?>
479
 
480
- if(isWPHigherOrEqualThan("3.3")){
481
- <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
482
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
483
- <?php } ?>
484
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
485
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
486
- <?php } ?>
487
- <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
488
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
489
- <?php } ?>
490
- <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
491
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
492
- <?php } ?>
493
- <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
494
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
495
- <?php } ?>
496
- <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
497
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
498
- <?php } ?>
499
- <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
500
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
501
- <?php } ?>
502
- <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
503
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
504
- <?php } ?>
505
- }
506
 
507
- <?php if(get_option('agca_update_bar')==true){ ?>
508
- jQuery("#update-nag").css("display","none");
509
- jQuery(".update-nag").css("display","none");
 
 
 
 
 
 
 
 
510
  <?php } ?>
511
- <?php if(get_option('agca_header')==true){ ?>
512
-
513
- //3.3FIX
514
- if(isWPHigherOrEqualThan("3.3")){
515
- jQuery("#wpadminbar").css("display","none");
516
- }else{
517
- jQuery("#wphead").css("display","none");
518
- }
519
-
520
- <?php } ?>
521
- <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
522
-
523
- if(isWPHigherOrEqualThan("3.3")){
524
- jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item">Log Out</a>');
525
- }else{
526
- var clon ="";
527
- jQuery("div#user_info a").each(function(){
528
- if(jQuery(this).text() =="Log Out"){
529
- clon = jQuery(this).clone();
530
- }
531
- });
532
- if(clon !=""){
533
- jQuery(clon).attr('style','float:right;padding:15px');
534
- jQuery(clon).html('<?php echo ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout')); ?>');
535
- }
536
- jQuery("#wphead").after(clon);
537
- }
538
-
539
- <?php } ?>
540
  <?php if(get_option('agca_footer')==true){ ?>
541
  jQuery("#footer").css("display","none");
542
- <?php } ?>
543
- <?php if(get_option('agca_howdy')!=""){ ?>
544
- if(isWPHigherOrEqualThan("3.3")){
545
- var alltext="";
546
- alltext="";
547
- alltext = jQuery('li#wp-admin-bar-my-account').html();
548
- alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
549
- jQuery("li#wp-admin-bar-my-account").html(alltext);
550
- }else if(isWPHigherOrEqualThan("3.2")){
551
- var alltext="";
552
- alltext="";
553
- alltext = jQuery('#user_info div.hide-if-no-js').html();
554
- alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
555
- jQuery("#user_info div.hide-if-no-js").html(alltext);
556
- }else{
557
- var howdyText = jQuery("#user_info").html();
558
- if(howdyText !=null){
559
- jQuery("#user_info").html("<p>"+"<?php echo get_option('agca_howdy'); ?>"+howdyText.substr(9));
560
- }
561
- }
562
- <?php } ?>
563
- <?php if(get_option('agca_logout')!=""){ ?>
564
- if(isWPHigherOrEqualThan("3.3")){
565
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
566
- }else if(isWPHigherOrEqualThan("3.2")){
567
- jQuery("#user_info #user_info_links a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
568
- }else{
569
- jQuery("#user_info a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
570
- }
571
 
572
- <?php } ?>
573
- <?php if(get_option('agca_remove_your_profile')==true){ ?>
574
- if(isWPHigherOrEqualThan("3.3")){
575
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
576
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
577
- }else if(isWPHigherOrEqualThan("3.2")){
578
- jQuery("#user_info #user_info_links li:eq(0)").remove();
579
- }
580
- <?php } ?>
581
- <?php if(get_option('agca_logout_only')==true){ ?>
582
- if(isWPHigherOrEqualThan("3.3")){
583
- var logout_content = jQuery("li#wp-admin-bar-logout").html();
584
- jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
585
- }else if(isWPHigherOrEqualThan("3.2")){
586
- var logoutText = jQuery("#user_info a:nth-child(2)").text();
587
- <?php if(get_option('agca_logout')!=""){ ?>
588
- logoutText = "<?php echo get_option('agca_logout'); ?>";
589
- <?php } ?>
590
- var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
591
- jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
592
- }else{
593
- var logoutText = jQuery("#user_info a:nth-child(2)").text();
594
- var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
595
- jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
596
- }
597
- <?php } ?>
598
 
599
 
600
  <?php if(get_option('agca_footer_left')!=""){ ?>
@@ -627,13 +938,19 @@ try
627
  jQuery("#dashboard-widgets-wrap").parent().find("h2").text("<?php echo get_option('agca_dashboard_text'); ?>");
628
  <?php } ?>
629
  <?php if(get_option('agca_dashboard_text_paragraph')!=""){ ?>
630
- jQuery("#wpbody-content #dashboard-widgets-wrap").before('<br /><p style=\"text-indent:45px;\"><?php echo get_option('agca_dashboard_text_paragraph'); ?></p>');
 
 
631
  <?php } ?>
632
 
633
  <?php /*Remove Dashboard widgets*/ ?>
634
  <?php
635
 
636
-
 
 
 
 
637
  if(get_option('agca_dashboard_widget_rc')==true){
638
  $this->remove_dashboard_widget('dashboard_recent_comments','normal');
639
  }else{
@@ -692,7 +1009,11 @@ try
692
  jQuery(".wp-menu-image").each(function(){
693
  jQuery(this).css("display","none");
694
  });
695
- <?php } ?>
 
 
 
 
696
  <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
697
 
698
  <?php /*If Turned on*/ ?>
@@ -795,12 +1116,15 @@ try
795
  updateColor(jQuery(this).attr('id'),jQuery(this).val())
796
  });
797
  jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
 
 
798
 
799
  <?php } ?>
800
  <?php //COLORIZER END ?>
801
  <?php } //end of apply for any user except admin ?>
802
  /*Add user buttons*/
803
- jQuery('#ag_add_adminmenu').append(buttonsJq);
 
804
  }catch(err){
805
  errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
806
  alert(errors);
@@ -840,10 +1164,17 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
840
  <script type="text/javascript">
841
  document.write('<style type="text/css">html{display:none;}</style>');
842
  var agca_version = "<?php echo $this->agca_version; ?>";
843
- var wpversion = "<?php echo $wpversion; ?>";
 
844
  /* <![CDATA[ */
845
  jQuery(document).ready(function() {
846
  try{
 
 
 
 
 
 
847
  <?php if(get_option('agca_login_banner')==true){ ?>
848
  jQuery("#backtoblog").css("display","none");
849
  <?php } ?>
@@ -851,9 +1182,9 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
851
  jQuery("#backtoblog").html('<?php echo get_option('agca_login_banner_text'); ?>');
852
  <?php } ?>
853
  <?php if(get_option('agca_login_photo_url')==true){ ?>
854
- advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>" + "?" + new Date().getTime();
855
  var $url = "url(" + advanced_url + ")";
856
- jQuery("#login h1 a").css("background-image",$url);
857
  jQuery("#login h1 a").hide();
858
  image = jQuery("<img />").attr("src",advanced_url);
859
  jQuery(image).load(function() {
@@ -917,11 +1248,11 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
917
  <?php //COLORIZER END ?>
918
  }catch(err){
919
  alert("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
920
- }finally{
921
- jQuery(document).ready(function() {
922
- jQuery('html').show();
923
- jQuery('html').css("display","block");
924
- });
925
  }
926
  });
927
  /* ]]> */
@@ -938,7 +1269,10 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
938
  <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/farbtastic.js"></script>
939
 
940
  <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca_farbtastic.css" />
941
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js"></script>
 
 
 
942
  <?php //includes ?>
943
  <div class="wrap">
944
  <h1 style="color:green">AG Custom Admin Settings <span style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
@@ -962,10 +1296,17 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
962
  <li class="normal"><a href="#login-page-settings" title="Settings for Login page">Login Page</a></li>
963
  <li class="normal" ><a href="#admin-menu-settings" title="Settings for main admin menu">Admin Menu</a></li>
964
  <li class="normal"><a href="#ag-colorizer-setttings" title="AG colorizer settings">Colorizer</a></li>
965
- <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" style="margin-left:8px" title="Do You like this plugin? You can support its future development by providing small donation" href="http://wordpress.argonius.com/donate"><img alt="Donate" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>images/btn_donate_LG.gif" /></a>
 
966
  </li>
967
  <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
968
- </ul>
 
 
 
 
 
 
969
  <div id="section_admin_bar" class="ag_section">
970
  <h2 class="section_title" tabindex="-1">Admin Bar Settings Page</h2>
971
  <br />
@@ -1009,7 +1350,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1009
  <label title="Change default WordPress logo with custom image." for="agca_wp_logo_custom">Change WordPress logo</label>
1010
  </th>
1011
  <td>
1012
- <input title="If this field is not empty, image from provided url will be visible in top bar" type="text" size="47" name="agca_wp_logo_custom" value="<?php echo get_option('agca_wp_logo_custom'); ?>" />
1013
  &nbsp;<p><i>Put here an URL of the new top bar image (20 x 20px)</i>.</p>
1014
  </td>
1015
  </tr>
@@ -1018,7 +1359,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1018
  <label title="Add custom image on the top of admin content." for="agca_header_logo_custom">Custom header image</label>
1019
  </th>
1020
  <td>
1021
- <input title="If this field is not empty, image from provided url will be visible in header" type="text" size="47" name="agca_header_logo_custom" value="<?php echo get_option('agca_header_logo_custom'); ?>" />
1022
  &nbsp;<p><i>Add custom header image</i>.</p>
1023
  </td>
1024
  </tr>
@@ -1033,10 +1374,10 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1033
  <?php if($wpversion>=3.3){?>
1034
  <tr valign="center">
1035
  <th >
1036
- <label title="Hides default WordPress top bar dropdown menus" for="agca_remove_top_bar_dropdowns">Hide WordPress top bar dropdown menus</label>
1037
  </th>
1038
  <td>
1039
- <input title="Hides default WordPress top bar dropdown menus" type="checkbox" name="agca_remove_top_bar_dropdowns" value="true" <?php if (get_option('agca_remove_top_bar_dropdowns')==true) echo 'checked="checked" '; ?> />
1040
  </td>
1041
  </tr>
1042
  <tr valign="center">
@@ -1306,6 +1647,14 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1306
  <p tabindex="0"><i><strong>Info:</strong> These settings override settings in Screen options on Dashboard page.</i></p>
1307
  </td>
1308
  </tr>
 
 
 
 
 
 
 
 
1309
  <tr valign="center">
1310
  <th scope="row">
1311
  <label for="agca_dashboard_widget_rc">Hide "Recent Comments"</label>
@@ -1404,8 +1753,8 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1404
  <label title="If this field is not empty, image from provided url will be visible on Login page" for="agca_login_photo_url">Change Login header image</label>
1405
  </th>
1406
  <td>
1407
- <input title="If this field is not empty, image from provided url will be visible on Login page" type="text" size="47" name="agca_login_photo_url" value="<?php echo get_option('agca_login_photo_url'); ?>" />
1408
- &nbsp;<p><i>Put here link of new login photo. Photo could be of any size and type</i>.</p>
1409
  </td>
1410
  </tr>
1411
  <tr valign="center">
@@ -1413,7 +1762,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1413
  <label title="Put here custom link to a web location, that will be triggered on image click" for="agca_login_photo_href">Change hyperlink on Login image</label>
1414
  </th>
1415
  <td>
1416
- <input title="Put here custom link to a web location, that will be triggered on image click" type="text" size="47" name="agca_login_photo_href" value="<?php echo get_option('agca_login_photo_href'); ?>" />
1417
  </td>
1418
  </tr>
1419
  <tr valign="center">
@@ -1424,6 +1773,26 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1424
  <input title="Remove login image completely" type="checkbox" name="agca_login_photo_remove" value="true" <?php if (get_option('agca_login_photo_remove')==true) echo 'checked="checked" '; ?> />
1425
  </td>
1426
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1427
  </table>
1428
  </div>
1429
  <?php
@@ -1432,7 +1801,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1432
  <div id="section_admin_menu" style="display:none" class="ag_section">
1433
  <h2 class="section_title" tabindex="-1">Admin Menu Settings Page</h2>
1434
  <br />
1435
- <p style="font-style:italic" tabindex="0"><strong>Important: </strong>Please Turn off menu configuration before activating or disabling other plugins (or making any other changes to main menu). Use "Reset Settings" button to restore default values if anything went wrong.</p>
1436
  <br />
1437
  <table class="form-table" width="500px">
1438
  <tr valign="center" class="ag_table_major_options">
@@ -1467,18 +1836,18 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1467
  </tr>
1468
  <tr valign="center">
1469
  <th scope="row">
1470
- <label title="This is arrow like separator between Dashboard and Posts button (by default)" for="agca_admin_menu_separator_first">Remove first items separator</label>
1471
  </th>
1472
  <td>
1473
- <input title="This is arrow like separator between Dashboard and Posts button (by default)" type="checkbox" name="agca_admin_menu_separator_first" value="true" <?php if (get_option('agca_admin_menu_separator_first')==true) echo 'checked="checked" '; ?> />
1474
  </td>
1475
  </tr>
1476
  <tr valign="center">
1477
  <th scope="row">
1478
- <label title="This is arrow like separator between Comments and Appearance button (by default)" for="agca_admin_menu_separator_second">Remove second items separator</label>
1479
  </th>
1480
  <td>
1481
- <input title="This is arrow like separator between Comments and Appearance button (by default)" type="checkbox" name="agca_admin_menu_separator_second" value="true" <?php if (get_option('agca_admin_menu_separator_second')==true) echo 'checked="checked" '; ?> />
1482
  </td>
1483
  </tr>
1484
  <tr valign="center">
@@ -1489,6 +1858,43 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1489
  <input title="Removes small icons on admin menu buttons" type="checkbox" name="agca_admin_menu_icons" value="true" <?php if (get_option('agca_admin_menu_icons')==true) echo 'checked="checked" '; ?> />
1490
  </td>
1491
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1492
  <tr valign="center">
1493
  <td colspan="2">
1494
  <div class="ag_table_heading"><h3 tabindex="0">Add New Menu Items</h3></div>
@@ -1523,9 +1929,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1523
  </div>
1524
  <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
1525
  <h2 class="section_title">Colorizer Page</h2>
1526
- <br />
1527
- <p><i><strong>Info: </strong>Change Admin panel colors (This is Colorizer demo with only few color options. More color options will be available in future realeases).</i></p>
1528
- <br />
1529
  <table class="form-table" width="500px">
1530
  <tr valign="center" class="ag_table_major_options">
1531
  <td><label for="agca_colorizer_turnonoff"><strong>Turn on/off Colorizer configuration</strong></label></td>
@@ -1539,7 +1943,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1539
  </td>
1540
  </tr>
1541
  <tr valign="center">
1542
- <th><label title="Change admin background color" for="color_background">Background color:</label></th>
1543
  <td><input type="text" id="color_background" name="color_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_background']); ?>" />
1544
  <input type="button" alt="color_background" class="pick_color_button" value="Pick color" />
1545
  <input type="button" alt="color_background" class="pick_color_button_clear" value="Clear" />
@@ -1553,7 +1957,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1553
  </td>
1554
  </tr>
1555
  <tr valign="center">
1556
- <th><label title="Change header color in admin panel" for="color_header">Header color:</label></th>
1557
  <td><input type="text" id="color_header" name="color_header" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_header']); ?>" />
1558
  <input type="button" alt="color_header" class="pick_color_button" value="Pick color" />
1559
  <input type="button" alt="color_header" class="pick_color_button_clear" value="Clear" />
@@ -1567,26 +1971,68 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1567
  </td>
1568
  </tr>
1569
  <tr valign="center">
1570
- <th><label title="Change background color in admin menu" for="color_admin_menu_top_button_background">Top button background color:</label></th>
1571
  <td><input type="text" id="color_admin_menu_top_button_background" name="color_admin_menu_top_button_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_top_button_background']); ?>" />
1572
  <input type="button" alt="color_admin_menu_top_button_background" class="pick_color_button" value="Pick color" />
1573
  <input type="button" alt="color_admin_menu_top_button_background" class="pick_color_button_clear" value="Clear" />
1574
  </td>
1575
  </tr>
1576
- <tr valign="center">
1577
- <th><label title="Change background submenu color in admin menu" for="color_admin_menu_submenu_background">Submenu button background color:</label></th>
1578
- <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_submenu_background']); ?>" />
1579
- <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button" value="Pick color" />
1580
- <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear" value="Clear" />
1581
- </td>
1582
- </tr>
1583
- <tr valign="center">
1584
- <th><label title="Change text color in admin menu" for="color_admin_menu_font">Text color:</label></th>
1585
  <td><input type="text" id="color_admin_menu_font" name="color_admin_menu_font" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_font']); ?>" />
1586
  <input type="button" alt="color_admin_menu_font" class="pick_color_button" value="Pick color" />
1587
  <input type="button" alt="color_admin_menu_font" class="pick_color_button_clear" value="Clear" />
1588
  </td>
1589
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1590
  <?php if($wpversion >= 3.2) { ?>
1591
  <tr valign="center">
1592
  <th><label title="Change background color of element behind admin menu" for="color_admin_menu_behind_background">Wrapper background color:</label></th>
@@ -1624,7 +2070,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1624
  </td>
1625
  </tr>
1626
  <tr valign="center">
1627
- <th><label title="Change color in header text" for="color_font_header">Header text color:</label></th>
1628
  <td><input type="text" id="color_font_header" name="color_font_header" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_font_header']); ?>" />
1629
  <input type="button" alt="color_font_header" class="pick_color_button" value="Pick color" />
1630
  <input type="button" alt="color_font_header" class="pick_color_button_clear" value="Clear" />
@@ -1661,17 +2107,59 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1661
  </table>
1662
  <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
1663
  <div id="picker"></div>
1664
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1665
  <br /><br /><br />
1666
  <p class="submit">
1667
- <input type="submit" title="Save changes button" class="button-primary" value="<?php _e('Save Changes') ?>" />
1668
- </p>
1669
-
1670
  </form>
1671
  </div>
1672
- <p tabindex="0"><i><strong>Info:</strong> You can use HTML tags in text areas, e.g. &lt;a href=&quot;http://www.mywebsite.com&quot;&gt;Visit Us&lt;/a&gt;</i></p>
1673
  <br />
1674
- <br /><br /><br /><p id="agca_footer_support_info">WordPress 'AG Custom Admin' plugin by Argonius. If you have any questions, ideas for future development or if you found a bug or having any issues regarding this plugin, please visit plugin's <a href="http://wordpress.argonius.com/ag-custom-admin">SUPPORT</a> page. <br />You can also participate in development of this plugin if you <a href="http://wordpress.argonius.com/donate">BUY ME A DRINK</a> to refresh my energy for programming. Thanks!<br /><br />Have a nice blogging!</p><br />
1675
  <?php
1676
  }
1677
  }
4
  Plugin URI: http://wordpress.org/extend/plugins/ag-custom-admin
5
  Description: Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
6
  Author: Argonius
7
+ Version: 1.2.6
8
  Author URI: http://wordpress.argonius.com/ag-custom-admin
9
 
10
  Copyright 2011. Argonius (email : info@argonius.com)
23
  along with this program. If not, see <http://www.gnu.org/licenses/>.
24
  */
25
 
26
+ //require_once('/../../../../../FirePHPCore/lib/FirePHPCore/fb.php');
27
+ //fb($_POST);
28
 
29
  $agca = new AGCA();
30
 
32
  private $colorizer="";
33
  private $active_plugin;
34
  private $agca_version;
35
+ private $custom_css = "";
36
+ private $custom_js = "";
37
  public function __construct()
38
  {
39
 
51
 
52
  /*Initialize properties*/
53
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
54
+ //fb($this->colorizer);
55
+ $this->agca_version = "1.2.6";
56
  }
57
  // Add donate and support information
58
  function jk_filter_plugin_links($links, $file)
78
  );
79
  }
80
  function agca_get_includes() {
81
+ global $user_level;
82
+ ?>
83
+ <script type="text/javascript">
84
+ <?php
85
+ //AGCA GLOBALS
86
+ echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';";
87
+ ?>
88
+ </script>
89
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
90
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
91
+
92
+ <?php
93
+ if(!((get_option('agca_role_allbutadmin')==true) and ($user_level > 9))){
94
+ ?>
95
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/mine.css?ver=<?php echo $this->agca_version; ?>" />
96
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/mine.js?ver=<?php echo $this->agca_version; ?>"></script>
97
+ <?php
98
+ }
99
+ ?>
100
  <?php
101
  }
102
 
137
  register_setting( 'agca-options-group', 'agca_login_photo_remove' );
138
  register_setting( 'agca-options-group', 'agca_login_photo_url' );
139
  register_setting( 'agca-options-group', 'agca_login_photo_href' );
140
+ register_setting( 'agca-options-group', 'agca_login_round_box' );
141
+ register_setting( 'agca-options-group', 'agca_login_round_box_size' );
142
 
143
  //register_setting( 'agca-options-group', 'agca_menu_dashboard' ); DEPRECATED 1.2
144
  register_setting( 'agca-options-group', 'agca_dashboard_icon' );
145
  register_setting( 'agca-options-group', 'agca_dashboard_text' );
146
+ register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
147
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_welcome' );
148
  register_setting( 'agca-options-group', 'agca_dashboard_widget_rc' );
149
  register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
150
  register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
171
  register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
172
  register_setting( 'agca-options-group', 'agca_admin_menu_separator_first' );
173
  register_setting( 'agca-options-group', 'agca_admin_menu_separator_second' );
174
+ register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
175
+ register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
176
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round' );
177
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round_size' );
178
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand' );
179
  register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
180
  register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
181
  register_setting( 'agca-options-group', 'ag_colorizer_json' );
182
+ register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
183
+
184
+ $this->createCustomJSFile();
185
+ $this->createCustomCSSFile();
186
+
187
+ if(!empty($_POST)){
188
+ // fb($_POST);
189
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
190
+ if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
191
+ if($_FILES["settings_import_file"]["error"] > 0){
192
+ }else{
193
+ $file = $_FILES['settings_import_file'];
194
+ if($this->startsWith($file['name'],'AGCA_Settings')){
195
+ if (file_exists($file['tmp_name'])) {
196
+ $fh = fopen($file['tmp_name'], 'r');
197
+ $theData = "";
198
+ if(filesize($file['tmp_name']) > 0){
199
+ $theData = fread($fh,filesize($file['tmp_name']));
200
+ }
201
+ fclose($fh);
202
+ $this->importSettings($theData);
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
208
+ $this->exportSettings();
209
+ }else{
210
+
211
+ }
212
+ }
213
  }
214
 
215
  function agca_deactivate() {
241
  delete_option( 'agca_login_banner_text' );
242
  delete_option( 'agca_login_photo_remove' );
243
  delete_option( 'agca_login_photo_url' );
244
+ delete_option( 'agca_login_photo_href' );
245
+ delete_option( 'agca_login_round_box' );
246
+ delete_option( 'agca_login_round_box_size' );
247
 
248
  //delete_option( 'agca_menu_dashboard' ); DEPRECATED 1.2
249
  delete_option( 'agca_dashboard_icon' );
250
  delete_option( 'agca_dashboard_text' );
251
+ delete_option( 'agca_dashboard_text_paragraph' );
252
+ delete_option( 'agca_dashboard_widget_welcome' );
253
  delete_option( 'agca_dashboard_widget_rc' );
254
  delete_option( 'agca_dashboard_widget_il' );
255
  delete_option( 'agca_dashboard_widget_plugins' );
276
  delete_option( 'agca_admin_menu_separator_first' );
277
  delete_option( 'agca_admin_menu_separator_second' );
278
  delete_option( 'agca_admin_menu_icons' );
279
+ delete_option( 'agca_admin_menu_arrow' );
280
+ delete_option( 'agca_admin_menu_submenu_round' );
281
+ delete_option( 'agca_admin_menu_submenu_round_size' );
282
+ delete_option( 'agca_admin_menu_brand' );
283
  delete_option( 'ag_edit_adminmenu_json' );
284
  delete_option( 'ag_add_adminmenu_json' );
285
  delete_option( 'ag_colorizer_json' );
286
  delete_option( 'agca_colorizer_turnonoff' );
287
+ }
288
+
289
+ function getOptions(){
290
+ return Array(
291
+ 'agca_role_allbutadmin',
292
+ 'agca_screen_options_menu',
293
+ 'agca_help_menu',
294
+ 'agca_logout',
295
+ 'agca_remove_your_profile',
296
+ 'agca_logout_only',
297
+ 'agca_options_menu',
298
+ 'agca_howdy',
299
+ 'agca_header',
300
+ 'agca_header_show_logout',
301
+ 'agca_footer',
302
+ 'agca_privacy_options',
303
+ 'agca_header_logo',
304
+ 'agca_header_logo_custom',
305
+ 'agca_wp_logo_custom',
306
+ 'agca_site_heading',
307
+ 'agca_custom_site_heading',
308
+ 'agca_update_bar',
309
+ 'agca_footer_left',
310
+ 'agca_footer_left_hide',
311
+ 'agca_footer_right',
312
+ 'agca_footer_right_hide',
313
+ 'agca_login_banner',
314
+ 'agca_login_banner_text',
315
+ 'agca_login_photo_remove',
316
+ 'agca_login_photo_url',
317
+ 'agca_login_photo_href',
318
+ 'agca_login_round_box',
319
+ 'agca_login_round_box_size',
320
+ 'agca_dashboard_icon',
321
+ 'agca_dashboard_text',
322
+ 'agca_dashboard_text_paragraph',
323
+ 'agca_dashboard_widget_welcome',
324
+ 'agca_dashboard_widget_rc',
325
+ 'agca_dashboard_widget_il',
326
+ 'agca_dashboard_widget_plugins',
327
+ 'agca_dashboard_widget_qp',
328
+ 'agca_dashboard_widget_rn',
329
+ 'agca_dashboard_widget_rd',
330
+ 'agca_dashboard_widget_primary',
331
+ 'agca_dashboard_widget_secondary',
332
+ 'agca_admin_bar_comments',
333
+ 'agca_admin_bar_new_content',
334
+ 'agca_admin_bar_new_content_post',
335
+ 'agca_admin_bar_new_content_link',
336
+ 'agca_admin_bar_new_content_page',
337
+ 'agca_admin_bar_new_content_user',
338
+ 'agca_admin_bar_new_content_media',
339
+ 'agca_admin_bar_update_notifications',
340
+ 'agca_remove_top_bar_dropdowns',
341
+ 'agca_admin_menu_turnonoff',
342
+ 'agca_admin_menu_agca_button_only',
343
+ 'agca_admin_menu_separator_first',
344
+ 'agca_admin_menu_separator_second',
345
+ 'agca_admin_menu_icons',
346
+ 'agca_admin_menu_arrow',
347
+ 'agca_admin_menu_submenu_round',
348
+ 'agca_admin_menu_submenu_round_size',
349
+ 'agca_admin_menu_brand',
350
+ 'ag_edit_adminmenu_json',
351
+ 'ag_add_adminmenu_json',
352
+ 'ag_colorizer_json',
353
+ 'agca_colorizer_turnonof',
354
+ );
355
+ }
356
+
357
+ function createCustomCSSFile(){
358
+ $customScriptName =dirname(__FILE__)."/style/mine.css";
359
+ if (file_exists($customScriptName)) {
360
+ $fh = fopen($customScriptName, 'r');
361
+ $theData = "";
362
+ if(filesize($customScriptName) > 0){
363
+ $theData = fread($fh,filesize($customScriptName));
364
+ }
365
+ fclose($fh);
366
+ $this->custom_css = $theData;
367
+ } else {
368
+ $customScript = fopen($customScriptName, 'w');
369
+ fclose($customScript);
370
+ }
371
+ }
372
+
373
+ function importSettings($settings){
374
+ $exploaded = explode("|^|^|", $settings);
375
+ // $str = "EEE: ";
376
+
377
+ $savedOptions = array();
378
+
379
+ foreach ($exploaded as $setting){
380
+
381
+ $key = current(explode(':', $setting));
382
+ $value = substr($setting, strlen($key)+1);
383
+ $cleanedValue = str_replace('|^|^|','',$value);
384
+ $savedOptions[$key] = $cleanedValue;
385
+ }
386
+
387
+ // print_r($savedOptions);
388
+
389
+ $optionNames = $this->getOptions();
390
+
391
+ foreach ($optionNames as $optionName){
392
+ $optionValue = "";
393
+ $optionValue = $savedOptions[$optionName];
394
+
395
+ if($optionName == "ag_edit_adminmenu_json" || $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
396
+ $optionValue = str_replace("\\\"", "\"", $optionValue);
397
+ $optionValue = str_replace("\\\'", "\'", $optionValue);
398
+ }else{
399
+
400
+ }
401
+ update_option($optionName, $optionValue);
402
+ $str.="/".$optionName."/".$optionValue."\n";
403
+ }
404
+ // fb($savedOptions);
405
+ $this->custom_css = $savedOptions['agca_script_css'];
406
+ $this->custom_js = $savedOptions['agca_script_js'];
407
+ //echo $str;
408
+ }
409
+
410
+ function exportSettings(){
411
+ $str = "";
412
+
413
+ foreach ($_POST as $key => $value) {
414
+ if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
415
+ $str .=$key. ":".$value."|^|^|";
416
+ }
417
+ }
418
+
419
+ $filename = 'AGCA_Settings_'.date("Y-M-d_H-i-s").'.agca';
420
+ header("Cache-Control: public");
421
+ header("Content-Description: File Transfer");
422
+ header("Content-Disposition: attachment; filename=$filename");
423
+ header("Content-Type: text/plain; ");
424
+ header("Content-Transfer-Encoding: binary");
425
+ echo $str;
426
+ die();
427
+ }
428
+
429
+ function startsWith($haystack, $needle)
430
+ {
431
+ $length = strlen($needle);
432
+ return (substr($haystack, 0, $length) === $needle);
433
+ }
434
+
435
+ function createCustomJSFile(){
436
+ $customScriptName =dirname(__FILE__)."/script/mine.js";
437
+
438
+ if (file_exists($customScriptName)) {
439
+ $fh = fopen($customScriptName, 'r');
440
+ $theData = "";
441
+ if(filesize($customScriptName) > 0){
442
+ $theData = fread($fh,filesize($customScriptName));
443
+ }
444
+ fclose($fh);
445
+ $this->custom_js = $theData;
446
+ } else {
447
+ $customScript = fopen($customScriptName, 'w');
448
+ $stringData = " ";
449
+ fwrite($customScript, $stringData);
450
+ fclose($customScript);
451
+ }
452
+ }
453
+
454
  function agca_create_menu() {
455
  //create new top-level menu
456
  add_management_page( 'AG Custom Admin', 'AG Custom Admin', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
466
  $href = $arr;
467
  }
468
  $button ="";
469
+ $button .= '<li id="menu-'.$name.'" class="ag-custom-button menu-top menu-top-first '.$class.' menu-top-last">';
 
 
 
470
  $button .= '<div class="wp-menu-toggle" style="display: none;"><br></div>';
471
+ $button .= '<a tabindex="1" target="'.$target.'" class="menu-top menu-top-last" href="'.$href.'">'.$name.'</a>';
472
  $button .= '</li>';
473
 
474
  return $button;
540
 
541
  function print_page()
542
  {
543
+ $wpversion = $this->get_wp_version();
544
  ?><style type="text/css">
545
+
546
+ </style>
547
+ <script type="text/javascript">
548
+ </script>
549
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
550
+ <script type="text/javascript">
551
+ <?php echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';"; ?>
552
+ var wpversion = "<?php echo $wpversion; ?>";
553
+ var agca_version = "<?php echo $this->agca_version; ?>";
554
+ var jQueryScriptOutputted = false;
555
+ function initJQuery() {
556
+
557
+ //if the jQuery object isn't available
558
+ if (typeof(jQuery) == 'undefined') {
559
+
560
+
561
+ if (! jQueryScriptOutputted) {
562
+ //only output the script once..
563
+ jQueryScriptOutputted = true;
564
+
565
+ //output the script (load it from google api)
566
+ document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></scr" + "ipt>");
567
+ }
568
+ setTimeout("initJQuery()", 50);
569
+ } else {
570
+
571
+ $(function() {
572
+ try
573
+ {
574
+ <?php $this->print_admin_bar_scripts(); ?>
575
+ }catch(ex){}
576
+ });
577
+ }
578
+ }
579
+ initJQuery();
580
+ </script>
581
+
582
+ <?php
583
+
584
  }
585
+
586
+ function print_admin_bar_scripts(){
587
+ ?>
588
+ if(isWPHigherOrEqualThan("3.3")){
589
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
590
+
591
+
592
+ //remove on site page
593
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
594
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
595
+
596
+
597
+ var abitemSelector = "#wpadminbar .ab-top-menu > li.menupop > .ab-item";
598
+ var originalBkg = jQuery(abitemSelector).css('background');
599
+ var originalColor = jQuery(abitemSelector).css('color');
600
+ jQuery(abitemSelector).mouseover(function(){
601
+ jQuery(this).css({'background':'#222222','color':'#fafafa'});
602
+ }).mouseout(function(){
603
+ jQuery(this).css({'background':originalBkg,'color':originalColor});
604
+ });
605
+
606
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
607
+ jQuery(".new_content_header_submenu").hide();
608
+ <?php } ?>
609
+
610
+ <?php } ?>
611
+ }
612
+
613
+ if(isWPHigherOrEqualThan("3.3")){
614
+ <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
615
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
616
+ <?php } ?>
617
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
618
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
619
+ <?php } ?>
620
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
621
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
622
+ <?php } ?>
623
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
624
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
625
+ <?php } ?>
626
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
627
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
628
+ <?php } ?>
629
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
630
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
631
+ <?php } ?>
632
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
633
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
634
+ <?php } ?>
635
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
636
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
637
+ <?php } ?>
638
+ }
639
+
640
+
641
+ <?php if(get_option('agca_header_logo')==true){ ?>
642
+ jQuery("#wphead #header-logo").css("display","none");
643
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
644
+
645
+ <?php } ?>
646
+ <?php if(get_option('agca_header_logo_custom')!=""){ ?>
647
+
648
+
649
+ if(isWPHigherOrEqualThan("3.3")){
650
+ var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
651
+
652
+ advanced_url = img_url;
653
+ image = jQuery("<img />").attr("src",advanced_url);
654
+ jQuery(image).load(function() {
655
+ jQuery("#wpbody-content").prepend(image);
656
+ });
657
+ }else{
658
+ jQuery("#wphead img#header-logo").attr('src','');
659
+ jQuery("#wphead img#header-logo").hide();
660
+ var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
661
+ advanced_url = img_url+ "?" + new Date().getTime();
662
+ image = jQuery("<img />").attr("src",advanced_url);
663
+ jQuery(image).load(function() {
664
+ jQuery("#wphead img#header-logo").attr('src', advanced_url);
665
+ jQuery("#wphead img#header-logo").attr('width',this.width);
666
+ jQuery("#wphead img#header-logo").attr('height',this.height);
667
+ jQuery("#wphead").css('height', (14 + this.height)+'px');
668
+ jQuery("#wphead img#header-logo").show();
669
+ });
670
+ }
671
+
672
+ <?php } ?>
673
+ <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
674
+ if(isWPHigherOrEqualThan("3.3")){
675
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css("background-image","url('<?php echo get_option('agca_wp_logo_custom'); ?>')");
676
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css("background-position","0");
677
+ }
678
+ <?php }?>
679
+ <?php if(get_option('agca_site_heading')==true){ ?>
680
+ jQuery("#wphead #site-heading").css("display","none");
681
+ <?php } ?>
682
+ <?php if(get_option('agca_custom_site_heading')!=""){ ?>
683
+ jQuery("#wphead #site-heading").after('<h1><?php echo get_option('agca_custom_site_heading'); ?></h1>');
684
+ //3.3FIX
685
+ if(isWPHigherOrEqualThan("3.3")){
686
+ jQuery("#wp-admin-bar-site-name a:first").html('<?php echo get_option('agca_custom_site_heading'); ?>');
687
+ }
688
+ <?php } ?>
689
+ <?php if(get_option('agca_header')==true){ ?>
690
+ jQuery("#wpadminbar").css("display","none");
691
+ jQuery("body.admin-bar").css("padding-top","0");
692
+ jQuery("#wphead").css("display","none");
693
+
694
+ <?php } ?>
695
+ <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
696
+
697
+ if(isWPHigherOrEqualThan("3.3")){
698
+ jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item">Log Out</a>');
699
+ }else{
700
+ var clon ="";
701
+ jQuery("div#user_info a").each(function(){
702
+ if(jQuery(this).text() =="Log Out"){
703
+ clon = jQuery(this).clone();
704
+ }
705
+ });
706
+ if(clon !=""){
707
+ jQuery(clon).attr('style','float:right;padding:15px');
708
+ jQuery(clon).html('<?php echo ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout')); ?>');
709
+ }
710
+ jQuery("#wphead").after(clon);
711
+ }
712
+
713
+ <?php } ?>
714
+ <?php if(get_option('agca_howdy')!=""){ ?>
715
+ if(isWPHigherOrEqualThan("3.3")){
716
+ var alltext="";
717
+ alltext="";
718
+ alltext = jQuery('li#wp-admin-bar-my-account').html();
719
+ alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
720
+ jQuery("li#wp-admin-bar-my-account").html(alltext);
721
+ }else if(isWPHigherOrEqualThan("3.2")){
722
+ var alltext="";
723
+ alltext="";
724
+ alltext = jQuery('#user_info div.hide-if-no-js').html();
725
+ alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
726
+ jQuery("#user_info div.hide-if-no-js").html(alltext);
727
+ }else{
728
+ var howdyText = jQuery("#user_info").html();
729
+ if(howdyText !=null){
730
+ jQuery("#user_info").html("<p>"+"<?php echo get_option('agca_howdy'); ?>"+howdyText.substr(9));
731
+ }
732
+ }
733
+ <?php } ?>
734
+ <?php if(get_option('agca_logout')!=""){ ?>
735
+ if(isWPHigherOrEqualThan("3.3")){
736
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
737
+ }else if(isWPHigherOrEqualThan("3.2")){
738
+ jQuery("#user_info #user_info_links a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
739
+ }else{
740
+ jQuery("#user_info a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
741
+ }
742
+
743
+ <?php } ?>
744
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
745
+ if(isWPHigherOrEqualThan("3.3")){
746
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
747
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
748
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
749
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
750
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
751
+
752
+ }else if(isWPHigherOrEqualThan("3.2")){
753
+ jQuery("#user_info #user_info_links li:eq(0)").remove();
754
+ }
755
+ <?php } ?>
756
+ <?php if(get_option('agca_logout_only')==true){ ?>
757
+ if(isWPHigherOrEqualThan("3.3")){
758
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
759
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
760
+ }else if(isWPHigherOrEqualThan("3.2")){
761
+ var logoutText = jQuery("#user_info a:nth-child(2)").text();
762
+ <?php if(get_option('agca_logout')!=""){ ?>
763
+ logoutText = "<?php echo get_option('agca_logout'); ?>";
764
+ <?php } ?>
765
+ var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
766
+ jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
767
+ }else{
768
+ var logoutText = jQuery("#user_info a:nth-child(2)").text();
769
+ var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
770
+ jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
771
+ }
772
+ <?php } ?>
773
+
774
+ <?php
775
+
776
+
777
+ }
778
 
779
  function print_admin_css()
780
  {
800
  var wpversion = "<?php echo $wpversion; ?>";
801
  var agca_version = "<?php echo $this->agca_version; ?>";
802
  var errors = false;
803
+ var isSettingsImport = false;
804
 
805
+ <?php
806
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
807
+ echo 'isSettingsImport = true;';
808
+ }
809
+ ?>
810
  /* <![CDATA[ */
811
  jQuery(document).ready(function() {
812
 
857
  if((get_option('agca_role_allbutadmin')==true) and ($user_level > 9)){
858
  ?>
859
  <?php } else{ ?>
860
+ <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
861
+ additionalStyles = "";
862
+ if(isWPHigherOrEqualThan("3.4")){
863
+ additionalStyles = ' style="margin-bottom:-4px" ';
864
+ }
865
+ jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="145" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
866
+
867
+ <?php } ?>
868
+ <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
869
+ jQuery("#adminmenu div.wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
870
+ <?php } ?>
871
+
872
+ <?php $this->print_admin_bar_scripts(); ?>
873
 
 
 
874
 
875
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
876
  jQuery("#screen-options-link-wrap").css("display","none");
885
  <?php if(get_option('agca_privacy_options')==true){ ?>
886
  jQuery("#privacy-on-link").css("display","none");
887
  <?php } ?>
 
 
 
 
 
 
888
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889
 
890
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
 
892
+ <?php if(get_option('agca_update_bar')==true){ ?>
893
+ <?php
894
+ if ( ! function_exists( 'c2c_no_update_nag' ) ) :
895
+ function c2c_no_update_nag() {
896
+ remove_action( 'admin_notices', 'update_nag', 3 );
897
+ }
898
+ endif;
899
+ add_action( 'admin_init', 'c2c_no_update_nag' );
900
+ ?>
901
+ jQuery("#update-nag").css("display","none");
902
+ jQuery(".update-nag").css("display","none");
903
  <?php } ?>
904
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
905
  <?php if(get_option('agca_footer')==true){ ?>
906
  jQuery("#footer").css("display","none");
907
+ <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
908
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
909
 
910
 
911
  <?php if(get_option('agca_footer_left')!=""){ ?>
938
  jQuery("#dashboard-widgets-wrap").parent().find("h2").text("<?php echo get_option('agca_dashboard_text'); ?>");
939
  <?php } ?>
940
  <?php if(get_option('agca_dashboard_text_paragraph')!=""){ ?>
941
+ jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
942
+
943
+ jQuery("#agca_custom_dashboard_content").html('<br /><p ttt style=\"text-indent:45px;\"><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(get_option('agca_dashboard_text_paragraph'))); ?></p>');
944
  <?php } ?>
945
 
946
  <?php /*Remove Dashboard widgets*/ ?>
947
  <?php
948
 
949
+ if(get_option('agca_dashboard_widget_welcome')==true){
950
+ ?>jQuery("#welcome-panel").css("display","none");<?php
951
+ }else{
952
+ ?>jQuery("#welcome-panel").css("display","block");<?php
953
+ }
954
  if(get_option('agca_dashboard_widget_rc')==true){
955
  $this->remove_dashboard_widget('dashboard_recent_comments','normal');
956
  }else{
1009
  jQuery(".wp-menu-image").each(function(){
1010
  jQuery(this).css("display","none");
1011
  });
1012
+ <?php } ?>
1013
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1014
+ jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1015
+
1016
+ <?php } ?>
1017
  <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1018
 
1019
  <?php /*If Turned on*/ ?>
1116
  updateColor(jQuery(this).attr('id'),jQuery(this).val())
1117
  });
1118
  jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1119
+ jQuery('#adminmenu li.wp-menu-open').css('border','none');
1120
+ jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1121
 
1122
  <?php } ?>
1123
  <?php //COLORIZER END ?>
1124
  <?php } //end of apply for any user except admin ?>
1125
  /*Add user buttons*/
1126
+ jQuery('#ag_add_adminmenu').append(buttonsJq);
1127
+
1128
  }catch(err){
1129
  errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
1130
  alert(errors);
1164
  <script type="text/javascript">
1165
  document.write('<style type="text/css">html{display:none;}</style>');
1166
  var agca_version = "<?php echo $this->agca_version; ?>";
1167
+ var wpversion = "<?php echo $wpversion; ?>";
1168
+ var isSettingsImport = false;
1169
  /* <![CDATA[ */
1170
  jQuery(document).ready(function() {
1171
  try{
1172
+ <?php if(get_option('agca_login_round_box')==true){ ?>
1173
+ jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1174
+ jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1175
+ jQuery("#login h1 a").css("margin-bottom",'10px');
1176
+ jQuery("#login h1 a").css("padding-bottom",'0');
1177
+ <?php } ?>
1178
  <?php if(get_option('agca_login_banner')==true){ ?>
1179
  jQuery("#backtoblog").css("display","none");
1180
  <?php } ?>
1182
  jQuery("#backtoblog").html('<?php echo get_option('agca_login_banner_text'); ?>');
1183
  <?php } ?>
1184
  <?php if(get_option('agca_login_photo_url')==true){ ?>
1185
+ advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
1186
  var $url = "url(" + advanced_url + ")";
1187
+ jQuery("#login h1 a").css("background",$url);
1188
  jQuery("#login h1 a").hide();
1189
  image = jQuery("<img />").attr("src",advanced_url);
1190
  jQuery(image).load(function() {
1248
  <?php //COLORIZER END ?>
1249
  }catch(err){
1250
  alert("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
1251
+ }finally{
1252
+
1253
+ jQuery('html').show();
1254
+ jQuery('html').css("display","block");
1255
+
1256
  }
1257
  });
1258
  /* ]]> */
1269
  <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/farbtastic.js"></script>
1270
 
1271
  <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca_farbtastic.css" />
1272
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js"></script>
1273
+ <script type="text/javascript">
1274
+ var isAGCAPage = true;
1275
+ </script>
1276
  <?php //includes ?>
1277
  <div class="wrap">
1278
  <h1 style="color:green">AG Custom Admin Settings <span style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
1296
  <li class="normal"><a href="#login-page-settings" title="Settings for Login page">Login Page</a></li>
1297
  <li class="normal" ><a href="#admin-menu-settings" title="Settings for main admin menu">Admin Menu</a></li>
1298
  <li class="normal"><a href="#ag-colorizer-setttings" title="AG colorizer settings">Colorizer</a></li>
1299
+ <li class="normal"><a href="#ag-advanced" title="My custom scripts">Advanced</a></li>
1300
+ <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" style="margin-left:8px" title="Like this plugin? You can support its future development by giving a donation by your wish " href="http://wordpress.argonius.com/donate"><img alt="Donate" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>images/btn_donate_LG.gif" /></a>
1301
  </li>
1302
  <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
1303
+ </ul>
1304
+ <div id="agca_advertising">
1305
+ <ul>
1306
+ <li style="min-height:105px;display: block"></li>
1307
+ </ul>
1308
+ </div>
1309
+ <div style="clear:both"></div>
1310
  <div id="section_admin_bar" class="ag_section">
1311
  <h2 class="section_title" tabindex="-1">Admin Bar Settings Page</h2>
1312
  <br />
1350
  <label title="Change default WordPress logo with custom image." for="agca_wp_logo_custom">Change WordPress logo</label>
1351
  </th>
1352
  <td>
1353
+ <input id="agca_wp_logo_custom" title="If this field is not empty, image from provided url will be visible in top bar" type="text" size="47" name="agca_wp_logo_custom" value="<?php echo get_option('agca_wp_logo_custom'); ?>" /><input type="button" onClick="jQuery('#agca_wp_logo_custom').val('');" value="Clear" />
1354
  &nbsp;<p><i>Put here an URL of the new top bar image (20 x 20px)</i>.</p>
1355
  </td>
1356
  </tr>
1359
  <label title="Add custom image on the top of admin content." for="agca_header_logo_custom">Custom header image</label>
1360
  </th>
1361
  <td>
1362
+ <input title="If this field is not empty, image from provided url will be visible in header" type="text" size="47" id="agca_header_logo_custom" name="agca_header_logo_custom" value="<?php echo get_option('agca_header_logo_custom'); ?>" /><input type="button" onClick="jQuery('#agca_header_logo_custom').val('');" value="Clear" />
1363
  &nbsp;<p><i>Add custom header image</i>.</p>
1364
  </td>
1365
  </tr>
1374
  <?php if($wpversion>=3.3){?>
1375
  <tr valign="center">
1376
  <th >
1377
+ <label title="Hides default WordPress top bar dropdown menus on WordPress logo and Heading" for="agca_remove_top_bar_dropdowns">Hide WordPress top bar dropdown menus</label>
1378
  </th>
1379
  <td>
1380
+ <input title="Hides default WordPress top bar dropdown menus on WordPress logo and Heading" type="checkbox" name="agca_remove_top_bar_dropdowns" value="true" <?php if (get_option('agca_remove_top_bar_dropdowns')==true) echo 'checked="checked" '; ?> />
1381
  </td>
1382
  </tr>
1383
  <tr valign="center">
1647
  <p tabindex="0"><i><strong>Info:</strong> These settings override settings in Screen options on Dashboard page.</i></p>
1648
  </td>
1649
  </tr>
1650
+ <tr valign="center">
1651
+ <th scope="row">
1652
+ <label for="agca_dashboard_widget_welcome">Hide "Welcome" WordPress Message</label>
1653
+ </th>
1654
+ <td>
1655
+ <input type="checkbox" name="agca_dashboard_widget_welcome" value="true" <?php if (get_option('agca_dashboard_widget_welcome')==true) echo 'checked="checked" '; ?> />
1656
+ </td>
1657
+ </tr>
1658
  <tr valign="center">
1659
  <th scope="row">
1660
  <label for="agca_dashboard_widget_rc">Hide "Recent Comments"</label>
1753
  <label title="If this field is not empty, image from provided url will be visible on Login page" for="agca_login_photo_url">Change Login header image</label>
1754
  </th>
1755
  <td>
1756
+ <input title="If this field is not empty, image from provided url will be visible on Login page" type="text" size="47" id="agca_login_photo_url" name="agca_login_photo_url" value="<?php echo get_option('agca_login_photo_url'); ?>" /><input type="button" onClick="jQuery('#agca_login_photo_url').val('');" value="Clear" />
1757
+ &nbsp;<p><i>Put here link of new login image. Image can be of any size and type</i>.</p>
1758
  </td>
1759
  </tr>
1760
  <tr valign="center">
1762
  <label title="Put here custom link to a web location, that will be triggered on image click" for="agca_login_photo_href">Change hyperlink on Login image</label>
1763
  </th>
1764
  <td>
1765
+ <input title="Put here custom link to a web location, that will be triggered on image click" type="text" size="47" id="agca_login_photo_href" name="agca_login_photo_href" value="<?php echo get_option('agca_login_photo_href'); ?>" /><input type="button" onClick="jQuery('#agca_login_photo_href').val('');" value="Clear" />
1766
  </td>
1767
  </tr>
1768
  <tr valign="center">
1773
  <input title="Remove login image completely" type="checkbox" name="agca_login_photo_remove" value="true" <?php if (get_option('agca_login_photo_remove')==true) echo 'checked="checked" '; ?> />
1774
  </td>
1775
  </tr>
1776
+ <tr valign="center">
1777
+ <th scope="row">
1778
+ <label title="Rounds box on login page" for="agca_login_round_box">Round box corners</label>
1779
+ </th>
1780
+ <td>
1781
+ <input title="Rounds box on login page" type="checkbox" name="agca_login_round_box" value="true" <?php if (get_option('agca_login_round_box')==true) echo 'checked="checked" '; ?> />
1782
+ </td>
1783
+ </tr>
1784
+ <?php
1785
+ $roundboxzizestyle = "style='display:none'";
1786
+ if (get_option('agca_login_round_box')=='true') $roundboxzizestyle = '';
1787
+ ?>
1788
+ <tr valign="center" id="agca_login_round_box_size_block" <?php echo $roundboxzizestyle; ?> >
1789
+ <th scope="row">
1790
+ <label title="Size of rounded box curve" for="agca_login_round_box_size">Round box corners - size</label>
1791
+ </th>
1792
+ <td>
1793
+ <input class="validateNumber" limit="3" title="Size of rounded box curve" type="text" name="agca_login_round_box_size" type="text" size="3" value="<?php echo get_option('agca_login_round_box_size'); ?>" />&nbsp;(px)
1794
+ </td>
1795
+ </tr>
1796
  </table>
1797
  </div>
1798
  <?php
1801
  <div id="section_admin_menu" style="display:none" class="ag_section">
1802
  <h2 class="section_title" tabindex="-1">Admin Menu Settings Page</h2>
1803
  <br />
1804
+ <p style="font-style:italic" tabindex="0"><strong>Important: </strong>Please Turn off menu configuration before activating or disabling other plugins (or making any other changes to main menu). Use "Reset Settings" button to restore default values if anything goes wrong.</p>
1805
  <br />
1806
  <table class="form-table" width="500px">
1807
  <tr valign="center" class="ag_table_major_options">
1836
  </tr>
1837
  <tr valign="center">
1838
  <th scope="row">
1839
+ <label title="This is blank space between Dashboard and Posts button (by default)" for="agca_admin_menu_separator_first">Remove first items separator</label>
1840
  </th>
1841
  <td>
1842
+ <input title="This is blank space separator between Dashboard and Posts button (by default)" type="checkbox" name="agca_admin_menu_separator_first" value="true" <?php if (get_option('agca_admin_menu_separator_first')==true) echo 'checked="checked" '; ?> />
1843
  </td>
1844
  </tr>
1845
  <tr valign="center">
1846
  <th scope="row">
1847
+ <label title="This is blank space separator between Comments and Appearance button (by default)" for="agca_admin_menu_separator_second">Remove second items separator</label>
1848
  </th>
1849
  <td>
1850
+ <input title="This is blank space separator between Comments and Appearance button (by default)" type="checkbox" name="agca_admin_menu_separator_second" value="true" <?php if (get_option('agca_admin_menu_separator_second')==true) echo 'checked="checked" '; ?> />
1851
  </td>
1852
  </tr>
1853
  <tr valign="center">
1858
  <input title="Removes small icons on admin menu buttons" type="checkbox" name="agca_admin_menu_icons" value="true" <?php if (get_option('agca_admin_menu_icons')==true) echo 'checked="checked" '; ?> />
1859
  </td>
1860
  </tr>
1861
+ <tr valign="center">
1862
+ <th scope="row">
1863
+ <label title="Removes small arrow that appears on button hover" for="agca_admin_menu_arrow">Remove submenu arrow</label>
1864
+ </th>
1865
+ <td>
1866
+ <input title="Removes small arrow that appears on button hover" type="checkbox" name="agca_admin_menu_arrow" value="true" <?php if (get_option('agca_admin_menu_arrow')==true) echo 'checked="checked" '; ?> />
1867
+ </td>
1868
+ </tr>
1869
+ <tr valign="center">
1870
+ <th scope="row">
1871
+ <label title="Rounds submenu pop-up box" for="agca_admin_menu_submenu_round">Round submenu pop-up box</label><p><i>(Use it in combination with Colorizer)</i></p>
1872
+ </th>
1873
+ <td>
1874
+ <input title="Rounds submenu pop-up box" type="checkbox" name="agca_admin_menu_submenu_round" value="true" <?php if (get_option('agca_admin_menu_submenu_round')==true) echo 'checked="checked" '; ?> />
1875
+ </td>
1876
+ </tr>
1877
+ <?php
1878
+ $roundsubmenuzizestyle = "style='display:none'";
1879
+ if (get_option('agca_admin_menu_submenu_round')=='true') $roundsubmenuzizestyle = '';
1880
+ ?>
1881
+ <tr valign="center" id="agca_admin_menu_submenu_round_block" <?php echo $roundsubmenuzizestyle; ?> >
1882
+ <th scope="row">
1883
+ <label title="Size of rounded box curve" for="agca_admin_menu_submenu_round_size">Round submenu pop-up box - size</label>
1884
+ </th>
1885
+ <td>
1886
+ <input class="validateNumber" limit="3" title="Size of rounded box curve" type="text" name="agca_admin_menu_submenu_round_size" type="text" size="3" value="<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>" />&nbsp;(px)
1887
+ </td>
1888
+ </tr>
1889
+ <tr valign="center">
1890
+ <th scope="row">
1891
+ <label title="Adds custom logo above the admin menu" for="agca_admin_menu_brand">Add custom branding logo above the admin menu</label>
1892
+ </th>
1893
+ <td>
1894
+ <input title="Adds custom logo above the admin menu" type="text" size="47" name="agca_admin_menu_brand" value="<?php echo get_option('agca_admin_menu_brand'); ?>" />
1895
+ &nbsp;<p><i>Put here URL of custom branding logo image. Image can be of any size and type</i>.</p>
1896
+ </td>
1897
+ </tr>
1898
  <tr valign="center">
1899
  <td colspan="2">
1900
  <div class="ag_table_heading"><h3 tabindex="0">Add New Menu Items</h3></div>
1929
  </div>
1930
  <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
1931
  <h2 class="section_title">Colorizer Page</h2>
1932
+ <br />
 
 
1933
  <table class="form-table" width="500px">
1934
  <tr valign="center" class="ag_table_major_options">
1935
  <td><label for="agca_colorizer_turnonoff"><strong>Turn on/off Colorizer configuration</strong></label></td>
1943
  </td>
1944
  </tr>
1945
  <tr valign="center">
1946
+ <th><label title="Change admin page background color" for="color_background">Background color:</label></th>
1947
  <td><input type="text" id="color_background" name="color_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_background']); ?>" />
1948
  <input type="button" alt="color_background" class="pick_color_button" value="Pick color" />
1949
  <input type="button" alt="color_background" class="pick_color_button_clear" value="Clear" />
1957
  </td>
1958
  </tr>
1959
  <tr valign="center">
1960
+ <th><label title="Change admin bar (on top) color in admin panel" for="color_header">Admin bar color:</label></th>
1961
  <td><input type="text" id="color_header" name="color_header" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_header']); ?>" />
1962
  <input type="button" alt="color_header" class="pick_color_button" value="Pick color" />
1963
  <input type="button" alt="color_header" class="pick_color_button_clear" value="Clear" />
1971
  </td>
1972
  </tr>
1973
  <tr valign="center">
1974
+ <th><label title="Change button background color" for="color_admin_menu_top_button_background">Button background color:</label></th>
1975
  <td><input type="text" id="color_admin_menu_top_button_background" name="color_admin_menu_top_button_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_top_button_background']); ?>" />
1976
  <input type="button" alt="color_admin_menu_top_button_background" class="pick_color_button" value="Pick color" />
1977
  <input type="button" alt="color_admin_menu_top_button_background" class="pick_color_button_clear" value="Clear" />
1978
  </td>
1979
  </tr>
1980
+ <tr valign="center">
1981
+ <th><label title="Change button text color" for="color_admin_menu_font">Button text color:</label></th>
 
 
 
 
 
 
 
1982
  <td><input type="text" id="color_admin_menu_font" name="color_admin_menu_font" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_font']); ?>" />
1983
  <input type="button" alt="color_admin_menu_font" class="pick_color_button" value="Pick color" />
1984
  <input type="button" alt="color_admin_menu_font" class="pick_color_button_clear" value="Clear" />
1985
  </td>
1986
  </tr>
1987
+ <tr valign="center">
1988
+ <th><label title="Change button background color for current button" for="color_admin_menu_top_button_current_background">Button current background color:</label></th>
1989
+ <td><input type="text" id="color_admin_menu_top_button_current_background" name="color_admin_menu_top_button_current_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_top_button_current_background']); ?>" />
1990
+ <input type="button" alt="color_admin_menu_top_button_current_background" class="pick_color_button" value="Pick color" />
1991
+ <input type="button" alt="color_admin_menu_top_button_current_background" class="pick_color_button_clear" value="Clear" />
1992
+ </td>
1993
+ </tr>
1994
+ <tr valign="center">
1995
+ <th><label title="Change button background color on mouseover" for="color_admin_menu_top_button_hover_background">Button hover background color:</label></th>
1996
+ <td><input type="text" id="color_admin_menu_top_button_hover_background" name="color_admin_menu_top_button_hover_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_top_button_hover_background']); ?>" />
1997
+ <input type="button" alt="color_admin_menu_top_button_hover_background" class="pick_color_button" value="Pick color" />
1998
+ <input type="button" alt="color_admin_menu_top_button_hover_background" class="pick_color_button_clear" value="Clear" />
1999
+ </td>
2000
+ </tr>
2001
+ <tr valign="center">
2002
+ <th><label title="Change button top border color" for="color_admin_menu_submenu_border_top">Button border top color:</label></th>
2003
+ <td><input type="text" id="color_admin_menu_submenu_border_top" name="color_admin_menu_submenu_border_top" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_submenu_border_top']); ?>" />
2004
+ <input type="button" alt="color_admin_menu_submenu_border_top" class="pick_color_button" value="Pick color" />
2005
+ <input type="button" alt="color_admin_menu_submenu_border_top" class="pick_color_button_clear" value="Clear" />
2006
+ </td>
2007
+ </tr>
2008
+ <tr valign="center">
2009
+ <th><label title="Change button bottom border color" for="color_admin_menu_submenu_border_bottom">Button border bottom color:</label></th>
2010
+ <td><input type="text" id="color_admin_menu_submenu_border_bottom" name="color_admin_menu_submenu_border_bottom" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_submenu_border_bottom']); ?>" />
2011
+ <input type="button" alt="color_admin_menu_submenu_border_bottom" class="pick_color_button" value="Pick color" />
2012
+ <input type="button" alt="color_admin_menu_submenu_border_bottom" class="pick_color_button_clear" value="Clear" />
2013
+ </td>
2014
+ </tr>
2015
+ <tr valign="center">
2016
+ <th><label title="Change submenu item background color" for="color_admin_menu_submenu_background">Submenu button background color:</label></th>
2017
+ <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_submenu_background']); ?>" />
2018
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button" value="Pick color" />
2019
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear" value="Clear" />
2020
+ </td>
2021
+ </tr>
2022
+ <tr valign="center">
2023
+ <th><label title="Change submenu item background color on mouseover" for="color_admin_menu_submenu_background_hover">Submenu button hover background color:</label></th>
2024
+ <td><input type="text" id="color_admin_menu_submenu_background_hover" name="color_admin_menu_submenu_background_hover" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_menu_submenu_background_hover']); ?>" />
2025
+ <input type="button" alt="color_admin_menu_submenu_background_hover" class="pick_color_button" value="Pick color" />
2026
+ <input type="button" alt="color_admin_menu_submenu_background_hover" class="pick_color_button_clear" value="Clear" />
2027
+ </td>
2028
+ </tr>
2029
+ <tr valign="center">
2030
+ <th><label title="Change submenu item text color" for="color_admin_submenu_font">Submenu text color:</label></th>
2031
+ <td><input type="text" id="color_admin_submenu_font" name="color_admin_submenu_font" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_admin_submenu_font']); ?>" />
2032
+ <input type="button" alt="color_admin_submenu_font" class="pick_color_button" value="Pick color" />
2033
+ <input type="button" alt="color_admin_submenu_font" class="pick_color_button_clear" value="Clear" />
2034
+ </td>
2035
+ </tr>
2036
  <?php if($wpversion >= 3.2) { ?>
2037
  <tr valign="center">
2038
  <th><label title="Change background color of element behind admin menu" for="color_admin_menu_behind_background">Wrapper background color:</label></th>
2070
  </td>
2071
  </tr>
2072
  <tr valign="center">
2073
+ <th><label title="Change color of admin bar text" for="color_font_header">Admin bar text color:</label></th>
2074
  <td><input type="text" id="color_font_header" name="color_font_header" class="color_picker" value="<?php echo htmlspecialchars($this->colorizer['color_font_header']); ?>" />
2075
  <input type="button" alt="color_font_header" class="pick_color_button" value="Pick color" />
2076
  <input type="button" alt="color_font_header" class="pick_color_button_clear" value="Clear" />
2107
  </table>
2108
  <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
2109
  <div id="picker"></div>
2110
+ </div>
2111
+ <div id="section_advanced" style="display:none" class="ag_section">
2112
+ <h2 class="section_title" tabindex="-1">Advanced</h2>
2113
+ <br />
2114
+ <p><i><strong>Info: </strong>These options will override existing customizations.</i></p>
2115
+ <br />
2116
+ <br /><br />
2117
+ <table class="form-table" width="500px">
2118
+ <tr valign="center">
2119
+ <th scope="row">
2120
+ <label title="Add custom CSS script to override existing styles" for="agca_script_css">Custom CSS Script</em></label>
2121
+ </th>
2122
+ <td>
2123
+ <textarea style="width:100%;height:200px" title="Add custom CSS script to override existing styles" rows="5" id="agca_script_css" name="agca_script_css" cols="40"><?php echo htmlspecialchars($this->custom_css); ?></textarea>
2124
+ </td>
2125
+ </tr>
2126
+ <tr valign="center">
2127
+ <th scope="row">
2128
+ <label title="Add additional custom JavaScript" for="agca_script_js">Custom JavaScript</label>
2129
+ </th>
2130
+ <td>
2131
+ <textarea style="width:100%;height:200px" title="Add additional custom JavaScript" rows="5" name="agca_script_js" id="agca_script_js" cols="40"><?php echo $this->custom_js; ?></textarea>
2132
+ </td>
2133
+ </tr>
2134
+ <tr valign="center">
2135
+ <th scope="row">
2136
+ <label title="Export/import settings" for="agca_export_import">Export / import settings</label>
2137
+ </th>
2138
+ <td id="import_file_area">
2139
+ <input type="button" name="agca_export_settings" value="Export Settings" onclick="exportSettings();"/></br>
2140
+ <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
2141
+ <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
2142
+ <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
2143
+ <input type="button" name="agca_import_settings" value="Import Settings" onclick="importSettings();"/>
2144
+ </td>
2145
+
2146
+
2147
+
2148
+
2149
+ </tr>
2150
+
2151
+ </table>
2152
+ </div>
2153
  <br /><br /><br />
2154
  <p class="submit">
2155
+ <input type="button" id="save_plugin_settings" title="Save changes button" class="button-primary" value="<?php _e('Save Changes') ?>" onClick="savePluginSettings()" />
2156
+ </p>
2157
+
2158
  </form>
2159
  </div>
2160
+
2161
  <br />
2162
+ <br /><br /><br /><p id="agca_footer_support_info">WordPress 'AG Custom Admin' plugin by Argonius. If you have any questions, ideas for future development or if you found a bug or having any issues regarding this plugin, please visit plugin's <a href="http://wordpress.argonius.com/ag-custom-admin">SUPPORT</a> page. <br />You can also support development of this plugin if you <a href="http://wordpress.argonius.com/donate">Make a donation</a>. Thanks!<br /><br />I want to thank specially mr. <a href="http://www.alvisenicoletti.com/">Alvise Nicoletti</a> for his support in creating new features in 1.2.6.<br /><br />Have a nice blogging!</p><br />
2163
  <?php
2164
  }
2165
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: argonius
3
  Donate link: http://wordpress.argonius.com/donate
4
  Tags: admin, customize, hide, change admin
5
  Requires at least: 3.0
6
- Tested up to: 3.3.1
7
- Stable tag: 1.2.5.3
8
 
9
  Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
10
 
@@ -67,27 +67,47 @@ For more information about the plugin please see: http://wordpress.argonius.com/
67
 
68
  == Frequently Asked Questions ==
69
 
70
- = My text is not in the right place. How to fix it? =
71
- It is possible that WordPress usually wraps that text with some HTML tags. In that case use one of HTML tags to surround your text, e.g. &lt;h1&gt;My text&lt;/h1&gt;, or other (a, p, h2, h3.. etc.)
72
-
73
- = Plugin does not work after upgrading to new version. =
74
- Try to clear browser's cache, and reload page.
75
 
76
  = I see only blank page. What to do? =
77
- If you want to deactivate plugin, but you can't access admin panel, turn off JavaScript in your browser and than log in admin and deactivate plugin (This works only for administrator). Try also to clear browser's cache. If this does not work, try to find javaScript error in browser's console and post it to plugin's support page.
78
 
79
- = Admin menu buttons are changed in a wrong way =
80
  Please use 'Reset Settings' button on Admin Menu page to reset menu configuration to defaults. Remember that you should postpone admin menu configuration to the very end of admin page customization, because, any changes made from other plugins to admin menu (e.g adding new button of plugin that is activated, or removing that button when plugin is deactivated) could corrupt admin menu configuration.
81
 
 
 
 
 
 
 
 
82
  == Screenshots ==
83
 
84
- 1. Text in header or footer could be customized.
85
- 2. Login page top bar could be changer or removed. Custom login photo could be added.
86
- 3. Admin menu is completely customizable. You can rename or remove items in menu and submenu, or add brand new buttons with custom links.
87
- 4. Add custom background and text colors in admin and login pages.
88
 
89
  == Changelog ==
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  = 1.2.5.3 =
92
  * Fixed issues related to WP 3.3.1 version
93
  * Fixed bug: Hidding/changing top admin bar WP icon
@@ -173,6 +193,13 @@ Please use 'Reset Settings' button on Admin Menu page to reset menu configuratio
173
 
174
  == Upgrade Notice ==
175
 
 
 
 
 
 
 
 
176
  = 1.2.5.3 =
177
  Fixed issues related to WordPress version 3.3.1
178
 
3
  Donate link: http://wordpress.argonius.com/donate
4
  Tags: admin, customize, hide, change admin
5
  Requires at least: 3.0
6
+ Tested up to: 3.3.2
7
+ Stable tag: 1.2.5.4
8
 
9
  Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
10
 
67
 
68
  == Frequently Asked Questions ==
69
 
70
+ = Plugin does not work after upgrading to new version. What should I do? =
71
+ Try to clear browser's cache, and reload page. In extreme situations, you would need to remove plugin and to download and install fresh installation from WordPress repository.
 
 
 
72
 
73
  = I see only blank page. What to do? =
74
+ This is caused by JavaScript error thrown by AGCA or some other plugin. If you want to deactivate plugin, but you can't access admin panel, turn off JavaScript in your browser and than log in back and deactivate plugin (This works only for administrator). Try also to clear browser's cache. If this does not work, try to find javaScript error in browser's console and post it to plugin's support page.
75
 
76
+ = Something is wrong with Admin Menu buttons =
77
  Please use 'Reset Settings' button on Admin Menu page to reset menu configuration to defaults. Remember that you should postpone admin menu configuration to the very end of admin page customization, because, any changes made from other plugins to admin menu (e.g adding new button of plugin that is activated, or removing that button when plugin is deactivated) could corrupt admin menu configuration.
78
 
79
+ = Some errors appear on my page =
80
+ Go to browser's console and see if there are any errors. Try to locate them. If you can't fix error by yourself, post it back to plugin's support page.
81
+
82
+ = Plugin does not work =
83
+ Try clearing browser's cache. If that does not work, go to browser's console and see if there are any errors. Try to locate them. If you can't fix error by yourself, post it back to plugin's support page. When trying to locate the problem, the best way is to disable other plugins, because there could be a conflict with them. If there is a conflict with other plugin, it can be found by disabling one by one plugin, until the problem is solved.
84
+
85
+
86
  == Screenshots ==
87
 
88
+ 1. AG Custom Admin provides most of options for Admin Panel customization, and it's easy to use.
89
+ 2. Login page can be customized and styled with custom branding logo or image, rounded borders, background colors.
90
+ 3. Admin menu is completely customizable. You can rename or remove items from menu and submenu, or add brand new buttons with custom links.
91
+ 4. Default WP grey colors can be refreshed with any colors that you like! There are a lot of Colorizer option which can be use to style text, background, login, widgets, admin menu, top bar, footer and many more!
92
 
93
  == Changelog ==
94
 
95
+ = 1.2.6 =
96
+ * Fixed hidding top bar issue for site pages
97
+ * Fixed issues with custom content on Dashboard page. Any custom HTML can be used now.
98
+ * Custom CSS script support
99
+ * Custom JAvaScript support
100
+ * Exporting / importing AG Custom Admin customizations
101
+ * Added custom branding field above the admin menu for adding custom brand images
102
+ * Rounding admin menu popups and login page
103
+ * Option for removing Welcome dashboard widget
104
+ * New colorizer options for admin menu, top bar
105
+ * New AGCA info area
106
+ * Fixed caching issues on updates
107
+
108
+ = 1.2.5.4 =
109
+ * Fixed fatal error from version 1.2.5.3
110
+
111
  = 1.2.5.3 =
112
  * Fixed issues related to WP 3.3.1 version
113
  * Fixed bug: Hidding/changing top admin bar WP icon
193
 
194
  == Upgrade Notice ==
195
 
196
+
197
+ = 1.2.6 =
198
+ A lot of improvements in 1.2.6, fixed issues with top bar, caching on updates, better styles, etc. and new features: export/import new colorizer options, better admin menu styles, custom css, custom js, admin bar on site pages etc.
199
+
200
+ = 1.2.5.4 =
201
+ Fixed fatal error from version 1.2.5.3
202
+
203
  = 1.2.5.3 =
204
  Fixed issues related to WordPress version 3.3.1
205
 
screenshot-1.jpg CHANGED
Binary file
screenshot-2.jpg CHANGED
Binary file
screenshot-3.jpg CHANGED
Binary file
screenshot-4.jpg CHANGED
Binary file
script/ag_script.js CHANGED
@@ -1,503 +1,724 @@
1
  var afterFormClickCreateJson = true;
2
  var editingButtonNow = false;
3
-
 
4
  function booleanToChecked(bool){
5
- if(bool == 'true'){
6
- return 'checked="checked"';
7
- }else if(bool == 'checked'){
8
- return 'checked="checked"';
9
- }
10
  }
11
 
12
  function hideShowSubmenus(index){
13
 
14
- var finish = false;
15
- var found = false;
16
- jQuery('#ag_edit_adminmenu td').each(function(){
17
- if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
18
- if(jQuery(this).hasClass('ag_admin_menu_child')){
19
- jQuery(this).parent().toggleClass('noclass');
20
- found = true;
21
- }
22
- if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
23
- finish = true;
24
- }
25
- }
26
- });
27
- /*FOCUS*/
28
- if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
29
- jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
30
- };
31
  }
32
 
33
  /*
34
  Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
35
  */
36
  function prettyEditMenuPage(){
37
- jQuery('#ag_edit_adminmenu td').each(function(){
38
- if(jQuery(this).hasClass('ag_admin_menu_child')){
39
- jQuery(this).parent().addClass('noclass');
40
- };
41
- });
42
- jQuery('#ag_edit_adminmenu td').each(function(){
43
- if(jQuery(this).hasClass('ag_admin_menu_parent')){
44
- jQuery(this).parent().css('background-color','#d8eAd8');
45
- jQuery(this).bind('click',function(evt){
46
- if(evt.target.className == 'ag_admin_menu_parent'){
47
- hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
48
- }
49
- });
50
- };
51
- });
52
- jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
53
- jQuery(this).parent().click();
54
- //jQuery(this).parent().focus();
55
- });
56
  };
57
 
58
  function createEditMenuPage(checkboxes,textboxes){
59
- /*Create menu page in AGCA settings*/
60
 
61
- //console.log(textboxes);
62
- var counter = 0;
63
- var TBlength = textboxes.length;
64
- if(textboxes==""){
65
- TBlength = 9999999;
66
- }
67
 
68
- var topElement="";
69
- jQuery('ul#adminmenu li').each(function(){
70
- if(!jQuery(this).hasClass("wp-menu-separator") && !jQuery(this).hasClass("wp-menu-separator-last") && !jQuery(this).hasClass("ag-custom-button") && (counter < TBlength )){
71
 
72
- //if subelement
73
- if(jQuery(this).parent().parent().hasClass('wp-submenu')){
74
- subElement = jQuery(this).find('a').text();
75
- //console.log(jQuery(this));
76
- //console.log(subElement);
77
- var isHidden = "";
78
- var sub_item_text_value;
79
- if(textboxes ==""){
80
- sub_item_text_value = subElement;
81
- }else{
82
- sub_item_text_value = textboxes[counter][1];
83
- isHidden = checkboxes[counter][1];
84
- }
85
- jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_child'><div style=\"float:left\"><a tabindex=\"-1\" href=\"javascript:void(0)\" style=\"font-weight:bold;\"title=\""+topElement+" submenu: "+subElement+"\"><span style=\"font-weight:normal\">submenu: </span>"+subElement+"</a></div><div style=\"float:right\"><input type=\"checkbox\" title=\"Remove "+topElement+" submenu: "+subElement+" from menu\" class=\""+subElement+"\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></div></td><td class='ag_admin_menu_child2' ><input type=\"text\" title=\"Rename submenu item "+subElement+" with this value\" class=\""+subElement+"\" size=\"47\" value=\""+sub_item_text_value+"\" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></td></tr>");
86
- }
87
- //if top element
88
- else{
89
- topElement = jQuery(this).children('a').clone().children().remove().end().text();
90
- topElement = jQuery.trim(topElement);
91
- var top_item_text_value;
92
- var isHidden = "";
93
- if(textboxes ==""){
94
- top_item_text_value = topElement;
95
- }else{
96
- top_item_text_value = textboxes[counter][1];
97
- isHidden = checkboxes[counter][1];
98
- }
99
- jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_parent'><br /><a tabindex=\"0\" href=\"javascript:void(0)\" >" + topElement +"</a><div style=\"float:right\"><input title=\"Remove "+topElement+" from menu\" class=\""+jQuery(this).attr("id")+"\" type=\"checkbox\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></div></td><td class='ag_admin_menu_parent2' ><input title=\"Rename "+topElement+" with this value\" type=\"text\" class=\""+jQuery(this).attr("id")+"\" size=\"47\" value=\""+top_item_text_value+"\" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></td></tr>");
100
- }
101
- counter++;
102
- }
103
- });
104
 
105
- //console.log(checkboxes.replace('<-TOP->','')+"|"+textboxes.replace('<-TOP->',''));
106
- prettyEditMenuPage();
107
  }
108
 
109
  function createEditMenuPageV32(checkboxes,textboxes){
110
- /*Create menu page in AGCA settings*/
111
 
112
- var counter = 0;
113
- var TBlength = textboxes.length;
114
- if(textboxes==""){
115
- TBlength = 9999999;
116
- }
117
 
118
- var topElement="";
119
- jQuery('ul#adminmenu li').each(function(){
120
- if(!jQuery(this).hasClass("wp-menu-separator") && !jQuery(this).hasClass("wp-menu-separator-last") && !jQuery(this).hasClass("ag-custom-button") && (jQuery(this).attr('id') !="collapse-menu") && (counter < TBlength )){
121
 
122
- //if subelement
123
- if(jQuery(this).parent().parent().parent().hasClass('wp-submenu')){
124
- subElement = jQuery(this).find('a').text();
125
- //console.log(jQuery(this));
126
- //console.log(subElement);
127
- var isHidden = "";
128
- var sub_item_text_value;
129
- if(textboxes ==""){
130
- sub_item_text_value = subElement;
131
- }else{
132
- sub_item_text_value = textboxes[counter][1];
133
- isHidden = checkboxes[counter][1];
134
- }
135
- jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_child'><div style=\"float:left\"><a tabindex=\"-1\" href=\"javascript:void(0)\" style=\"font-weight:bold;\"title=\""+topElement+" submenu: "+subElement+"\"><span style=\"font-weight:normal\">submenu: </span>"+subElement+"</a></div><div style=\"float:right\"><input type=\"checkbox\" title=\"Remove "+topElement+" submenu: "+subElement+" from menu\" class=\""+subElement+"\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></div></td><td class='ag_admin_menu_child2' ><input type=\"text\" title=\"Rename submenu item "+subElement+" with this value\" class=\""+subElement+"\" size=\"47\" value=\""+sub_item_text_value+"\" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></td></tr>");
136
- }
137
- //if top element
138
- else{
139
- topElement = jQuery(this).children('a').clone().children().remove().end().text();
140
- topElement = jQuery.trim(topElement);
141
- var top_item_text_value;
142
- var isHidden = "";
143
- if(textboxes ==""){
144
- top_item_text_value = topElement;
145
- }else{
146
- top_item_text_value = textboxes[counter][1];
147
- isHidden = checkboxes[counter][1];
148
- }
149
- jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_parent'><br /><a tabindex=\"0\" href=\"javascript:void(0)\" >" + topElement +"</a><div style=\"float:right\"><input title=\"Remove "+topElement+" from menu\" class=\""+jQuery(this).attr("id")+"\" type=\"checkbox\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></div></td><td class='ag_admin_menu_parent2' ><input title=\"Rename "+topElement+" with this value\" type=\"text\" class=\""+jQuery(this).attr("id")+"\" size=\"47\" value=\""+top_item_text_value+"\" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></td></tr>");
150
- }
151
- counter++;
152
- }else if(jQuery(this).attr('id') =="collapse-menu"){
153
- jQuery(this).remove();
154
- }
155
- });
156
 
157
- //console.log(checkboxes.replace('<-TOP->','')+"|"+textboxes.replace('<-TOP->',''));
158
- prettyEditMenuPage();
159
  }
160
 
161
  function showHideSection(text) {
162
- switch(text)
163
- {
164
- case 'Admin Bar': jQuery('#section_admin_bar').show(); jQuery('#section_admin_bar .section_title').trigger('focus');
165
- break;
166
- case 'Admin Footer': jQuery('#section_admin_footer').show(); jQuery('#section_admin_footer .section_title').trigger('focus');
167
- break;
168
- case 'Dashboard Page': jQuery('#section_dashboard_page').show(); jQuery('#section_dashboard_page .section_title').trigger('focus');
169
- break;
170
- case 'Login Page': jQuery('#section_login_page').show(); jQuery('#section_login_page .section_title').trigger('focus');
171
- break;
172
- case 'Admin Menu': jQuery('#section_admin_menu').show(); jQuery('#section_admin_menu .section_title').trigger('focus');
173
- break;
174
- case 'Colorizer': jQuery('#section_ag_colorizer_settings').show(); jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
175
- break;
176
- default: jQuery('#section_admin_bar').show(); jQuery('#section_admin_bar .section_title').trigger('focus');
177
-
178
-
179
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  function hideAllSections(){
183
- jQuery('#ag_main_menu li').each(function(){
184
- jQuery(this).attr("class","normal");
185
- });
186
- jQuery('.ag_section').each(function(){
187
- jQuery(this).hide();
188
- });
189
  }
190
  function reloadRemoveButtonEvents(){
191
  }
192
  function createTargetCombo(target,clas){
193
 
194
- var combo = ""
195
 
196
- combo+= "<select";
197
- if( clas != null){
198
- combo+=" class=\"editTarget\" ";
199
- }
200
- combo+= ">";
201
- combo+= "<option value=\"_blank\"";
202
- if(target == "_blank"){
203
- combo+= " selected ";
204
- }
205
- combo+= ">blank</option>";
206
- combo+= "<option value=\"_self\"";
207
- if(target == "_self"){
208
- combo+= " selected ";
209
- }
210
- combo+= ">self</option>";
211
- combo+= "<option value=\"_parent\"";
212
- if(target == "_parent"){
213
- combo+= " selected ";
214
- }
215
- combo+= ">parent</option>";
216
- combo+= "<option value=\"_top\"";
217
- if(target == "_top"){
218
- combo+= " selected ";
219
- }
220
- combo+= ">top</option>";
221
- combo+= "</select>";
222
- return combo;
223
  }
224
 
225
- jQuery(document).ready(function(){
226
- jQuery('a.button_remove').live("click", function(){
227
- jQuery(this).parent().parent().remove();
228
- });
229
- jQuery('a.button_edit').live("click", function(){
230
- if(editingButtonNow == false){
231
- var name = jQuery(this).parent().find('button').text();
232
- var url = jQuery(this).parent().find('button').attr('title');
233
- var target = jQuery(this).parent().find('button').attr('target');
234
- //console.log(target);
235
- editingButtonNow = name;
236
- jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" />' + createTargetCombo(target,"edit")+ '<button type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit">Save changes</button></div>');
237
- reloadRemoveButtonEvents();
238
- }
239
- });/*Save editing changes*/
240
- jQuery('#ag_add_adminmenu_button_edit').live("click", function(){
241
- //alert(jQuery(this).parent().html());
242
- var name = jQuery('#ag_add_adminmenu_name_edit').val();
243
- var url = jQuery('#ag_add_adminmenu_url_edit').val();
244
- var target = jQuery('select.editTarget').val();
245
- //var target = jQuery(this).parent().find('button').attr('target');
246
- name = name.replace(/["']{1}/gi,"");
247
- url = url.replace(/["']{1}/gi,"");
248
- jQuery('#temporary_button_edit').remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
 
250
- var element = 0;
251
- jQuery('#ag_add_adminmenu :button').each(function(){
252
- //dont use first button for adding new buttons
253
- if(element > 0){
254
- if(jQuery(this).html() == editingButtonNow){
255
- jQuery(this).attr('title',url);
256
- jQuery(this).attr('target',target);
257
- jQuery(this).html(name);
258
- }
259
- }
260
- element++;
261
- });
262
- editingButtonNow = false;
263
- });
 
 
 
 
264
  });
265
 
266
  jQuery(document).ready(function(){
267
- /*Add click handler on main buttons*/
268
- jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(){
269
- hideAllSections();
270
- var text = jQuery(this).text();
271
- jQuery(this).attr("class","selected");
272
- showHideSection(text);
273
- });
274
 
275
- /*Admin Menu Reset all setings button*/
276
- jQuery('#ag_edit_adminmenu_reset_button').click(function(){
277
- afterFormClickCreateJson = false;
278
- jQuery('#agca_form').submit();
279
- });
280
 
281
- /*Add new menu item button - creates new HTMl button elements*/
282
- jQuery('#ag_add_adminmenu_button').click(function(){
283
- var name = jQuery('#ag_add_adminmenu_name').val();
284
- var url = jQuery('#ag_add_adminmenu_url').val();
285
- var target = jQuery('#ag_add_adminmenu_target').val();
286
- name = name.replace(/["']{1}/gi,"");
287
- url = url.replace(/["']{1}/gi,"");
288
- jQuery('#ag_add_adminmenu_name').val("");
289
- jQuery('#ag_add_adminmenu_url').val("");
290
- jQuery('#ag_add_adminmenu_target').val("_none");
291
- jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;(<a style="cursor:pointer" class="button_edit">edit</a>)&nbsp;(<a style="cursor:pointer" class="button_remove">remove</a>)</td><td></td></tr>');
292
- reloadRemoveButtonEvents();
293
- });
294
 
295
- /*Add tooltip box*/
296
- jQuery("body").append("<div id='AGToolTipDiv'></div>");
297
 
298
- /*ToolTip*/
299
- jQuery("label[title],#agca_donate_button").each(function() {
300
- jQuery(this).hover(function(e) {
301
- jQuery(this).mousemove(function(e) {
302
- var tipY = e.pageY + 16;
303
- var tipX = e.pageX + 16;
304
- jQuery("#AGToolTipDiv").css({'top': tipY, 'left': tipX});
305
- });
306
- jQuery("#AGToolTipDiv")
307
- .html(jQuery(this).attr('title'))
308
- .stop(true,true)
309
- .fadeIn("fast");
310
- jQuery(this).removeAttr('title');
311
- }, function() {
312
- jQuery("#AGToolTipDiv")
313
- .stop(true,true)
314
- .fadeOut("fast");
315
- jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
316
- });
317
- });
 
 
 
318
 
319
- /*SECTION FOCUS*/
320
- jQuery('.section_title').focus(function(){
321
- });
322
 
323
- /*HIDE/SHOW New items click*/
324
- jQuery('input[name=agca_admin_bar_new_content]').bind("click",function(){
325
- var checked = jQuery(this).is(":checked");
326
- if(!checked){
327
- jQuery(".new_content_header_submenu").show("slide");
328
- }else{
329
- jQuery(".new_content_header_submenu").hide("slideDown");
330
- }
331
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
 
333
 
334
  });
335
 
336
  /*CLICKING ON ITEMS HANDLING*/
337
  jQuery(document).ready(function(){
338
- jQuery('#agca_footer').change(function(){
339
- });
340
  });
341
 
342
  /*Admin menu*/
343
  jQuery(document).ready(function(){
344
- jQuery('#adminmenu').css('display','block');
345
  });
346
 
347
  /*FORM SUBMITTED*/
348
- jQuery(document).ready(function(){
349
- jQuery('#agca_form').submit(function(){
350
-
351
- /*Serialize checkboxes*/
352
- var array = "{";
353
- var firstElement = true;
354
- var topMarker = "";
355
- jQuery('#ag_edit_adminmenu :checkbox').each(function(){
356
- if(firstElement != true){
357
- array += ", ";
358
- }
359
- topMarker = "";
360
- if(jQuery(this).parent().parent().hasClass('ag_admin_menu_parent')){
361
- topMarker="<-TOP->";
362
- }
363
- array += "\"" + topMarker + jQuery(this).attr('class') + "\" : ";
364
- array += "\"" + jQuery(this).attr('checked') + "\"";
365
- firstElement = false;
366
- });
367
- array += "}|";
368
-
369
- /*Serialize textboxes*/
370
- array += "{";
371
- firstElement = true;
372
- jQuery('#ag_edit_adminmenu :text').each(function(){
373
- if(firstElement != true){
374
- array += ", ";
375
- }
376
- topMarker = "";
377
- if(jQuery(this).parent().hasClass('ag_admin_menu_parent2')){
378
- topMarker="<-TOP->";
379
- }
380
- array += "\"" + topMarker + jQuery(this).attr('class') + "\" : ";
381
- array += "\"" + jQuery(this).val() + "\"";
382
- firstElement = false;
383
- });
384
- array += "}";
385
 
386
- if(afterFormClickCreateJson == true){
387
- jQuery('#ag_edit_adminmenu_json').val(array);
388
- }else{
389
- jQuery('#ag_edit_adminmenu_json').val('');
390
- }
391
- //console.log(array);
392
- //serialize buttons
393
- array = "{";
394
- var element = 0;
395
- jQuery('#ag_add_adminmenu :button').each(function(){
396
- //console.log(jQuery(this).html()+jQuery(this).attr('title'));
397
- if(element > 0){
398
- if(element > 1){
399
- array += ", ";
400
- }
401
- array += "\"" + jQuery(this).html() + "\" : {";
402
- array += " \"value\" : ";
403
- array += "\"" + jQuery(this).attr('title') + "\"";
404
- array += ", \"target\" : ";
405
- array += "\"" + jQuery(this).attr('target') + "\"}";
406
- }
407
- element++;
408
- });
409
- array += "}";
410
- if(element == 1){array="";}
411
- jQuery('#ag_add_adminmenu_json').val(array);
412
 
413
- /*Serialize colors*/
414
- var array = "{";
415
- var firstElement = true;
416
- var topMarker = "";
417
- jQuery('input.color_picker').each(function(){
418
- if(firstElement != true){
419
- array += ", ";
420
- }
421
- array += "\"" + jQuery(this).attr('id') + "\" : ";
422
- array += "\"" + jQuery(this).val() + "\"";
423
- firstElement = false;
424
- });
425
- array += "}";
426
- jQuery('#ag_colorizer_json').val(array);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
427
 
428
- return true;
429
- });
430
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
 
432
  /*C O L O R I Z E R*/
433
- function updateTargetColor(id, color){
434
- switch(id)
435
- {
436
- case 'color_background':
437
- jQuery('html, .wp-dialog').css({'background-color':color});
438
- break;
439
- case 'color_footer':
440
- jQuery('#footer').css({'background':color});
441
- if(wpversion >= 3.2){
442
- jQuery('#footer').css({'margin':'0','margin-left':'146px','padding':'15px'});
443
- }
444
- break;
445
- case 'color_header':
446
- jQuery('#wphead').css({'background':color});
447
- if(wpversion >= 3.2){
448
- jQuery('#wphead').css({'margin':'0','margin-left':'-14px','padding-left':'15px'});
449
- jQuery("#backtoblog").attr("style","");
450
- }
451
- break;
452
- case 'color_admin_menu_top_button_background':
453
- jQuery('#adminmenu a.menu-top').css({'background':color});
454
- break;
455
- case 'color_admin_menu_submenu_background':
456
- jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
457
- jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
458
- jQuery(this).css({'background':color});
459
- });
460
- break;
461
- case 'color_admin_menu_font':
462
- jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({'color':color});
463
- break;
464
- case 'color_admin_menu_behind_background':
465
- jQuery('#adminmenuback, #adminmenuwrap').css({'background-color':color});
466
- break;
467
- case 'color_admin_menu_behind_border':
468
- jQuery('#adminmenuback, #adminmenuwrap').css({'border-color':color});
469
- break;
470
- case 'color_admin_menu_submenu_background_over':
471
- //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
472
- break;
473
- case 'color_font_content':
474
- jQuery('#wpbody-content, #wpbody-content label, #wpbody-content p,#wpbody-content .form-table th, #wpbody-content .form-wrap label').css({'color':color});
475
- break;
476
- case 'color_font_header':
477
- jQuery('#wphead, #wphead a').css({'color':color});
478
- break;
479
- case 'color_font_footer':
480
- jQuery('#footer, #footer a').css({'color':color});
481
- break;
482
- case 'color_widget_bar':
483
- jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({'background' : color, 'text-shadow' :'none'});
484
- break;
485
- case 'color_widget_background':
486
- jQuery(".widget, .postbox").css('background',color);
487
- //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
488
- break;
489
- default:
490
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  }
492
  function updateColor(id,color){
493
- jQuery("#"+id).css({'background-color':color});
494
- jQuery("#"+id).val(color);
495
- if(isDarker(color) == true){
496
- jQuery("#"+id).css('color','#ffffff');
497
- }else{
498
- jQuery("#"+id).css('color','#000000');
499
- }
500
- updateTargetColor(id,color);
 
 
501
  }
502
  /*First load apply colours from fields*/
503
 
@@ -522,139 +743,199 @@ jQuery(document).ready(function(){
522
  });*/
523
  /*A J A X*/
524
  jQuery(document).ready(function(){
525
- jQuery(document).ready(function(){
526
- var url="http://wordpress.argonius.com/agca/news.php/news?jsoncallback=?";
527
- jQuery.getJSON(
528
- url,{
529
- wp_ver: wpversion,
530
- agca_ver: agca_version,
531
- format: "json"
532
- },
533
- function(json){
534
- jQuery.each(json.posts,function(i,post){
535
- jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
536
- });
537
- jQuery('#agca_news p').each(function(){
538
- jQuery(this).hide();
539
- });
 
 
 
 
 
 
 
 
 
 
 
 
540
 
541
- });
542
- });
543
- setInterval(function() {
544
- if(jQuery('#agca_news p.news_online').size() == 0){
545
- jQuery('#agca_news p:first').addClass('news_online');
546
- jQuery('#agca_news p:first').show();
547
- }else{
548
- var changed = false;
549
- var finish = false;
550
- jQuery('#agca_news p').each(function(){
551
- if(finish != true){
552
- if(changed == true){
553
- jQuery(this).addClass('news_online');
554
- jQuery(this).show();
555
- finish = true;
556
- }
557
- else if(jQuery(this).hasClass('news_online')){
558
- jQuery(this).hide();
559
- jQuery(this).removeClass('news_online');
560
- changed = true;
561
- };
562
- }
563
- });
564
- if(jQuery('#agca_news p.news_online').size() == 0){
565
- jQuery('#agca_news p:first').addClass('news_online');
566
- jQuery('#agca_news p:first').show();
567
- }
568
- }
569
- }, 5000);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
570
 
571
  });
572
  /*A J A X*/
573
 
574
  function isWPHigherOrEqualThan(targetVersion){
575
- var versions = ["0.7",
576
- "0.71",
577
- "0.711",
578
- "0.72",
579
- "1.0",
580
- "1.0.1",
581
- "1.0.2",
582
- "1.2",
583
- "1.2.1",
584
- "1.2.2",
585
- "1.5",
586
- "1.5.1",
587
- "1.5.1.2",
588
- "1.5.1.3",
589
- "1.5.2",
590
- "2.0",
591
- "2.0.1",
592
- "2.0.2",
593
- "2.0.3",
594
- "2.0.4",
595
- "2.0.5",
596
- "2.0.6",
597
- "2.0.7",
598
- "2.0.8",
599
- "2.0.9",
600
- "2.0.10",
601
- "2.0.11",
602
- "2.1",
603
- "2.1.1",
604
- "2.1.2",
605
- "2.1.3",
606
- "2.2",
607
- "2.2.1",
608
- "2.2.2",
609
- "2.2.3",
610
- "2.3",
611
- "2.3.1",
612
- "2.3.2",
613
- "2.3.3",
614
- "2.5",
615
- "2.5.1",
616
- "2.6",
617
- "2.6.1",
618
- "2.6.2",
619
- "2.6.3",
620
- "2.6.5",
621
- "2.7",
622
- "2.7.1",
623
- "2.8",
624
- "2.8.1",
625
- "2.8.2",
626
- "2.8.3",
627
- "2.8.4",
628
- "2.8.5",
629
- "2.8.6",
630
- "2.9",
631
- "2.9.1",
632
- "2.9.2",
633
- "3.0",
634
- "3.0.1",
635
- "3.0.2",
636
- "3.0.3",
637
- "3.0.4",
638
- "3.0.5",
639
- "3.0.6",
640
- "3.1",
641
- "3.1.1",
642
- "3.1.2",
643
- "3.1.3",
644
- "3.1.4",
645
- "3.2",
646
- "3.2.1",
647
- "3.3",
648
- "3.3.1"];
649
- //remove sufixes, beta RC etc
650
- if (wpversion.indexOf("-")!=-1){
651
- var parts = wpversion.split("-");
652
- wpversion = parts[0];
653
- }
654
- for(var i in versions){
655
- if(versions[i] == targetVersion){
656
- if(wpversion >= targetVersion) return true;
657
- }
658
- }
659
- return false;
660
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  var afterFormClickCreateJson = true;
2
  var editingButtonNow = false;
3
+ var savedCustomScripts = false;
4
+ var agca_ajax_url = agca_global_plugin_url + "ajax.php";
5
  function booleanToChecked(bool){
6
+ if(bool == 'true'){
7
+ return 'checked="checked"';
8
+ }else if(bool == 'checked'){
9
+ return 'checked="checked"';
10
+ }
11
  }
12
 
13
  function hideShowSubmenus(index){
14
 
15
+ var finish = false;
16
+ var found = false;
17
+ jQuery('#ag_edit_adminmenu td').each(function(){
18
+ if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
19
+ if(jQuery(this).hasClass('ag_admin_menu_child')){
20
+ jQuery(this).parent().toggleClass('noclass');
21
+ found = true;
22
+ }
23
+ if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
24
+ finish = true;
25
+ }
26
+ }
27
+ });
28
+ /*FOCUS*/
29
+ if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
30
+ jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
31
+ };
32
  }
33
 
34
  /*
35
  Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
36
  */
37
  function prettyEditMenuPage(){
38
+ jQuery('#ag_edit_adminmenu td').each(function(){
39
+ if(jQuery(this).hasClass('ag_admin_menu_child')){
40
+ jQuery(this).parent().addClass('noclass');
41
+ };
42
+ });
43
+ jQuery('#ag_edit_adminmenu td').each(function(){
44
+ if(jQuery(this).hasClass('ag_admin_menu_parent')){
45
+ jQuery(this).parent().css('background-color','#d8eAd8');
46
+ jQuery(this).bind('click',function(evt){
47
+ if(evt.target.className == 'ag_admin_menu_parent'){
48
+ hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
49
+ }
50
+ });
51
+ };
52
+ });
53
+ jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
54
+ jQuery(this).parent().click();
55
+ //jQuery(this).parent().focus();
56
+ });
57
  };
58
 
59
  function createEditMenuPage(checkboxes,textboxes){
60
+ /*Create menu page in AGCA settings*/
61
 
62
+ //console.log(textboxes);
63
+ var counter = 0;
64
+ var TBlength = textboxes.length;
65
+ if(textboxes==""){
66
+ TBlength = 9999999;
67
+ }
68
 
69
+ var topElement="";
70
+ jQuery('ul#adminmenu li').each(function(){
71
+ if(!jQuery(this).hasClass("wp-menu-separator") && !jQuery(this).hasClass("wp-menu-separator-last") && !jQuery(this).hasClass("ag-custom-button") && (counter < TBlength )){
72
 
73
+ //if subelement
74
+ if(jQuery(this).parent().parent().hasClass('wp-submenu')){
75
+ subElement = jQuery(this).find('a').text();
76
+ //console.log(jQuery(this));
77
+ //console.log(subElement);
78
+ var isHidden = "";
79
+ var sub_item_text_value;
80
+ if(textboxes ==""){
81
+ sub_item_text_value = subElement;
82
+ }else{
83
+ sub_item_text_value = textboxes[counter][1];
84
+ isHidden = checkboxes[counter][1];
85
+ }
86
+ jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_child'><div style=\"float:left\"><a tabindex=\"-1\" href=\"javascript:void(0)\" style=\"font-weight:bold;\"title=\""+topElement+" submenu: "+subElement+"\"><span style=\"font-weight:normal\">submenu: </span>"+subElement+"</a></div><div style=\"float:right\"><input type=\"checkbox\" title=\"Remove "+topElement+" submenu: "+subElement+" from menu\" class=\""+subElement+"\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></div></td><td class='ag_admin_menu_child2' ><input type=\"text\" title=\"Rename submenu item "+subElement+" with this value\" class=\""+subElement+"\" size=\"47\" value=\""+sub_item_text_value+"\" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></td></tr>");
87
+ }
88
+ //if top element
89
+ else{
90
+ topElement = jQuery(this).children('a').clone().children().remove().end().text();
91
+ topElement = jQuery.trim(topElement);
92
+ var top_item_text_value;
93
+ var isHidden = "";
94
+ if(textboxes ==""){
95
+ top_item_text_value = topElement;
96
+ }else{
97
+ top_item_text_value = textboxes[counter][1];
98
+ isHidden = checkboxes[counter][1];
99
+ }
100
+ jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_parent'><br /><a tabindex=\"0\" href=\"javascript:void(0)\" >" + topElement +"</a><div style=\"float:right\"><input title=\"Remove "+topElement+" from menu\" class=\""+jQuery(this).attr("id")+"\" type=\"checkbox\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></div></td><td class='ag_admin_menu_parent2' ><input title=\"Rename "+topElement+" with this value\" type=\"text\" class=\""+jQuery(this).attr("id")+"\" size=\"47\" value=\""+top_item_text_value+"\" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></td></tr>");
101
+ }
102
+ counter++;
103
+ }
104
+ });
105
 
106
+ //console.log(checkboxes.replace('<-TOP->','')+"|"+textboxes.replace('<-TOP->',''));
107
+ prettyEditMenuPage();
108
  }
109
 
110
  function createEditMenuPageV32(checkboxes,textboxes){
111
+ /*Create menu page in AGCA settings*/
112
 
113
+ var counter = 0;
114
+ var TBlength = textboxes.length;
115
+ if(textboxes==""){
116
+ TBlength = 9999999;
117
+ }
118
 
119
+ var topElement="";
120
+ jQuery('ul#adminmenu li').each(function(){
121
+ if(!jQuery(this).hasClass("wp-menu-separator") && !jQuery(this).hasClass("wp-menu-separator-last") && !jQuery(this).hasClass("ag-custom-button") && (jQuery(this).attr('id') !="collapse-menu") && (counter < TBlength )){
122
 
123
+ //if subelement
124
+ if(jQuery(this).parent().parent().parent().hasClass('wp-submenu')){
125
+ subElement = jQuery(this).find('a').text();
126
+ //console.log(jQuery(this));
127
+ //console.log(subElement);
128
+ var isHidden = "";
129
+ var sub_item_text_value;
130
+ if(textboxes ==""){
131
+ sub_item_text_value = subElement;
132
+ }else{
133
+ sub_item_text_value = textboxes[counter][1];
134
+ isHidden = checkboxes[counter][1];
135
+ }
136
+ jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_child'><div style=\"float:left\"><a tabindex=\"-1\" href=\"javascript:void(0)\" style=\"font-weight:bold;\"title=\""+topElement+" submenu: "+subElement+"\"><span style=\"font-weight:normal\">submenu: </span>"+subElement+"</a></div><div style=\"float:right\"><input type=\"checkbox\" title=\"Remove "+topElement+" submenu: "+subElement+" from menu\" class=\""+subElement+"\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></div></td><td class='ag_admin_menu_child2' ><input type=\"text\" title=\"Rename submenu item "+subElement+" with this value\" class=\""+subElement+"\" size=\"47\" value=\""+sub_item_text_value+"\" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></td></tr>");
137
+ }
138
+ //if top element
139
+ else{
140
+ topElement = jQuery(this).children('a').clone().children().remove().end().text();
141
+ topElement = jQuery.trim(topElement);
142
+ var top_item_text_value;
143
+ var isHidden = "";
144
+ if(textboxes ==""){
145
+ top_item_text_value = topElement;
146
+ }else{
147
+ top_item_text_value = textboxes[counter][1];
148
+ isHidden = checkboxes[counter][1];
149
+ }
150
+ jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_parent'><br /><a tabindex=\"0\" href=\"javascript:void(0)\" >" + topElement +"</a><div style=\"float:right\"><input title=\"Remove "+topElement+" from menu\" class=\""+jQuery(this).attr("id")+"\" type=\"checkbox\" "+booleanToChecked(isHidden)+" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></div></td><td class='ag_admin_menu_parent2' ><input title=\"Rename "+topElement+" with this value\" type=\"text\" class=\""+jQuery(this).attr("id")+"\" size=\"47\" value=\""+top_item_text_value+"\" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></td></tr>");
151
+ }
152
+ counter++;
153
+ }else if(jQuery(this).attr('id') =="collapse-menu"){
154
+ jQuery(this).remove();
155
+ }
156
+ });
157
 
158
+ //console.log(checkboxes.replace('<-TOP->','')+"|"+textboxes.replace('<-TOP->',''));
159
+ prettyEditMenuPage();
160
  }
161
 
162
  function showHideSection(text) {
163
+ switch(text)
164
+ {
165
+ case 'Admin Bar':
166
+ jQuery('#section_admin_bar').show();
167
+ jQuery('#section_admin_bar .section_title').trigger('focus');
168
+ break;
169
+ case 'Admin Footer':
170
+ jQuery('#section_admin_footer').show();
171
+ jQuery('#section_admin_footer .section_title').trigger('focus');
172
+ break;
173
+ case 'Dashboard Page':
174
+ jQuery('#section_dashboard_page').show();
175
+ jQuery('#section_dashboard_page .section_title').trigger('focus');
176
+ break;
177
+ case 'Login Page':
178
+ jQuery('#section_login_page').show();
179
+ jQuery('#section_login_page .section_title').trigger('focus');
180
+ break;
181
+ case 'Admin Menu':
182
+ jQuery('#section_admin_menu').show();
183
+ jQuery('#section_admin_menu .section_title').trigger('focus');
184
+ break;
185
+ case 'Colorizer':
186
+ jQuery('#section_ag_colorizer_settings').show();
187
+ jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
188
+ break;
189
+ case 'Advanced':
190
+ jQuery('#section_advanced').show();
191
+ jQuery('#section_advanced .section_title').trigger('focus');
192
+ break;
193
+ default:
194
+ jQuery('#section_admin_bar').show();
195
+ jQuery('#section_admin_bar .section_title').trigger('focus');
196
+ }
197
+ }
198
+
199
+ function saveCustomScripts(){
200
+ var cssValue = jQuery('#agca_script_css').val();
201
+ if(cssValue == "")cssValue = " ";
202
+ jQuery.ajax({
203
+ url: agca_ajax_url,
204
+ data: {
205
+ data: cssValue,
206
+ action: "savecss"
207
+ },
208
+ type: "POST",
209
+ cache: false,
210
+ success: function (html) {
211
+ var jsValue = jQuery('#agca_script_js').val();
212
+ if(jsValue == "")jsValue = " ";
213
+ jQuery.ajax({
214
+ url: agca_ajax_url,
215
+ data: {
216
+ data: jsValue,
217
+ action: "savejs"
218
+ },
219
+ type: "POST",
220
+ cache: false,
221
+ success: function (html) {
222
+ savedCustomScripts = true;
223
+ jQuery('#agca_form').submit();
224
+ }
225
+ });
226
+
227
+ }
228
+ });
229
+
230
  }
231
 
232
  function hideAllSections(){
233
+ jQuery('#ag_main_menu li').each(function(){
234
+ jQuery(this).attr("class","normal");
235
+ });
236
+ jQuery('.ag_section').each(function(){
237
+ jQuery(this).hide();
238
+ });
239
  }
240
  function reloadRemoveButtonEvents(){
241
  }
242
  function createTargetCombo(target,clas){
243
 
244
+ var combo = ""
245
 
246
+ combo+= "<select";
247
+ if( clas != null){
248
+ combo+=" class=\"editTarget\" ";
249
+ }
250
+ combo+= ">";
251
+ combo+= "<option value=\"_blank\"";
252
+ if(target == "_blank"){
253
+ combo+= " selected ";
254
+ }
255
+ combo+= ">blank</option>";
256
+ combo+= "<option value=\"_self\"";
257
+ if(target == "_self"){
258
+ combo+= " selected ";
259
+ }
260
+ combo+= ">self</option>";
261
+ combo+= "<option value=\"_parent\"";
262
+ if(target == "_parent"){
263
+ combo+= " selected ";
264
+ }
265
+ combo+= ">parent</option>";
266
+ combo+= "<option value=\"_top\"";
267
+ if(target == "_top"){
268
+ combo+= " selected ";
269
+ }
270
+ combo+= ">top</option>";
271
+ combo+= "</select>";
272
+ return combo;
273
  }
274
 
275
+ function exportSettings(){
276
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
277
+ jQuery('#agca_form #_agca_import_settings').val("false");
278
+ jQuery('#agca_form #_agca_export_settings').val("true");
279
+ jQuery('#agca_form').submit();
280
+ }
281
+
282
+ function importSettings(){
283
+ if(jQuery('#settings_import_file').css("display") == "none"){
284
+ jQuery('#settings_import_file').show("slide");
285
+ }else{
286
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
287
+ if(jQuery('#settings_import_file').val() !=""){
288
+ jQuery('#agca_form #_agca_import_settings').val("true");
289
+ jQuery('#agca_form #_agca_export_settings').val("false");
290
+ jQuery('#agca_form').attr('enctype','multipart/form-data');
291
+ jQuery('#agca_form').submit();
292
+ }else{
293
+ alert("File for import is not selected!");
294
+ }
295
+ }
296
+
297
+ }
298
+
299
+ function savePluginSettings(){
300
+ jQuery('#import_file_area').remove();
301
+ jQuery('#agca_form').submit();
302
+ }
303
+
304
+ jQuery(document).ready(function(){
305
+ if(typeof isSettingsImport !== 'undefined'){
306
+ if(isSettingsImport){
307
+ saveCustomScripts();
308
+ //jQuery('#agca_form').submit();
309
+ // alert('Settings imported successfuly!');
310
+ }
311
+ }
312
+ jQuery('a.button_remove').live("click", function(){
313
+ jQuery(this).parent().parent().remove();
314
+ });
315
+ jQuery('a.button_edit').live("click", function(){
316
+ if(editingButtonNow == false){
317
+ var name = jQuery(this).parent().find('button').text();
318
+ var url = jQuery(this).parent().find('button').attr('title');
319
+ var target = jQuery(this).parent().find('button').attr('target');
320
+ //console.log(target);
321
+ editingButtonNow = name;
322
+ jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" />' + createTargetCombo(target,"edit")+ '<button type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit">Save changes</button></div>');
323
+ reloadRemoveButtonEvents();
324
+ }
325
+ });/*Save editing changes*/
326
+ jQuery('#ag_add_adminmenu_button_edit').live("click", function(){
327
+ //alert(jQuery(this).parent().html());
328
+ var name = jQuery('#ag_add_adminmenu_name_edit').val();
329
+ var url = jQuery('#ag_add_adminmenu_url_edit').val();
330
+ var target = jQuery('select.editTarget').val();
331
+ //var target = jQuery(this).parent().find('button').attr('target');
332
+ name = name.replace(/["']{1}/gi,"");
333
+ url = url.replace(/["']{1}/gi,"");
334
+ jQuery('#temporary_button_edit').remove();
335
 
336
+ var element = 0;
337
+ jQuery('#ag_add_adminmenu :button').each(function(){
338
+ //dont use first button for adding new buttons
339
+ if(element > 0){
340
+ if(jQuery(this).html() == editingButtonNow){
341
+ jQuery(this).attr('title',url);
342
+ jQuery(this).attr('target',target);
343
+ jQuery(this).html(name);
344
+ }
345
+ }
346
+ element++;
347
+ });
348
+ editingButtonNow = false;
349
+ });
350
+
351
+ setTimeout(function(){
352
+ jQuery('#agca_advertising').show(),700
353
+ });
354
  });
355
 
356
  jQuery(document).ready(function(){
357
+ /*Add click handler on main buttons*/
358
+ jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(){
359
+ hideAllSections();
360
+ var text = jQuery(this).text();
361
+ jQuery(this).attr("class","selected");
362
+ showHideSection(text);
363
+ });
364
 
365
+ /*Admin Menu Reset all setings button*/
366
+ jQuery('#ag_edit_adminmenu_reset_button').click(function(){
367
+ afterFormClickCreateJson = false;
368
+ jQuery('#agca_form').submit();
369
+ });
370
 
371
+ /*Add new menu item button - creates new HTMl button elements*/
372
+ jQuery('#ag_add_adminmenu_button').click(function(){
373
+ var name = jQuery('#ag_add_adminmenu_name').val();
374
+ var url = jQuery('#ag_add_adminmenu_url').val();
375
+ var target = jQuery('#ag_add_adminmenu_target').val();
376
+ name = name.replace(/["']{1}/gi,"");
377
+ url = url.replace(/["']{1}/gi,"");
378
+ jQuery('#ag_add_adminmenu_name').val("");
379
+ jQuery('#ag_add_adminmenu_url').val("");
380
+ jQuery('#ag_add_adminmenu_target').val("_none");
381
+ jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;(<a style="cursor:pointer" class="button_edit">edit</a>)&nbsp;(<a style="cursor:pointer" class="button_remove">remove</a>)</td><td></td></tr>');
382
+ reloadRemoveButtonEvents();
383
+ });
384
 
385
+ /*Add tooltip box*/
386
+ jQuery("body").append("<div id='AGToolTipDiv'></div>");
387
 
388
+ /*ToolTip*/
389
+ jQuery("label[title],#agca_donate_button").each(function() {
390
+ jQuery(this).hover(function(e) {
391
+ jQuery(this).mousemove(function(e) {
392
+ var tipY = e.pageY + 16;
393
+ var tipX = e.pageX + 16;
394
+ jQuery("#AGToolTipDiv").css({
395
+ 'top': tipY,
396
+ 'left': tipX
397
+ });
398
+ });
399
+ jQuery("#AGToolTipDiv")
400
+ .html(jQuery(this).attr('title'))
401
+ .stop(true,true)
402
+ .fadeIn("fast");
403
+ jQuery(this).removeAttr('title');
404
+ }, function() {
405
+ jQuery("#AGToolTipDiv")
406
+ .stop(true,true)
407
+ .fadeOut("fast");
408
+ jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
409
+ });
410
+ });
411
 
412
+ /*SECTION FOCUS*/
413
+ jQuery('.section_title').focus(function(){
414
+ });
415
 
416
+ /*HIDE/SHOW New items click*/
417
+ jQuery('input[name=agca_admin_bar_new_content]').bind("click",function(){
418
+ var checked = jQuery(this).is(":checked");
419
+ if(!checked){
420
+ jQuery(".new_content_header_submenu").show("slide");
421
+ }else{
422
+ jQuery(".new_content_header_submenu").hide("slideDown");
423
+ }
424
+ });
425
+
426
+ /*HIDE/SHOW size of rounded box on login page*/
427
+ jQuery('input[name=agca_login_round_box]').bind("click",function(){
428
+ var checked = jQuery(this).is(":checked");
429
+ if(checked){
430
+ jQuery("#agca_login_round_box_size_block").show("slide");
431
+ }else{
432
+ jQuery("#agca_login_round_box_size_block").hide("slideDown");
433
+ }
434
+ });
435
+
436
+ /*HIDE/SHOW size of rounded submenu box on admin page*/
437
+ jQuery('input[name=agca_admin_menu_submenu_round]').bind("click",function(){
438
+ var checked = jQuery(this).is(":checked");
439
+ if(checked){
440
+ jQuery("#agca_admin_menu_submenu_round_block").show("slide");
441
+ }else{
442
+ jQuery("#agca_admin_menu_submenu_round_block").hide("slideDown");
443
+ }
444
+ });
445
 
446
 
447
  });
448
 
449
  /*CLICKING ON ITEMS HANDLING*/
450
  jQuery(document).ready(function(){
451
+ jQuery('#agca_footer').change(function(){
452
+ });
453
  });
454
 
455
  /*Admin menu*/
456
  jQuery(document).ready(function(){
457
+ jQuery('#adminmenu').css('display','block');
458
  });
459
 
460
  /*FORM SUBMITTED*/
461
+ jQuery(document).ready(function(){
462
+ jQuery('#agca_form').submit(function(){
463
+ if(!savedCustomScripts){
464
+ saveCustomScripts();
465
+ return false;
466
+ }else{
467
+ processData();
468
+ return true;
469
+ }
470
+ });
471
+ });
472
+
473
+
474
+ function processData(){
475
+ /*Serialize checkboxes*/
476
+ var array = "{";
477
+ var firstElement = true;
478
+ var topMarker = "";
479
+ jQuery('#ag_edit_adminmenu :checkbox').each(function(){
480
+ if(firstElement != true){
481
+ array += ", ";
482
+ }
483
+ topMarker = "";
484
+ if(jQuery(this).parent().parent().hasClass('ag_admin_menu_parent')){
485
+ topMarker="<-TOP->";
486
+ }
487
+ array += "\"" + topMarker + jQuery(this).attr('class') + "\" : ";
488
+ array += "\"" + jQuery(this).attr('checked') + "\"";
489
+ firstElement = false;
490
+ });
491
+ array += "}|";
 
 
 
 
 
 
492
 
493
+ /*Serialize textboxes*/
494
+ array += "{";
495
+ firstElement = true;
496
+ jQuery('#ag_edit_adminmenu :text').each(function(){
497
+ if(firstElement != true){
498
+ array += ", ";
499
+ }
500
+ topMarker = "";
501
+ if(jQuery(this).parent().hasClass('ag_admin_menu_parent2')){
502
+ topMarker="<-TOP->";
503
+ }
504
+ array += "\"" + topMarker + jQuery(this).attr('class') + "\" : ";
505
+ array += "\"" + jQuery(this).val() + "\"";
506
+ firstElement = false;
507
+ });
508
+ array += "}";
 
 
 
 
 
 
 
 
 
 
509
 
510
+ if(afterFormClickCreateJson == true){
511
+ jQuery('#ag_edit_adminmenu_json').val(array);
512
+ }else{
513
+ jQuery('#ag_edit_adminmenu_json').val('');
514
+ }
515
+ //console.log(array);
516
+ //serialize buttons
517
+ array = "{";
518
+ var element = 0;
519
+ jQuery('#ag_add_adminmenu :button').each(function(){
520
+ //console.log(jQuery(this).html()+jQuery(this).attr('title'));
521
+ if(element > 0){
522
+ if(element > 1){
523
+ array += ", ";
524
+ }
525
+ array += "\"" + jQuery(this).html() + "\" : {";
526
+ array += " \"value\" : ";
527
+ array += "\"" + jQuery(this).attr('title') + "\"";
528
+ array += ", \"target\" : ";
529
+ array += "\"" + jQuery(this).attr('target') + "\"}";
530
+ }
531
+ element++;
532
+ });
533
+ array += "}";
534
+ if(element == 1){
535
+ array="";
536
+ }
537
+ jQuery('#ag_add_adminmenu_json').val(array);
538
 
539
+ /*Serialize colors*/
540
+ var array = "{";
541
+ var firstElement = true;
542
+ var topMarker = "";
543
+ jQuery('input.color_picker').each(function(){
544
+ if(firstElement != true){
545
+ array += ", ";
546
+ }
547
+ array += "\"" + jQuery(this).attr('id') + "\" : ";
548
+ array += "\"" + jQuery(this).val() + "\"";
549
+ firstElement = false;
550
+ });
551
+ array += "}";
552
+ if(!isSettingsImport){
553
+ jQuery('#ag_colorizer_json').val(array);
554
+ }
555
+ }
556
 
557
  /*C O L O R I Z E R*/
558
+ function updateTargetColor(id, color){
559
+ switch(id)
560
+ {
561
+ case 'color_background':
562
+ jQuery('html, .wp-dialog').css({
563
+ 'background-color':color
564
+ });
565
+ break;
566
+ case 'color_footer':
567
+ jQuery('#footer').css({
568
+ 'background':color
569
+ });
570
+ if(wpversion >= 3.2){
571
+ jQuery('#footer').css({
572
+ 'margin':'0',
573
+ 'margin-left':'146px',
574
+ 'padding':'15px'
575
+ });
576
+ }
577
+ break;
578
+ case 'color_header':
579
+ jQuery('#wphead').css({
580
+ 'background':color
581
+ });
582
+
583
+ //wp > 3.3
584
+ jQuery('#wpadminbar').css({'background':color});
585
+ jQuery('#wpadminbar .ab-top-menu').css({'background':color});
586
+
587
+ if(wpversion >= 3.2){
588
+ jQuery('#wphead').css({
589
+ 'margin':'0',
590
+ 'margin-left':'-14px',
591
+ 'padding-left':'15px'
592
+ });
593
+ jQuery("#backtoblog").attr("style","");
594
+ }
595
+ break;
596
+ case 'color_admin_menu_top_button_background':
597
+ jQuery('#adminmenu a.menu-top').css({
598
+ 'background':color
599
+ });
600
+ break;
601
+ case 'color_admin_menu_top_button_current_background':
602
+ jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
603
+ 'background':color
604
+ });
605
+ jQuery('#adminmenu li.menu-top.current a.menu-top').css({
606
+ 'background':color
607
+ });
608
+ break;
609
+ case 'color_admin_menu_top_button_hover_background':
610
+ if(color == "")break;
611
+ var selector = '#adminmenu a.menu-top';
612
+ var originalBackground = jQuery(selector).css('background-color');
613
+
614
+ //if first is selected, use second
615
+ if((jQuery(selector).hasClass('current') || jQuery(selector).hasClass('wp-has-current-submenu'))){
616
+ var originalBackground = jQuery('#adminmenu a.menu-top:eq(1)').css('background-color');
617
+ }
618
+
619
+ jQuery(selector).mouseover(function(){
620
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
621
+ jQuery(this).css({'background':color});
622
+ }
623
+
624
+ }).mouseout(function(){
625
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
626
+ jQuery(this).css('background',originalBackground);
627
+ }
628
+ });
629
+
630
+
631
+ break;
632
+ case 'color_admin_menu_submenu_background':
633
+ // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
634
+ jQuery('#adminmenu .wp-submenu.sub-open').remove();
635
+ jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
636
+ jQuery(this).css({
637
+ 'background':color
638
+ });
639
+ });
640
+ jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'5px','padding':'0px'});
641
+ //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
642
+ jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
643
+ jQuery('#adminmenu .wp-submenu ul').css('border','none');
644
+ jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
645
+
646
+ break;
647
+ case 'color_admin_submenu_font':
648
+ jQuery('#adminmenu .wp-submenu li a').css('color',color);
649
+ break;
650
+ case 'color_admin_menu_submenu_border_top':
651
+ jQuery('#adminmenu > li > a').css('border-top-color',color);
652
+ break;
653
+ case 'color_admin_menu_submenu_border_bottom':
654
+ jQuery('#adminmenu > li > a').css('border-bottom-color',color);
655
+ break;
656
+ case 'color_admin_menu_font':
657
+ jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
658
+ 'color':color
659
+ });
660
+ break;
661
+ case 'color_admin_menu_behind_background':
662
+ jQuery('#adminmenuback, #adminmenuwrap').css({
663
+ 'background-color':color
664
+ });
665
+ break;
666
+ case 'color_admin_menu_behind_border':
667
+ jQuery('#adminmenuback, #adminmenuwrap').css({
668
+ 'border-color':color
669
+ });
670
+ break;
671
+ case 'color_admin_menu_submenu_background_hover':
672
+ var submenuSelector = '#adminmenu .wp-submenu a';
673
+ var originalSubBackground = jQuery(submenuSelector).css('background-color');
674
+ jQuery(submenuSelector).mouseover(function(){
675
+ jQuery(this).css({
676
+ 'background':color
677
+ });
678
+ }).mouseout(function(){
679
+ jQuery(this).css('background',originalSubBackground);
680
+ });
681
+ //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
682
+ break;
683
+ case 'color_font_content':
684
+ jQuery('#wpbody-content, #wpbody-content label, #wpbody-content p,#wpbody-content .form-table th, #wpbody-content .form-wrap label').css({
685
+ 'color':color
686
+ });
687
+ break;
688
+ case 'color_font_header':
689
+ jQuery('#wphead, #wphead a, #wpadminbar a, #wpadminbar span').css({
690
+ 'color':color
691
+ });
692
+ break;
693
+ case 'color_font_footer':
694
+ jQuery('#footer, #footer a').css({
695
+ 'color':color
696
+ });
697
+ break;
698
+ case 'color_widget_bar':
699
+ jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
700
+ 'background' : color,
701
+ 'text-shadow' :'none'
702
+ });
703
+ break;
704
+ case 'color_widget_background':
705
+ jQuery(".widget, .postbox").css('background',color);
706
+ //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
707
+ break;
708
+ default:
709
+ }
710
  }
711
  function updateColor(id,color){
712
+ jQuery("#"+id).css({
713
+ 'background-color':color
714
+ });
715
+ jQuery("#"+id).val(color);
716
+ if(isDarker(color) == true){
717
+ jQuery("#"+id).css('color','#ffffff');
718
+ }else{
719
+ jQuery("#"+id).css('color','#000000');
720
+ }
721
+ updateTargetColor(id,color);
722
  }
723
  /*First load apply colours from fields*/
724
 
743
  });*/
744
  /*A J A X*/
745
  jQuery(document).ready(function(){
746
+
747
+ //Ams
748
+ if(typeof isAGCAPage !== 'undefined'){
749
+ if(isAGCAPage == true){
750
+ //alert('admin page');
751
+ var url="http://argonius.com/ag-custom-admin/ep/ads?jsoncallback=?";
752
+ jQuery.getJSON(
753
+ url,{
754
+ wp_ver: wpversion,
755
+ agca_ver: agca_version,
756
+ format: "json"
757
+ },
758
+ function(json){
759
+ jQuery.each(json,function(i,post){
760
+ jQuery('#agca_advertising ul').append('<li><a target="_blank" href="http://www.argonius.com/ag-custom-admin/ep/ad?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
761
+ });
762
+ jQuery('#agca_advertising').show();
763
+
764
+ });
765
+ }
766
+ }
767
+
768
+
769
+ //News
770
+ jQuery(document).ready(function(){
771
+ if(typeof isAGCAPage !== 'undefined'){
772
+ if(isAGCAPage == true){
773
 
774
+ }
775
+ }
776
+ var url="http://wordpress.argonius.com/agca/news.php/news?jsoncallback=?";
777
+ jQuery.getJSON(
778
+ url,{
779
+ wp_ver: wpversion,
780
+ agca_ver: agca_version,
781
+ format: "json"
782
+ },
783
+ function(json){
784
+ jQuery.each(json.posts,function(i,post){
785
+ jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
786
+ });
787
+ jQuery('#agca_news p').each(function(){
788
+ jQuery(this).hide();
789
+ });
790
+
791
+ });
792
+ });
793
+ setInterval(function() {
794
+ if(jQuery('#agca_news p.news_online').size() == 0){
795
+ jQuery('#agca_news p:first').addClass('news_online');
796
+ jQuery('#agca_news p:first').show();
797
+ }else{
798
+ var changed = false;
799
+ var finish = false;
800
+ jQuery('#agca_news p').each(function(){
801
+ if(finish != true){
802
+ if(changed == true){
803
+ jQuery(this).addClass('news_online');
804
+ jQuery(this).show();
805
+ finish = true;
806
+ }
807
+ else if(jQuery(this).hasClass('news_online')){
808
+ jQuery(this).hide();
809
+ jQuery(this).removeClass('news_online');
810
+ changed = true;
811
+ };
812
+ }
813
+ });
814
+ if(jQuery('#agca_news p.news_online').size() == 0){
815
+ jQuery('#agca_news p:first').addClass('news_online');
816
+ jQuery('#agca_news p:first').show();
817
+ }
818
+ }
819
+ }, 5000);
820
 
821
  });
822
  /*A J A X*/
823
 
824
  function isWPHigherOrEqualThan(targetVersion){
825
+ var versions = ["0.7",
826
+ "0.71",
827
+ "0.711",
828
+ "0.72",
829
+ "1.0",
830
+ "1.0.1",
831
+ "1.0.2",
832
+ "1.2",
833
+ "1.2.1",
834
+ "1.2.2",
835
+ "1.5",
836
+ "1.5.1",
837
+ "1.5.1.2",
838
+ "1.5.1.3",
839
+ "1.5.2",
840
+ "2.0",
841
+ "2.0.1",
842
+ "2.0.2",
843
+ "2.0.3",
844
+ "2.0.4",
845
+ "2.0.5",
846
+ "2.0.6",
847
+ "2.0.7",
848
+ "2.0.8",
849
+ "2.0.9",
850
+ "2.0.10",
851
+ "2.0.11",
852
+ "2.1",
853
+ "2.1.1",
854
+ "2.1.2",
855
+ "2.1.3",
856
+ "2.2",
857
+ "2.2.1",
858
+ "2.2.2",
859
+ "2.2.3",
860
+ "2.3",
861
+ "2.3.1",
862
+ "2.3.2",
863
+ "2.3.3",
864
+ "2.5",
865
+ "2.5.1",
866
+ "2.6",
867
+ "2.6.1",
868
+ "2.6.2",
869
+ "2.6.3",
870
+ "2.6.5",
871
+ "2.7",
872
+ "2.7.1",
873
+ "2.8",
874
+ "2.8.1",
875
+ "2.8.2",
876
+ "2.8.3",
877
+ "2.8.4",
878
+ "2.8.5",
879
+ "2.8.6",
880
+ "2.9",
881
+ "2.9.1",
882
+ "2.9.2",
883
+ "3.0",
884
+ "3.0.1",
885
+ "3.0.2",
886
+ "3.0.3",
887
+ "3.0.4",
888
+ "3.0.5",
889
+ "3.0.6",
890
+ "3.1",
891
+ "3.1.1",
892
+ "3.1.2",
893
+ "3.1.3",
894
+ "3.1.4",
895
+ "3.2",
896
+ "3.2.1",
897
+ "3.3",
898
+ "3.3.1",
899
+ "3.3.2",
900
+ "3.4",
901
+ "3.4.1",
902
+ "3.4.2",
903
+ "3.5"];
904
+ //remove sufixes, beta RC etc
905
+ if (wpversion.indexOf("-")!=-1){
906
+ var parts = wpversion.split("-");
907
+ wpversion = parts[0];
908
+ }
909
+ for(var i in versions){
910
+ if(versions[i] == targetVersion){
911
+ if(wpversion >= targetVersion) return true;
912
+ }
913
+ }
914
+ return false;
915
+ }
916
+
917
+
918
+ //VALIDATION
919
+ jQuery(document).ready(function() {
920
+ jQuery(".validateNumber").live('keydown',function(event) {
921
+ // Allow only backspace and delete
922
+ var limit = jQuery(this).attr('limit');
923
+ var value = jQuery(this).val();
924
+
925
+ if ( event.keyCode == 46 || event.keyCode == 8 ) {
926
+ } else {
927
+ if((typeof(limit) != undefined) && value.length >= limit){
928
+ return false;
929
+ }
930
+ if (event.keyCode < 95) {
931
+ if (event.keyCode < 48 || event.keyCode > 57 ) {
932
+ event.preventDefault();
933
+ }
934
+ } else {
935
+ if (event.keyCode < 96 || event.keyCode > 105 ) {
936
+ event.preventDefault();
937
+ }
938
+ }
939
+ }
940
+ });
941
+ });
style/ag_style.css CHANGED
@@ -105,4 +105,33 @@ td.ag_admin_menu_parent:hover{
105
  }
106
  #agca_news a{
107
  color:green;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  }
105
  }
106
  #agca_news a{
107
  color:green;
108
+ }
109
+ #agca_advertising{
110
+ display:block;
111
+ width:100%;
112
+ height: 100px;
113
+ /*background-color: #cccccc;*/
114
+ padding: 0;
115
+ margin: 0;
116
+ }
117
+ #agca_advertising ul{
118
+ padding: 0;
119
+ margin: 0;
120
+ padding-right:5px;
121
+ }
122
+ #agca_advertising > ul > li{
123
+ float:left;
124
+ margin-right: 6px;
125
+ cursor: pointer;
126
+ }
127
+ #agca_form{
128
+ min-width: 835px;/*used for agca menu lineup*/
129
+ }
130
+ .ag-custom-button{
131
+
132
+ /* margin-bottom:-4px !important;*/
133
+ }
134
+ #sidebar_adminmenu_logo{
135
+ margin-bottom: -33px;
136
+ min-height: 28px;
137
  }