Absolutely Glamorous Custom Admin - Version 1.4.6

Version Description

  • Removed obsolete Colorizer's border options
  • Removed obsolete code
  • Changed some options labels/descriptions
  • Handling user's errors caused by mistake in Custom JS
  • Removed first and second menu item separator options, replaced with remove all separators option
Download this release

Release Info

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

Code changes from version 1.4.5 to 1.4.6

Files changed (3) hide show
  1. plugin.php +121 -349
  2. readme.txt +11 -1
  3. script/ag_script.js +6 -125
plugin.php CHANGED
@@ -4,10 +4,10 @@ Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: Argonius
7
- Version: 1.4.5
8
  Author URI: http://www.argonius.com/
9
 
10
- Copyright 2014. Argonius (email : info@argonius.com)
11
 
12
  This program is free software: you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License as published by
@@ -56,7 +56,7 @@ class AGCA{
56
  /*Initialize properties*/
57
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
58
 
59
- $this->agca_version = "1.4.5";
60
 
61
  /*upload images programmaticaly*/
62
  //TODO upload with AJAX one by one, use post data to send urls one by one
@@ -313,9 +313,12 @@ class AGCA{
313
  ?>
314
  </style>
315
  <script type="text/javascript">
316
- <?php
317
- echo get_option('agca_custom_js');
318
- ?>
 
 
 
319
  </script>
320
  <?php
321
  }
@@ -410,8 +413,7 @@ class AGCA{
410
  /*Admin menu*/
411
  register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
412
  register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
413
- register_setting( 'agca-options-group', 'agca_admin_menu_separator_first' );
414
- register_setting( 'agca-options-group', 'agca_admin_menu_separator_second' );
415
  register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
416
  register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
417
  register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
@@ -528,8 +530,7 @@ class AGCA{
528
  'agca_remove_top_bar_dropdowns',
529
  'agca_admin_menu_turnonoff',
530
  'agca_admin_menu_agca_button_only',
531
- 'agca_admin_menu_separator_first',
532
- 'agca_admin_menu_separator_second',
533
  'agca_admin_menu_icons',
534
  'agca_admin_menu_arrow',
535
  'agca_admin_menu_submenu_round',
@@ -850,60 +851,43 @@ class AGCA{
850
  }
851
 
852
  function print_admin_bar_scripts(){
853
- ?>
854
- if(isWPHigherOrEqualThan("3.3")){
855
- <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
856
-
857
-
858
- //remove on site page
859
  jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
860
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
861
-
862
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
863
-
864
-
865
- var abitemSelector = "#wpadminbar .ab-top-menu > li.menupop > .ab-item";
866
- var originalBkg = jQuery(abitemSelector).css('background');
867
- var originalColor = jQuery(abitemSelector).css('color');
868
- jQuery(abitemSelector).mouseover(function(){
869
- jQuery(this).css({'background':'#222222','color':'#fafafa'});
870
- }).mouseout(function(){
871
- jQuery(this).css({'background':originalBkg,'color':originalColor});
872
- });
873
 
874
  <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
875
  jQuery(".new_content_header_submenu").hide();
876
  <?php } ?>
877
 
878
- <?php } ?>
879
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
880
 
881
- if(isWPHigherOrEqualThan("3.3")){
882
- <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
883
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
884
- <?php } ?>
885
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
886
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
887
- <?php } ?>
888
- <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
889
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
890
- <?php } ?>
891
- <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
892
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
893
- <?php } ?>
894
- <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
895
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
896
- <?php } ?>
897
- <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
898
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
899
- <?php } ?>
900
- <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
901
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
902
- <?php } ?>
903
- <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
904
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
905
- <?php } ?>
906
- }
907
 
908
 
909
  <?php if(get_option('agca_header_logo')==true){ ?>
@@ -912,30 +896,14 @@ class AGCA{
912
 
913
  <?php } ?>
914
  <?php if(get_option('agca_header_logo_custom')!=""){ ?>
 
 
915
 
916
-
917
- if(isWPHigherOrEqualThan("3.3")){
918
- var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
919
-
920
- advanced_url = img_url;
921
- image = jQuery("<img />").attr("src",advanced_url);
922
- jQuery(image).load(function() {
923
- jQuery("#wpbody-content").prepend(image);
924
- });
925
- }else{
926
- jQuery("#wphead img#header-logo").attr('src','');
927
- jQuery("#wphead img#header-logo").hide();
928
- var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
929
- advanced_url = img_url+ "?" + new Date().getTime();
930
- image = jQuery("<img />").attr("src",advanced_url);
931
- jQuery(image).load(function() {
932
- jQuery("#wphead img#header-logo").attr('src', advanced_url);
933
- jQuery("#wphead img#header-logo").attr('width',this.width);
934
- jQuery("#wphead img#header-logo").attr('height',this.height);
935
- jQuery("#wphead").css('height', (14 + this.height)+'px');
936
- jQuery("#wphead img#header-logo").show();
937
- });
938
- }
939
 
940
  <?php } ?>
941
  <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
@@ -950,29 +918,26 @@ class AGCA{
950
  jQuery("#wp-admin-bar-site-name").css("display","none");
951
 
952
  <?php } ?>
953
- <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
954
- if(isWPHigherOrEqualThan("3.3")){
955
- var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
956
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
957
- if(href == "%SWITCH%"){
958
- href = "<?php echo get_bloginfo('wpurl'); ?>";
959
- <?php if($this->context == "page"){
960
- ?>href+="/wp-admin";<?php
961
- }
962
- ?>
963
- }
964
- jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
965
- }
966
  <?php }?>
967
  <?php if(get_option('agca_site_heading')==true){ ?>
968
  jQuery("#wphead #site-heading").css("display","none");
969
  <?php } ?>
970
  <?php if(get_option('agca_custom_site_heading')!=""){ ?>
971
  jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
972
- //3.3FIX
973
- if(isWPHigherOrEqualThan("3.3")){
974
- jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
975
- }
976
  <?php } ?>
977
  <?php if(get_option('agca_header')==true && $this->context =='admin'){
978
  ?>
@@ -985,68 +950,22 @@ class AGCA{
985
  <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
986
  <?php
987
  $agca_logout_text = ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout'));
988
- ?>
989
- if(isWPHigherOrEqualThan("3.3")){
990
  jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
991
- }else{
992
- var clon ="";
993
- jQuery("div#user_info a").each(function(){
994
- if(jQuery(this).text() =="Log Out"){
995
- clon = jQuery(this).clone();
996
- }
997
- });
998
- if(clon !=""){
999
- jQuery(clon).attr('style','float:right;padding:15px');
1000
- jQuery(clon).html('<?php echo $agca_logout_text; ?>');
1001
- }
1002
- jQuery("#wphead").after(clon);
1003
- }
1004
 
1005
  <?php } ?>
1006
- <?php if(get_option('agca_howdy')!=""){ ?>
1007
- if(isWPHigherOrEqualThan("3.5")){
1008
- var alltext="";
1009
- alltext="";
1010
- jQuery('li#wp-admin-bar-my-account').css('cursor','default');
1011
- alltext = jQuery('li#wp-admin-bar-my-account').html();
1012
- if(alltext!=null){
1013
- var parts = alltext.split(',');
1014
- alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
1015
- }
1016
- jQuery("li#wp-admin-bar-my-account").html("<a href=\"#\" class=\"ab-item\">"+alltext+"</a>");
1017
- }else if(isWPHigherOrEqualThan("3.3")){
1018
- var alltext="";
1019
- alltext="";
1020
- jQuery('li#wp-admin-bar-my-account').css('cursor','default');
1021
- alltext = jQuery('li#wp-admin-bar-my-account').html();
1022
- if(alltext!=null){
1023
- var parts = alltext.split(',');
1024
- alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
1025
- }
1026
- jQuery("li#wp-admin-bar-my-account").html(alltext);
1027
- }else if(isWPHigherOrEqualThan("3.2")){
1028
- var alltext="";
1029
- alltext="";
1030
- alltext = jQuery('#user_info div.hide-if-no-js').html();
1031
- if(alltext!=null){
1032
- var parts = alltext.split(',');
1033
- alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
1034
- }
1035
- jQuery("#user_info div.hide-if-no-js").html(alltext);
1036
-
1037
- }else{
1038
- var howdyText = jQuery("#user_info").html();
1039
- if(howdyText !=null){
1040
- jQuery("#user_info").html("<p>"+"<?php echo get_option('agca_howdy'); ?>"+howdyText.substr(9));
1041
- }
1042
- }
1043
- if(isWPHigherOrEqualThan("3.5")){
1044
- //jQuery("#wp-admin-bar-my-account").css("padding-left","10px");
1045
- //jQuery("#wp-admin-bar-my-account").css("padding-right","10px");
1046
- //jQuery("#wp-admin-bar-my-account img").css({"margin-left":"5px","margin-bottom":"-4px"});
1047
-
1048
- }
1049
-
1050
  <?php } ?>
1051
  <?php
1052
  if(get_option('agca_custom_title')!=""){
@@ -1054,44 +973,20 @@ class AGCA{
1054
 
1055
  }
1056
  ?>
1057
- <?php if(get_option('agca_logout')!=""){ ?>
1058
- if(isWPHigherOrEqualThan("3.3")){
1059
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1060
- }else if(isWPHigherOrEqualThan("3.2")){
1061
- jQuery("#user_info #user_info_links a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
1062
- }else{
1063
- jQuery("#user_info a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
1064
- }
1065
-
1066
  <?php } ?>
1067
- <?php if(get_option('agca_remove_your_profile')==true){ ?>
1068
- if(isWPHigherOrEqualThan("3.3")){
1069
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1070
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1071
- jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1072
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1073
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1074
-
1075
- }else if(isWPHigherOrEqualThan("3.2")){
1076
- jQuery("#user_info #user_info_links li:eq(0)").remove();
1077
- }
1078
  <?php } ?>
1079
- <?php if(get_option('agca_logout_only')==true){ ?>
1080
- if(isWPHigherOrEqualThan("3.3")){
1081
- var logout_content = jQuery("li#wp-admin-bar-logout").html();
1082
- jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
1083
- }else if(isWPHigherOrEqualThan("3.2")){
1084
- var logoutText = jQuery("#user_info a:nth-child(2)").text();
1085
- <?php if(get_option('agca_logout')!=""){ ?>
1086
- logoutText = "<?php echo get_option('agca_logout'); ?>";
1087
- <?php } ?>
1088
- var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
1089
- jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
1090
- }else{
1091
- var logoutText = jQuery("#user_info a:nth-child(2)").text();
1092
- var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
1093
- jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
1094
- }
1095
  <?php } ?>
1096
 
1097
  <?php
@@ -1415,12 +1310,8 @@ try
1415
  ?>
1416
  <?php } else{ ?>
1417
  <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1418
- additionalStyles = "";
1419
- if(isWPHigherOrEqualThan("3.4")){
1420
- additionalStyles = ' style="margin-bottom:-4px" ';
1421
- }
1422
- jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1423
-
1424
  <?php } ?>
1425
  <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1426
 
@@ -1450,8 +1341,7 @@ try
1450
  jQuery("body").removeClass("auto-fold");
1451
  <?php } ?>
1452
 
1453
- <?php $this->print_admin_bar_scripts(); ?>
1454
-
1455
 
1456
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
1457
  jQuery("#screen-options-link-wrap").css("display","none");
@@ -1465,10 +1355,7 @@ try
1465
  <?php } ?>
1466
  <?php if(get_option('agca_privacy_options')==true){ ?>
1467
  jQuery("#privacy-on-link").css("display","none");
1468
- <?php } ?>
1469
-
1470
-
1471
-
1472
 
1473
  <?php if(get_option('agca_update_bar')==true){ ?>
1474
  <?php
@@ -1486,9 +1373,7 @@ try
1486
  <?php if(get_option('agca_footer')==true){ ?>
1487
  jQuery("#footer,#wpfooter").css("display","none");
1488
  <?php } ?>
1489
-
1490
-
1491
-
1492
  <?php if(get_option('agca_footer_left')!=""){ ?>
1493
  jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1494
  <?php } ?>
@@ -1571,18 +1456,12 @@ try
1571
  ?>jQuery("#dashboard_activity").css("display","block");<?php
1572
  }
1573
 
1574
- ?>
1575
 
1576
-
1577
-
1578
- <?php /*ADMIN MENU*/ ?>
1579
-
1580
 
1581
- <?php if(get_option('agca_admin_menu_separator_first')==true){ ?>
1582
- jQuery("li.wp-menu-separator").eq(0).css("display","none");
1583
- <?php } ?>
1584
- <?php if(get_option('agca_admin_menu_separator_second')==true){ ?>
1585
- jQuery("li.wp-menu-separator").eq(1).css("display","none");
1586
  <?php } ?>
1587
  <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1588
  jQuery(".wp-menu-image").each(function(){
@@ -1596,9 +1475,7 @@ try
1596
  <?php } ?>
1597
  <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1598
 
1599
- <?php /*If Turned on*/ ?>
1600
-
1601
-
1602
 
1603
  <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1604
  jQuery('#adminmenu > li').each(function(){
@@ -1699,7 +1576,6 @@ try
1699
  /*Add user buttons*/
1700
  jQuery('#adminmenu').append(buttons);
1701
 
1702
-
1703
  <?php /*END If Turned on*/ ?>
1704
  <?php } else{ ?>
1705
  jQuery("#adminmenu").removeClass("noclass");
@@ -1712,8 +1588,6 @@ try
1712
  jQuery('#adminmenu').append('<li class="hide-if-no-js" onclick="window.setTimeout(function(){updateAllColors();},10);" id="collapse-menu"><div id="collapse-button"><div></div></div><span>Collapse menu</span></li>');
1713
  <?php } ?>
1714
 
1715
-
1716
-
1717
  <?php //COLORIZER ?>
1718
  updateAllColors();
1719
  <?php //COLORIZER END ?>
@@ -1917,7 +1791,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1917
  <table>
1918
  <tr valign="left" >
1919
  <th scope="row">
1920
- <label title="If checked, all users will be affected with these changes, except admin. Not checked = apply for all</br></br><strong>Q</strong>: Who is administrator?</br><strong>A</strong>: Go to <i>Advanced</i> tab and change capability option to define admin users." for="agca_role_allbutadmin">Do not apply customizations for Administrator&nbsp;&nbsp;</label>
1921
  </th>
1922
  <td><input class="agca-checkbox" title="If checked, all users will be affected with these changes, except admin. Not checked = apply for all" type="checkbox" name="agca_role_allbutadmin" value="true" <?php if (get_option('agca_role_allbutadmin')==true) echo 'checked="checked" '; echo get_option('agca_role_allbutadmin'); ?> />
1923
  </td>
@@ -1947,17 +1821,17 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1947
  </div>
1948
  <div style="clear:both"></div>
1949
  <div id="section_admin_bar" class="ag_section">
1950
- <h2 class="section_title" tabindex="-1">Admin Bar Settings Page</h2>
1951
  <br />
1952
- <p tabindex="0"><i><strong>Info: </strong>Move your mouse over option labels for more information about an option</i></p>
1953
  <br />
1954
  <table class="form-table" width="500px">
1955
  <tr valign="center" class="ag_table_major_options" >
1956
  <td>
1957
- <label tabindex="0" title="Hide admin bar with all elements on the top of the admin page" for="agca_header"><strong>Hide admin bar completely</strong></label>
1958
  </td>
1959
  <td>
1960
- <input id="agca_header" class="agca-checkbox" type="checkbox" onchange="if(jQuery('#agca_header').is(':checked')){jQuery('#agca_header_show_logout_content').show('slide');}else{jQuery('#agca_header_show_logout_content').hide('slide');};" title="Hide admin bar with all elements on the top of the admin page" name="agca_header" value="true" <?php if (get_option('agca_header')==true) echo 'checked="checked" '; ?> />
1961
  </td>
1962
  </tr>
1963
 
@@ -1969,18 +1843,18 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1969
  ?>
1970
  <tr valign="center" class="ag_table_major_options" id="agca_header_show_logout_content" <?php echo $agca_header_show_logout_style; ?> >
1971
  <td>
1972
- <label tabindex="0" title='Check this if you want to show Log Out button in top right corner of admin page' for="agca_header_show_logout"><strong>(but show Log Out button)</strong></label>
1973
  </td>
1974
  <td>
1975
- <input type="checkbox" class="agca-checkbox" title='Check this if you want to show Log Out button in top right corner of admin page' name="agca_header_show_logout" value="true" <?php if ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)) echo 'checked="checked" '; ?> />
1976
  </td>
1977
  </tr>
1978
  <tr valign="center" >
1979
  <td>
1980
- <label tabindex="0" title="Removes admin bar customizations (AGCA scripts) on front end." for="agca_admin_bar_frontend">Remove admin bar customizations on site pages</label>
1981
  </td>
1982
  <td>
1983
- <input style="margin-left:-5px" class="agca-checkbox" id="agca_admin_bar_frontend" type="checkbox" title="Removes admin bar customizations (AGCA scripts) on front end." name="agca_admin_bar_frontend" value="true" <?php if (get_option('agca_admin_bar_frontend')==true) echo 'checked="checked" '; ?> />
1984
 
1985
  </td>
1986
  </tr>
@@ -1997,17 +1871,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1997
  <div class="ag_table_heading"><h3 tabindex="0">On the Left</h3></div>
1998
  </td>
1999
  <td></td>
2000
- </tr>
2001
- <?php if($wpversion<3.3){?>
2002
- <tr valign="center">
2003
- <th >
2004
- <label title="This is link next to heading in admin bar" for="agca_privacy_options">Hide Privacy link</label>
2005
- </th>
2006
- <td>
2007
- <input class="agca-checkbox" type="checkbox" title="This is link next to heading in admin bar" name="agca_privacy_options" value="true" <?php if (get_option('agca_privacy_options')==true) echo 'checked="checked" '; ?> />
2008
- </td>
2009
- </tr>
2010
- <?php } ?>
2011
  <tr valign="center">
2012
  <th >
2013
  <label title="Change default WordPress logo with custom image." for="agca_wp_logo_custom">Change admin bar logo</label>
@@ -2051,8 +1915,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2051
  <td>
2052
  <input class="agca-checkbox" title="Small Wordpress logo in admin top bar" type="checkbox" name="agca_header_logo" value="true" <?php if (get_option('agca_header_logo')==true) echo 'checked="checked" '; ?> />
2053
  </td>
2054
- </tr>
2055
- <?php if($wpversion>=3.3){?>
2056
  <tr valign="center">
2057
  <th >
2058
  <label title="Hides site name section in admin bar" for="agca_remove_site_link">Hide site name in admin bar</label>
@@ -2132,9 +1995,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2132
  <td>
2133
  <input class="agca-checkbox" title="Removes update notifications from admin bar" type="checkbox" name="agca_admin_bar_update_notifications" value="true" <?php if (get_option('agca_admin_bar_update_notifications')==true) echo 'checked="checked" '; ?> />
2134
  </td>
2135
- </tr>
2136
- <?php } ?>
2137
-
2138
  <tr valign="center">
2139
  <th scope="row">
2140
  <label title="Adds custom text in admin top bar. Default Wordpress heading stays intact." for="agca_custom_site_heading">Custom blog heading</label>
@@ -2151,18 +2012,6 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2151
  <input class="agca-checkbox" title="Hides yellow bar with notifications for new Wordpress release" type="checkbox" name="agca_update_bar" value="true" <?php if (get_option('agca_update_bar')==true) echo 'checked="checked" '; ?> />
2152
  </td>
2153
  </tr>
2154
-
2155
- <?php if($wpversion<3.3){ ?>
2156
- <tr valign="center">
2157
- <th scope="row">
2158
- <label for="agca_site_heading">Hide default blog heading</label>
2159
- </th>
2160
- <td>
2161
- <input class="agca-checkbox" type="checkbox" name="agca_site_heading" value="true" <?php if (get_option('agca_site_heading')==true) echo 'checked="checked" '; ?> />
2162
- </td>
2163
- </tr>
2164
- <?php } ?>
2165
-
2166
  <tr valign="center">
2167
  <td colspan="2">
2168
  <div class="ag_table_heading"><h3 tabindex="0">On the Right</h3></div>
@@ -2205,23 +2054,15 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2205
  <label title="Put 'Exit', for example" for="agca_logout">Change Log out text</label>
2206
  </th>
2207
  <td><input title="Put 'Exit', for example" type="text" size="47" name="agca_logout" value="<?php echo get_option('agca_logout'); ?>" /></td>
2208
- </tr>
2209
- <?php if($wpversion >= 3.2){ ?>
2210
- <?php
2211
- $profile_text = 'Remove "Your profile" option from dropdown menu';
2212
- if($wpversion >= 3.3){
2213
- $profile_text = 'Remove "Edit My Profile" option from dropdown menu';
2214
- }
2215
- ?>
2216
  <tr valign="center">
2217
  <th scope="row">
2218
- <label for="agca_remove_your_profile"><?php echo $profile_text; ?></label>
2219
  </th>
2220
  <td>
2221
  <input class="agca-checkbox" type="checkbox" name="agca_remove_your_profile" value="true" <?php if (get_option('agca_remove_your_profile')==true) echo 'checked="checked" '; ?> />
2222
  </td>
2223
- </tr>
2224
- <?php } ?>
2225
  <tr valign="center">
2226
  <th scope="row">
2227
  <label title="If selected, hides all elements in top right corner, except Log Out button" for="agca_logout_only">Log out only</label>
@@ -2234,7 +2075,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2234
  </div>
2235
 
2236
  <div id="section_admin_footer" style="display:none" class="ag_section">
2237
- <h2 class="section_title" tabindex="-1">Admin Footer Settings Page</h2>
2238
  <br /><br />
2239
  <table class="form-table" width="500px">
2240
  <tr valign="center" class="ag_table_major_options">
@@ -2294,15 +2135,6 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2294
  </td>
2295
  <td></td>
2296
  </tr>
2297
- <!--<tr valign="center">
2298
- <th scope="row">
2299
- <label title="This is small 'house' icon next to main heading (Dashboard text by default) on Dashboard page" for="agca_dashboard_icon">Hide Dashboard heading icon</label>
2300
- </th>
2301
- <td>
2302
- <input class="agca-checkbox" title="This is small house icon next to main heading on Dashboard page. Dashboard text is shown by default" type="checkbox" name="agca_dashboard_icon" value="true" <?php if (get_option('agca_dashboard_icon')==true) echo 'checked="checked" '; ?> />
2303
- </td>
2304
- </tr>-->
2305
-
2306
  <tr valign="center">
2307
  <th scope="row">
2308
  <label title="Main heading ('Dashboard') on Dashboard page" for="agca_dashboard_text">Change Dashboard heading text</label>
@@ -2342,23 +2174,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2342
  <td>
2343
  <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_activity" value="true" <?php if (get_option('agca_dashboard_widget_activity')==true) echo 'checked="checked" '; ?> />
2344
  </td>
2345
- </tr>
2346
- <!--<tr valign="center">
2347
- <th scope="row">
2348
- <label for="agca_dashboard_widget_il">Hide "Incoming Links"</label>
2349
- </th>
2350
- <td>
2351
- <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_il" value="true" <?php if (get_option('agca_dashboard_widget_il')==true) echo 'checked="checked" '; ?> />
2352
- </td>
2353
- </tr>-->
2354
- <!--<tr valign="center">
2355
- <th scope="row">
2356
- <label for="agca_dashboard_widget_plugins">Hide "Plugins"</label>
2357
- </th>
2358
- <td>
2359
- <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_plugins" value="true" <?php if (get_option('agca_dashboard_widget_plugins')==true) echo 'checked="checked" '; ?> />
2360
- </td>
2361
- </tr> -->
2362
  <tr valign="center">
2363
  <th scope="row">
2364
  <label for="agca_dashboard_widget_qp">Hide "Quick Draft"</label>
@@ -2374,15 +2190,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2374
  <td>
2375
  <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_rn" value="true" <?php if (get_option('agca_dashboard_widget_rn')==true) echo 'checked="checked" '; ?> />
2376
  </td>
2377
- </tr>
2378
- <!--<tr valign="center">
2379
- <th scope="row">
2380
- <label for="agca_dashboard_widget_rd">Hide "Recent Drafts"</label>
2381
- </th>
2382
- <td>
2383
- <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_rd" value="true" <?php if (get_option('agca_dashboard_widget_rd')==true) echo 'checked="checked" '; ?> />
2384
- </td>
2385
- </tr> -->
2386
  <tr valign="center">
2387
  <th scope="row">
2388
  <label title="This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions" for="agca_dashboard_widget_primary">Hide "WordPress News" widget</label>
@@ -2506,7 +2314,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2506
  /*ADMIN MENU*/
2507
  ?>
2508
  <div id="section_admin_menu" style="display:none" class="ag_section">
2509
- <h2 class="section_title" tabindex="-1">Admin Menu Settings Page</h2>
2510
  <br />
2511
  <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 <strong>Reset Settings</strong> button to restore default values if anything goes wrong.</p>
2512
  <p style="font-style:italic" tabindex="0"><strong></strong>If you found that admin menu items are misaligned or not correct, press <strong>Reset Settings</strong> button. This happens if admin menu is changed by other plugins, or after activating / deactivating other plugings. Avoid such changes after you apply admin menu customizations.</p>
@@ -2544,20 +2352,13 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2544
  </tr>
2545
  <tr valign="center">
2546
  <th scope="row">
2547
- <label title="This is blank space between Dashboard and Posts button (by default)" for="agca_admin_menu_separator_first">Remove first menu items separator</label>
2548
  </th>
2549
  <td>
2550
- <input class="agca-checkbox" 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" '; ?> />
2551
  </td>
2552
- </tr>
2553
- <tr valign="center">
2554
- <th scope="row">
2555
- <label title="This is blank space separator between Comments and Appearance button (by default)" for="agca_admin_menu_separator_second">Remove second menu items separator</label>
2556
- </th>
2557
- <td>
2558
- <input class="agca-checkbox" 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" '; ?> />
2559
- </td>
2560
- </tr>
2561
  <tr valign="center">
2562
  <th scope="row">
2563
  <label title="Removes small icons on admin menu buttons" for="agca_admin_menu_icons">Remove menu icons</label>
@@ -2735,20 +2536,6 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2735
  <input type="button" alt="color_admin_menu_top_button_hover_background" class="pick_color_button_clear agca_button" value="Clear" />
2736
  </td>
2737
  </tr>
2738
- <tr valign="center">
2739
- <th><label title="Change button top border color" for="color_admin_menu_submenu_border_top">Button border top color:</label></th>
2740
- <td><input type="text" id="color_admin_menu_submenu_border_top" name="color_admin_menu_submenu_border_top" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_border_top'); ?>" />
2741
- <input type="button" alt="color_admin_menu_submenu_border_top" class="pick_color_button agca_button" value="Pick color" />
2742
- <input type="button" alt="color_admin_menu_submenu_border_top" class="pick_color_button_clear agca_button" value="Clear" />
2743
- </td>
2744
- </tr>
2745
- <tr valign="center">
2746
- <th><label title="Change button bottom border color" for="color_admin_menu_submenu_border_bottom">Button border bottom color:</label></th>
2747
- <td><input type="text" id="color_admin_menu_submenu_border_bottom" name="color_admin_menu_submenu_border_bottom" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_border_bottom'); ?>" />
2748
- <input type="button" alt="color_admin_menu_submenu_border_bottom" class="pick_color_button agca_button" value="Pick color" />
2749
- <input type="button" alt="color_admin_menu_submenu_border_bottom" class="pick_color_button_clear agca_button" value="Clear" />
2750
- </td>
2751
- </tr>
2752
  <tr valign="center">
2753
  <th><label title="Change submenu item background color" for="color_admin_menu_submenu_background">Submenu button background color:</label></th>
2754
  <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_background'); ?>" />
@@ -2769,8 +2556,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2769
  <input type="button" alt="color_admin_submenu_font" class="pick_color_button agca_button" value="Pick color" />
2770
  <input type="button" alt="color_admin_submenu_font" class="pick_color_button_clear agca_button" value="Clear" />
2771
  </td>
2772
- </tr>
2773
- <?php if($wpversion >= 3.2) { ?>
2774
  <tr valign="center">
2775
  <th><label title="Change background color of element behind admin menu" for="color_admin_menu_behind_background">Wrapper background color:</label></th>
2776
  <td><input type="text" id="color_admin_menu_behind_background" name="color_admin_menu_behind_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_behind_background'); ?>" />
@@ -2778,20 +2564,6 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2778
  <input type="button" alt="color_admin_menu_behind_background" class="pick_color_button_clear agca_button" value="Clear" />
2779
  </td>
2780
  </tr>
2781
- <tr valign="center">
2782
- <th><label title="Change border color of element behind admin menu" for="color_admin_menu_behind_border">Wrapper border color:</label></th>
2783
- <td><input type="text" id="color_admin_menu_behind_border" name="color_admin_menu_behind_border" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_behind_border'); ?>" />
2784
- <input type="button" alt="color_admin_menu_behind_border" class="pick_color_button agca_button" value="Pick color" />
2785
- <input type="button" alt="color_admin_menu_behind_border" class="pick_color_button_clear agca_button" value="Clear" />
2786
- </td>
2787
- </tr>
2788
- <?php } ?>
2789
- <!--<tr valign="center">
2790
- <th><label title="Change background submenu color on mouse over in admin menu" for="color_admin_menu_submenu_background_over">Submenu button background (Mouse over):</label></th>
2791
- <td><input type="text" id="color_admin_menu_submenu_background_over" name="color_admin_menu_submenu_background_over" class="color_picker" value="#123456" />
2792
- <input type="button" alt="color_admin_menu_submenu_background_over" class="pick_color_button" value="Pick color" />
2793
- </td>
2794
- </tr>-->
2795
  <tr valign="center">
2796
  <td colspan="2">
2797
  <div class="ag_table_heading"><h3 tabindex="0">Font Color Options</h3></div>
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: Argonius
7
+ Version: 1.4.6
8
  Author URI: http://www.argonius.com/
9
 
10
+ Copyright 2015. Argonius (email : info@argonius.com)
11
 
12
  This program is free software: you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License as published by
56
  /*Initialize properties*/
57
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
58
 
59
+ $this->agca_version = "1.4.6";
60
 
61
  /*upload images programmaticaly*/
62
  //TODO upload with AJAX one by one, use post data to send urls one by one
313
  ?>
314
  </style>
315
  <script type="text/javascript">
316
+ try{
317
+ eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
318
+ }catch(e){
319
+ alert('AG CUSTOM ADMIN : There is an error in your custom JS script. Please fix it: \n\n' + e + '\n\n (AG CUSTOM ADMIN -> Advanced -> Custom JavaScript)');
320
+ console.log(e);
321
+ }
322
  </script>
323
  <?php
324
  }
413
  /*Admin menu*/
414
  register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
415
  register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
416
+ register_setting( 'agca-options-group', 'agca_admin_menu_separators' );
 
417
  register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
418
  register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
419
  register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
530
  'agca_remove_top_bar_dropdowns',
531
  'agca_admin_menu_turnonoff',
532
  'agca_admin_menu_agca_button_only',
533
+ 'agca_admin_menu_separators',
 
534
  'agca_admin_menu_icons',
535
  'agca_admin_menu_arrow',
536
  'agca_admin_menu_submenu_round',
851
  }
852
 
853
  function print_admin_bar_scripts(){
854
+ ?>
855
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
 
 
 
 
856
  jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
857
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
858
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
 
 
 
 
 
 
 
 
 
 
 
859
 
860
  <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
861
  jQuery(".new_content_header_submenu").hide();
862
  <?php } ?>
863
 
864
+ <?php } ?>
865
+
866
+ <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
867
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
868
+ <?php } ?>
869
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
870
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
871
+ <?php } ?>
872
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
873
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
874
+ <?php } ?>
875
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
876
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
877
+ <?php } ?>
878
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
879
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
880
+ <?php } ?>
881
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
882
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
883
+ <?php } ?>
884
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
885
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
886
+ <?php } ?>
887
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
888
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
889
+ <?php } ?>
890
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
 
892
 
893
  <?php if(get_option('agca_header_logo')==true){ ?>
896
 
897
  <?php } ?>
898
  <?php if(get_option('agca_header_logo_custom')!=""){ ?>
899
+
900
+ var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
901
 
902
+ advanced_url = img_url;
903
+ image = jQuery("<img />").attr("src",advanced_url);
904
+ jQuery(image).load(function() {
905
+ jQuery("#wpbody-content").prepend(image);
906
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
907
 
908
  <?php } ?>
909
  <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
918
  jQuery("#wp-admin-bar-site-name").css("display","none");
919
 
920
  <?php } ?>
921
+ <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
922
+ var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
923
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
924
+ if(href == "%SWITCH%"){
925
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
926
+ <?php if($this->context == "page"){
927
+ ?>href+="/wp-admin";<?php
928
+ }
929
+ ?>
930
+ }
931
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
932
+
 
933
  <?php }?>
934
  <?php if(get_option('agca_site_heading')==true){ ?>
935
  jQuery("#wphead #site-heading").css("display","none");
936
  <?php } ?>
937
  <?php if(get_option('agca_custom_site_heading')!=""){ ?>
938
  jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
939
+ jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
940
+
 
 
941
  <?php } ?>
942
  <?php if(get_option('agca_header')==true && $this->context =='admin'){
943
  ?>
950
  <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
951
  <?php
952
  $agca_logout_text = ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout'));
953
+ ?>
 
954
  jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
955
+
 
 
 
 
 
 
 
 
 
 
 
 
956
 
957
  <?php } ?>
958
+ <?php if(get_option('agca_howdy')!=""){ ?>
959
+ var alltext="";
960
+ alltext="";
961
+ jQuery('li#wp-admin-bar-my-account').css('cursor','default');
962
+ alltext = jQuery('li#wp-admin-bar-my-account').html();
963
+ if(alltext!=null){
964
+ var parts = alltext.split(',');
965
+ alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
966
+ }
967
+ jQuery("li#wp-admin-bar-my-account").html("<a href=\"#\" class=\"ab-item\">"+alltext+"</a>");
968
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
969
  <?php } ?>
970
  <?php
971
  if(get_option('agca_custom_title')!=""){
973
 
974
  }
975
  ?>
976
+ <?php if(get_option('agca_logout')!=""){ ?>
977
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
 
 
 
 
 
 
 
978
  <?php } ?>
979
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
980
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
981
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
982
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
983
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
984
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
 
 
 
 
 
985
  <?php } ?>
986
+ <?php if(get_option('agca_logout_only')==true){ ?>
987
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
988
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
989
+
 
 
 
 
 
 
 
 
 
 
 
 
990
  <?php } ?>
991
 
992
  <?php
1310
  ?>
1311
  <?php } else{ ?>
1312
  <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1313
+ additionalStyles = ' style="margin-bottom:-4px" ';
1314
+ jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
 
 
 
 
1315
  <?php } ?>
1316
  <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1317
 
1341
  jQuery("body").removeClass("auto-fold");
1342
  <?php } ?>
1343
 
1344
+ <?php $this->print_admin_bar_scripts(); ?>
 
1345
 
1346
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
1347
  jQuery("#screen-options-link-wrap").css("display","none");
1355
  <?php } ?>
1356
  <?php if(get_option('agca_privacy_options')==true){ ?>
1357
  jQuery("#privacy-on-link").css("display","none");
1358
+ <?php } ?>
 
 
 
1359
 
1360
  <?php if(get_option('agca_update_bar')==true){ ?>
1361
  <?php
1373
  <?php if(get_option('agca_footer')==true){ ?>
1374
  jQuery("#footer,#wpfooter").css("display","none");
1375
  <?php } ?>
1376
+
 
 
1377
  <?php if(get_option('agca_footer_left')!=""){ ?>
1378
  jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1379
  <?php } ?>
1456
  ?>jQuery("#dashboard_activity").css("display","block");<?php
1457
  }
1458
 
1459
+ ?>
1460
 
1461
+ <?php /*ADMIN MENU*/ ?>
 
 
 
1462
 
1463
+ <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1464
+ jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
 
 
 
1465
  <?php } ?>
1466
  <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1467
  jQuery(".wp-menu-image").each(function(){
1475
  <?php } ?>
1476
  <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1477
 
1478
+ <?php /*If Turned on*/ ?>
 
 
1479
 
1480
  <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1481
  jQuery('#adminmenu > li').each(function(){
1576
  /*Add user buttons*/
1577
  jQuery('#adminmenu').append(buttons);
1578
 
 
1579
  <?php /*END If Turned on*/ ?>
1580
  <?php } else{ ?>
1581
  jQuery("#adminmenu").removeClass("noclass");
1588
  jQuery('#adminmenu').append('<li class="hide-if-no-js" onclick="window.setTimeout(function(){updateAllColors();},10);" id="collapse-menu"><div id="collapse-button"><div></div></div><span>Collapse menu</span></li>');
1589
  <?php } ?>
1590
 
 
 
1591
  <?php //COLORIZER ?>
1592
  updateAllColors();
1593
  <?php //COLORIZER END ?>
1791
  <table>
1792
  <tr valign="left" >
1793
  <th scope="row">
1794
+ <label title="If checked, all users will be affected with these changes, except admin. Not checked = apply for all</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>Advanced</i> tab and change capability option to define administrators. Only the users with selected capability will be AGCA administrators." for="agca_role_allbutadmin">Don't apply these customizations for AGCA administrator&nbsp;&nbsp;</label>
1795
  </th>
1796
  <td><input class="agca-checkbox" title="If checked, all users will be affected with these changes, except admin. Not checked = apply for all" type="checkbox" name="agca_role_allbutadmin" value="true" <?php if (get_option('agca_role_allbutadmin')==true) echo 'checked="checked" '; echo get_option('agca_role_allbutadmin'); ?> />
1797
  </td>
1821
  </div>
1822
  <div style="clear:both"></div>
1823
  <div id="section_admin_bar" class="ag_section">
1824
+ <h2 class="section_title" tabindex="-1">Admin Bar Settings</h2>
1825
  <br />
1826
+ <p tabindex="0"><i><strong>Info: </strong>Move your mouse over the option labels to see more information about the options</i></p>
1827
  <br />
1828
  <table class="form-table" width="500px">
1829
  <tr valign="center" class="ag_table_major_options" >
1830
  <td>
1831
+ <label tabindex="0" title="Hide admin bar with all elements in admin panel" for="agca_header"><strong>Hide admin bar completely</strong></label>
1832
  </td>
1833
  <td>
1834
+ <input id="agca_header" class="agca-checkbox" type="checkbox" onchange="if(jQuery('#agca_header').is(':checked')){jQuery('#agca_header_show_logout_content').show('slide');}else{jQuery('#agca_header_show_logout_content').hide('slide');};" title="Hide admin bar with all elements in admin panel" name="agca_header" value="true" <?php if (get_option('agca_header')==true) echo 'checked="checked" '; ?> />
1835
  </td>
1836
  </tr>
1837
 
1843
  ?>
1844
  <tr valign="center" class="ag_table_major_options" id="agca_header_show_logout_content" <?php echo $agca_header_show_logout_style; ?> >
1845
  <td>
1846
+ <label tabindex="0" title='Check this if you want to show Log Out button in top right corner of the admin page' for="agca_header_show_logout"><strong>(but show Log Out button)</strong></label>
1847
  </td>
1848
  <td>
1849
+ <input type="checkbox" class="agca-checkbox" title='Check this if you want to show Log Out button in top right corner of the admin page' name="agca_header_show_logout" value="true" <?php if ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)) echo 'checked="checked" '; ?> />
1850
  </td>
1851
  </tr>
1852
  <tr valign="center" >
1853
  <td>
1854
+ <label tabindex="0" title="Removes admin bar customizations (AGCA scripts) on front end.</br>This option can be helpful if you want to remove customizations on the website pages for logged in users." for="agca_admin_bar_frontend">Remove admin bar customizations on site pages</label>
1855
  </td>
1856
  <td>
1857
+ <input style="margin-left:-5px" class="agca-checkbox" id="agca_admin_bar_frontend" type="checkbox" title="Removes admin bar customizations (AGCA scripts) on front end.</br>This option can be helpful if you want to remove customizations on the website pages for logged in users." name="agca_admin_bar_frontend" value="true" <?php if (get_option('agca_admin_bar_frontend')==true) echo 'checked="checked" '; ?> />
1858
 
1859
  </td>
1860
  </tr>
1871
  <div class="ag_table_heading"><h3 tabindex="0">On the Left</h3></div>
1872
  </td>
1873
  <td></td>
1874
+ </tr>
 
 
 
 
 
 
 
 
 
 
1875
  <tr valign="center">
1876
  <th >
1877
  <label title="Change default WordPress logo with custom image." for="agca_wp_logo_custom">Change admin bar logo</label>
1915
  <td>
1916
  <input class="agca-checkbox" title="Small Wordpress logo in admin top bar" type="checkbox" name="agca_header_logo" value="true" <?php if (get_option('agca_header_logo')==true) echo 'checked="checked" '; ?> />
1917
  </td>
1918
+ </tr>
 
1919
  <tr valign="center">
1920
  <th >
1921
  <label title="Hides site name section in admin bar" for="agca_remove_site_link">Hide site name in admin bar</label>
1995
  <td>
1996
  <input class="agca-checkbox" title="Removes update notifications from admin bar" type="checkbox" name="agca_admin_bar_update_notifications" value="true" <?php if (get_option('agca_admin_bar_update_notifications')==true) echo 'checked="checked" '; ?> />
1997
  </td>
1998
+ </tr>
 
 
1999
  <tr valign="center">
2000
  <th scope="row">
2001
  <label title="Adds custom text in admin top bar. Default Wordpress heading stays intact." for="agca_custom_site_heading">Custom blog heading</label>
2012
  <input class="agca-checkbox" title="Hides yellow bar with notifications for new Wordpress release" type="checkbox" name="agca_update_bar" value="true" <?php if (get_option('agca_update_bar')==true) echo 'checked="checked" '; ?> />
2013
  </td>
2014
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
2015
  <tr valign="center">
2016
  <td colspan="2">
2017
  <div class="ag_table_heading"><h3 tabindex="0">On the Right</h3></div>
2054
  <label title="Put 'Exit', for example" for="agca_logout">Change Log out text</label>
2055
  </th>
2056
  <td><input title="Put 'Exit', for example" type="text" size="47" name="agca_logout" value="<?php echo get_option('agca_logout'); ?>" /></td>
2057
+ </tr>
 
 
 
 
 
 
 
2058
  <tr valign="center">
2059
  <th scope="row">
2060
+ <label for="agca_remove_your_profile">Remove "Edit My Profile" option from dropdown menu</label>
2061
  </th>
2062
  <td>
2063
  <input class="agca-checkbox" type="checkbox" name="agca_remove_your_profile" value="true" <?php if (get_option('agca_remove_your_profile')==true) echo 'checked="checked" '; ?> />
2064
  </td>
2065
+ </tr>
 
2066
  <tr valign="center">
2067
  <th scope="row">
2068
  <label title="If selected, hides all elements in top right corner, except Log Out button" for="agca_logout_only">Log out only</label>
2075
  </div>
2076
 
2077
  <div id="section_admin_footer" style="display:none" class="ag_section">
2078
+ <h2 class="section_title" tabindex="-1">Admin Footer Settings</h2>
2079
  <br /><br />
2080
  <table class="form-table" width="500px">
2081
  <tr valign="center" class="ag_table_major_options">
2135
  </td>
2136
  <td></td>
2137
  </tr>
 
 
 
 
 
 
 
 
 
2138
  <tr valign="center">
2139
  <th scope="row">
2140
  <label title="Main heading ('Dashboard') on Dashboard page" for="agca_dashboard_text">Change Dashboard heading text</label>
2174
  <td>
2175
  <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_activity" value="true" <?php if (get_option('agca_dashboard_widget_activity')==true) echo 'checked="checked" '; ?> />
2176
  </td>
2177
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2178
  <tr valign="center">
2179
  <th scope="row">
2180
  <label for="agca_dashboard_widget_qp">Hide "Quick Draft"</label>
2190
  <td>
2191
  <input class="agca-checkbox" type="checkbox" name="agca_dashboard_widget_rn" value="true" <?php if (get_option('agca_dashboard_widget_rn')==true) echo 'checked="checked" '; ?> />
2192
  </td>
2193
+ </tr>
 
 
 
 
 
 
 
 
2194
  <tr valign="center">
2195
  <th scope="row">
2196
  <label title="This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions" for="agca_dashboard_widget_primary">Hide "WordPress News" widget</label>
2314
  /*ADMIN MENU*/
2315
  ?>
2316
  <div id="section_admin_menu" style="display:none" class="ag_section">
2317
+ <h2 class="section_title" tabindex="-1">Admin Menu Settings</h2>
2318
  <br />
2319
  <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 <strong>Reset Settings</strong> button to restore default values if anything goes wrong.</p>
2320
  <p style="font-style:italic" tabindex="0"><strong></strong>If you found that admin menu items are misaligned or not correct, press <strong>Reset Settings</strong> button. This happens if admin menu is changed by other plugins, or after activating / deactivating other plugings. Avoid such changes after you apply admin menu customizations.</p>
2352
  </tr>
2353
  <tr valign="center">
2354
  <th scope="row">
2355
+ <label title="Remove empty space between some top menu items" for="agca_admin_menu_separators">Remove top menu items separators</label>
2356
  </th>
2357
  <td>
2358
+ <input class="agca-checkbox" title="Remove empty space between some top menu items" type="checkbox" name="agca_admin_menu_separators" value="true" <?php if (get_option('agca_admin_menu_separators')==true) echo 'checked="checked" '; ?> />
2359
  </td>
2360
+ </tr>
2361
+
 
 
 
 
 
 
 
2362
  <tr valign="center">
2363
  <th scope="row">
2364
  <label title="Removes small icons on admin menu buttons" for="agca_admin_menu_icons">Remove menu icons</label>
2536
  <input type="button" alt="color_admin_menu_top_button_hover_background" class="pick_color_button_clear agca_button" value="Clear" />
2537
  </td>
2538
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2539
  <tr valign="center">
2540
  <th><label title="Change submenu item background color" for="color_admin_menu_submenu_background">Submenu button background color:</label></th>
2541
  <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_background'); ?>" />
2556
  <input type="button" alt="color_admin_submenu_font" class="pick_color_button agca_button" value="Pick color" />
2557
  <input type="button" alt="color_admin_submenu_font" class="pick_color_button_clear agca_button" value="Clear" />
2558
  </td>
2559
+ </tr>
 
2560
  <tr valign="center">
2561
  <th><label title="Change background color of element behind admin menu" for="color_admin_menu_behind_background">Wrapper background color:</label></th>
2562
  <td><input type="text" id="color_admin_menu_behind_background" name="color_admin_menu_behind_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_behind_background'); ?>" />
2564
  <input type="button" alt="color_admin_menu_behind_background" class="pick_color_button_clear agca_button" value="Clear" />
2565
  </td>
2566
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2567
  <tr valign="center">
2568
  <td colspan="2">
2569
  <div class="ag_table_heading"><h3 tabindex="0">Font Color Options</h3></div>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
  Tested up to: 4.1
7
- Stable tag: 1.4.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -154,6 +154,13 @@ Plugin should be always up-to-date with latest WordPress release. If you have fo
154
 
155
  == Changelog ==
156
 
 
 
 
 
 
 
 
157
  = 1.4.5 =
158
  * Fixed issues
159
 
@@ -416,6 +423,9 @@ Plugin should be always up-to-date with latest WordPress release. If you have fo
416
 
417
  == Upgrade Notice ==
418
 
 
 
 
419
  = 1.4.5 =
420
  * Fixed issues
421
 
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
  Tested up to: 4.1
7
+ Stable tag: 1.4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
154
 
155
  == Changelog ==
156
 
157
+ = 1.4.6 =
158
+ * Removed obsolete Colorizer's border options
159
+ * Removed obsolete code
160
+ * Changed some options labels/descriptions
161
+ * Handling user's errors caused by mistake in Custom JS
162
+ * Removed first and second menu item separator options, replaced with remove all separators option
163
+
164
  = 1.4.5 =
165
  * Fixed issues
166
 
423
 
424
  == Upgrade Notice ==
425
 
426
+ = 1.4.6 =
427
+ * Refactoring. Removed obsolete code. Fixes some issues.
428
+
429
  = 1.4.5 =
430
  * Fixed issues
431
 
script/ag_script.js CHANGED
@@ -795,21 +795,7 @@ function updateTargetColor(id, color){
795
  break;
796
  case 'color_admin_submenu_font':
797
  jQuery('#adminmenu .wp-submenu li a').css('color',color);
798
- break;
799
- case 'color_admin_menu_submenu_border_top':
800
- if(jQuery('body').hasClass('folded')){
801
- jQuery('#adminmenu li.menu-top').css('border-top-color',color);
802
- }else{
803
- jQuery('#adminmenu > li > a').css('border-top-color',color);
804
- }
805
- break;
806
- case 'color_admin_menu_submenu_border_bottom':
807
- if(jQuery('body').hasClass('folded')){
808
- jQuery('#adminmenu li.menu-top').css('border-bottom-color',color);
809
- }else{
810
- jQuery('#adminmenu > li > a').css('border-bottom-color',color);
811
- }
812
- break;
813
  case 'color_admin_menu_font':
814
  jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
815
  'color':color
@@ -820,11 +806,6 @@ function updateTargetColor(id, color){
820
  'background-color':color
821
  });
822
  break;
823
- case 'color_admin_menu_behind_border':
824
- jQuery('#adminmenuback, #adminmenuwrap').css({
825
- 'border-color':color
826
- });
827
- break;
828
  case 'color_admin_menu_submenu_background_hover':
829
  var submenuSelector = '#adminmenu .wp-submenu a';
830
  var originalSubBackground = jQuery(submenuSelector).css('background-color');
@@ -1012,116 +993,16 @@ function agcaChangeCheckBoxStyles(){
1012
  });
1013
  }
1014
 
1015
- function isWPHigherOrEqualThan(targetVersion){
1016
- var versions = ["0.7",
1017
- "0.71",
1018
- "0.711",
1019
- "0.72",
1020
- "1.0",
1021
- "1.0.1",
1022
- "1.0.2",
1023
- "1.2",
1024
- "1.2.1",
1025
- "1.2.2",
1026
- "1.5",
1027
- "1.5.1",
1028
- "1.5.1.2",
1029
- "1.5.1.3",
1030
- "1.5.2",
1031
- "2.0",
1032
- "2.0.1",
1033
- "2.0.2",
1034
- "2.0.3",
1035
- "2.0.4",
1036
- "2.0.5",
1037
- "2.0.6",
1038
- "2.0.7",
1039
- "2.0.8",
1040
- "2.0.9",
1041
- "2.0.10",
1042
- "2.0.11",
1043
- "2.1",
1044
- "2.1.1",
1045
- "2.1.2",
1046
- "2.1.3",
1047
- "2.2",
1048
- "2.2.1",
1049
- "2.2.2",
1050
- "2.2.3",
1051
- "2.3",
1052
- "2.3.1",
1053
- "2.3.2",
1054
- "2.3.3",
1055
- "2.5",
1056
- "2.5.1",
1057
- "2.6",
1058
- "2.6.1",
1059
- "2.6.2",
1060
- "2.6.3",
1061
- "2.6.5",
1062
- "2.7",
1063
- "2.7.1",
1064
- "2.8",
1065
- "2.8.1",
1066
- "2.8.2",
1067
- "2.8.3",
1068
- "2.8.4",
1069
- "2.8.5",
1070
- "2.8.6",
1071
- "2.9",
1072
- "2.9.1",
1073
- "2.9.2",
1074
- "3.0",
1075
- "3.0.1",
1076
- "3.0.2",
1077
- "3.0.3",
1078
- "3.0.4",
1079
- "3.0.5",
1080
- "3.0.6",
1081
- "3.1",
1082
- "3.1.1",
1083
- "3.1.2",
1084
- "3.1.3",
1085
- "3.1.4",
1086
- "3.2",
1087
- "3.2.1",
1088
- "3.3",
1089
- "3.3.1",
1090
- "3.3.2",
1091
- "3.4",
1092
- "3.4.1",
1093
- "3.4.2",
1094
- "3.5",
1095
- "3.5.1",
1096
- "3.5.2",
1097
- "3.5.3",
1098
- "3.5.4",
1099
- "3.6",
1100
- "3.6.1",
1101
- "3.6.2",
1102
- "3.6.3",
1103
- "3.7",
1104
- "3.7.1",
1105
- "3.7.2",
1106
- "3.7.3",
1107
- "3.7.4",
1108
- "3.8",
1109
- "3.8.1",
1110
- "3.8.2",
1111
- "3.8.3",
1112
- "3.9",
1113
- "3.9.1"];
1114
  //remove sufixes, beta RC etc
1115
  if (wpversion.indexOf("-")!=-1){
1116
  var parts = wpversion.split("-");
1117
  wpversion = parts[0];
1118
  }
1119
- for(var i in versions){
1120
- if(versions[i] == targetVersion){
1121
- if(wpversion >= targetVersion) return true;
1122
- }
1123
- }
1124
- return false;
1125
  }
1126
 
1127
 
795
  break;
796
  case 'color_admin_submenu_font':
797
  jQuery('#adminmenu .wp-submenu li a').css('color',color);
798
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
799
  case 'color_admin_menu_font':
800
  jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
801
  'color':color
806
  'background-color':color
807
  });
808
  break;
 
 
 
 
 
809
  case 'color_admin_menu_submenu_background_hover':
810
  var submenuSelector = '#adminmenu .wp-submenu a';
811
  var originalSubBackground = jQuery(submenuSelector).css('background-color');
993
  });
994
  }
995
 
996
+ function isWPHigherOrEqualThan(targetVersion){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
997
  //remove sufixes, beta RC etc
998
  if (wpversion.indexOf("-")!=-1){
999
  var parts = wpversion.split("-");
1000
  wpversion = parts[0];
1001
  }
1002
+ var currentVersion = parseFloat(wpversion);
1003
+ targetVersion = parseFloat(targetVersion);
1004
+
1005
+ return (wpversion >= targetVersion);
 
 
1006
  }
1007
 
1008