Version Description
- Plugin tested up to 3.2.1
- Fixed some compatibility issues with other plugins
- Tested compatibility with Ozh' Admin Drop Down Menu v3.6.1
- Tested compatibility with SexyBookmarks (by Shareaholic) v4.0.5.6
- Fixed blank screen of death if an error from outside of plugin is thrown
- Improved error handling and showing
- Improved versioning
Download this release
Release Info
Developer | argonius |
Plugin | Absolutely Glamorous Custom Admin |
Version | 1.2.5 |
Comparing to | |
See all releases |
Code changes from version 1.2.4 to 1.2.5
- plugin.php +87 -56
- readme.txt +15 -3
- script/ag_script.js +7 -1
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.
|
8 |
Author URI: http://wordpress.argonius.com/ag-custom-admin
|
9 |
|
10 |
Copyright 2011. Argonius (email : info@argonius.com)
|
@@ -27,6 +27,7 @@ $agca = new AGCA();
|
|
27 |
|
28 |
class AGCA{
|
29 |
private $colorizer="";
|
|
|
30 |
public function __construct()
|
31 |
{
|
32 |
|
@@ -42,8 +43,8 @@ class AGCA{
|
|
42 |
// add_action('admin_menu', array(&$this,'agca_get_styles'));
|
43 |
// add_action('login_head', array(&$this,'agca_get_styles'));
|
44 |
|
45 |
-
/*Initialize properties*/
|
46 |
-
$this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
|
47 |
}
|
48 |
// Add donate and support information
|
49 |
function jk_filter_plugin_links($links, $file)
|
@@ -56,6 +57,18 @@ class AGCA{
|
|
56 |
}
|
57 |
return $links;
|
58 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
function agca_get_includes() {
|
60 |
?>
|
61 |
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css" />
|
@@ -66,7 +79,7 @@ class AGCA{
|
|
66 |
|
67 |
function reloadScript(){
|
68 |
?>
|
69 |
-
<script type="text/javascript" src="<?php echo
|
70 |
<?php
|
71 |
|
72 |
}
|
@@ -289,13 +302,35 @@ class AGCA{
|
|
289 |
<script type="text/javascript">
|
290 |
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
291 |
var wpversion = "<?php echo $wpversion; ?>";
|
|
|
|
|
292 |
|
293 |
/* <![CDATA[ */
|
294 |
jQuery(document).ready(function() {
|
|
|
295 |
try
|
296 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
//get saved onfigurations
|
298 |
<?php $checkboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'0'); ?>
|
|
|
299 |
var checkboxes = <?php echo "[".$checkboxes."]"; ?>;
|
300 |
|
301 |
<?php $textboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'1'); ?>
|
@@ -335,21 +370,19 @@ try
|
|
335 |
<?php if(get_option('agca_header_logo')==true){ ?>
|
336 |
jQuery("#wphead #header-logo").css("display","none");
|
337 |
<?php } ?>
|
338 |
-
<?php if(get_option('agca_header_logo_custom')!=""){ ?>
|
339 |
-
jQuery("#wphead img#header-logo").attr('src','');
|
340 |
-
jQuery("#wphead img#header-logo").hide();
|
341 |
-
var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>'
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
}
|
352 |
-
});
|
353 |
|
354 |
<?php } ?>
|
355 |
<?php if(get_option('agca_site_heading')==true){ ?>
|
@@ -508,8 +541,8 @@ try
|
|
508 |
}else{
|
509 |
?>jQuery("#dashboard_secondary").css("display","block");<?php
|
510 |
}
|
511 |
-
?>
|
512 |
-
|
513 |
|
514 |
<?php /*ADMIN MENU*/ ?>
|
515 |
|
@@ -611,9 +644,6 @@ try
|
|
611 |
jQuery("#adminmenu").removeClass("noclass");
|
612 |
<?php } ?>
|
613 |
|
614 |
-
|
615 |
-
/*Add user buttons*/
|
616 |
-
jQuery('#ag_add_adminmenu').append(buttonsJq);
|
617 |
reloadRemoveButtonEvents();
|
618 |
|
619 |
|
@@ -634,11 +664,20 @@ try
|
|
634 |
<?php } ?>
|
635 |
<?php //COLORIZER END ?>
|
636 |
<?php } //end of apply for any user except admin ?>
|
637 |
-
|
638 |
-
|
639 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
640 |
});
|
641 |
-
/* ]]> */
|
|
|
642 |
</script>
|
643 |
<style type="text/css">
|
644 |
.underline_text{
|
@@ -648,13 +687,6 @@ try
|
|
648 |
width:300px;
|
649 |
}
|
650 |
</style>
|
651 |
-
<?php //unhide after everything is loaded ?>
|
652 |
-
<script type="text/javascript">
|
653 |
-
jQuery(document).ready(function() {
|
654 |
-
jQuery('html').css('visibility','visible');
|
655 |
-
|
656 |
-
});
|
657 |
-
</script>
|
658 |
<?php
|
659 |
}
|
660 |
|
@@ -667,30 +699,31 @@ try
|
|
667 |
|
668 |
<script type="text/javascript">
|
669 |
document.write('<style type="text/css">html{display:none;}</style>');
|
670 |
-
var
|
|
|
671 |
/* <![CDATA[ */
|
672 |
jQuery(document).ready(function() {
|
673 |
-
try{
|
674 |
<?php if(get_option('agca_login_banner')==true){ ?>
|
675 |
jQuery("#backtoblog").css("display","none");
|
676 |
<?php } ?>
|
677 |
<?php if(get_option('agca_login_banner_text')==true){ ?>
|
678 |
jQuery("#backtoblog").html('<?php echo get_option('agca_login_banner_text'); ?>');
|
679 |
<?php } ?>
|
680 |
-
<?php if(get_option('agca_login_photo_url')==true){ ?>
|
681 |
-
|
|
|
682 |
jQuery("#login h1 a").css("background-image",$url);
|
683 |
jQuery("#login h1 a").hide();
|
684 |
-
|
685 |
-
jQuery(image).
|
686 |
var originalWidth = 326;
|
687 |
var widthDiff = this.width - originalWidth;
|
688 |
jQuery("#login h1 a").height(this.height);
|
689 |
jQuery("#login h1 a").width(this.width);
|
690 |
jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+"px");
|
691 |
jQuery("#login h1 a").show();
|
692 |
-
|
693 |
-
});
|
694 |
<?php } ?>
|
695 |
<?php if(get_option('agca_login_photo_href')==true){ ?>
|
696 |
var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
|
@@ -726,17 +759,15 @@ try
|
|
726 |
<?php
|
727 |
}
|
728 |
} ?>
|
729 |
-
<?php //COLORIZER END ?>
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
jQuery(
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
}
|
738 |
-
alert("LOGIN ERROR: " + err);
|
739 |
-
}
|
740 |
});
|
741 |
/* ]]> */
|
742 |
</script>
|
@@ -755,7 +786,7 @@ try
|
|
755 |
<script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js"></script>
|
756 |
<?php //includes ?>
|
757 |
<div class="wrap">
|
758 |
-
<h1 style="color:green">AG Custom Admin Settings <span style="font-size:15px;">(v1.2.
|
759 |
<div id="agca_news"> </div><br />
|
760 |
<form method="post" id="agca_form" action="options.php">
|
761 |
<?php settings_fields( 'agca-options-group' ); ?>
|
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
|
8 |
Author URI: http://wordpress.argonius.com/ag-custom-admin
|
9 |
|
10 |
Copyright 2011. Argonius (email : info@argonius.com)
|
27 |
|
28 |
class AGCA{
|
29 |
private $colorizer="";
|
30 |
+
private $active_plugin;
|
31 |
public function __construct()
|
32 |
{
|
33 |
|
43 |
// add_action('admin_menu', array(&$this,'agca_get_styles'));
|
44 |
// add_action('login_head', array(&$this,'agca_get_styles'));
|
45 |
|
46 |
+
/*Initialize properties*/
|
47 |
+
$this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
|
48 |
}
|
49 |
// Add donate and support information
|
50 |
function jk_filter_plugin_links($links, $file)
|
57 |
}
|
58 |
return $links;
|
59 |
}
|
60 |
+
function check_active_plugin(){
|
61 |
+
|
62 |
+
$ozh = false;
|
63 |
+
|
64 |
+
if (is_plugin_active('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')) {
|
65 |
+
$ozh = true;
|
66 |
+
}
|
67 |
+
|
68 |
+
$this->active_plugin = array(
|
69 |
+
"ozh" => $ozh
|
70 |
+
);
|
71 |
+
}
|
72 |
function agca_get_includes() {
|
73 |
?>
|
74 |
<link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css" />
|
79 |
|
80 |
function reloadScript(){
|
81 |
?>
|
82 |
+
<script type="text/javascript" src="<?php echo get_bloginfo('wpurl'); ?>/wp-includes/js/jquery/jquery.js"></script>
|
83 |
<?php
|
84 |
|
85 |
}
|
302 |
<script type="text/javascript">
|
303 |
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
304 |
var wpversion = "<?php echo $wpversion; ?>";
|
305 |
+
var agca_version = "1.2.5";
|
306 |
+
var errors = false;
|
307 |
|
308 |
/* <![CDATA[ */
|
309 |
jQuery(document).ready(function() {
|
310 |
+
|
311 |
try
|
312 |
+
{
|
313 |
+
|
314 |
+
<?php /*CHECK OTHER PLUGNS*/
|
315 |
+
$this->check_active_plugin();
|
316 |
+
|
317 |
+
if($this->active_plugin["ozh"]){
|
318 |
+
?>
|
319 |
+
jQuery('ul#adminmenu').css('display','none');
|
320 |
+
jQuery('#footer-ozh-oam').css('display','none');
|
321 |
+
jQuery('#ag_main_menu li').each(function(){
|
322 |
+
if(jQuery(this).text() == "Admin Menu"){
|
323 |
+
jQuery(this).hide();
|
324 |
+
}
|
325 |
+
});
|
326 |
+
<?php
|
327 |
+
}
|
328 |
+
?>
|
329 |
+
|
330 |
+
|
331 |
//get saved onfigurations
|
332 |
<?php $checkboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'0'); ?>
|
333 |
+
|
334 |
var checkboxes = <?php echo "[".$checkboxes."]"; ?>;
|
335 |
|
336 |
<?php $textboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'1'); ?>
|
370 |
<?php if(get_option('agca_header_logo')==true){ ?>
|
371 |
jQuery("#wphead #header-logo").css("display","none");
|
372 |
<?php } ?>
|
373 |
+
<?php if(get_option('agca_header_logo_custom')!=""){ ?>
|
374 |
+
jQuery("#wphead img#header-logo").attr('src','');
|
375 |
+
jQuery("#wphead img#header-logo").hide();
|
376 |
+
var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
|
377 |
+
advanced_url = img_url+ "?" + new Date().getTime();
|
378 |
+
image = jQuery("<img />").attr("src",advanced_url);
|
379 |
+
jQuery(image).load(function() {
|
380 |
+
jQuery("#wphead img#header-logo").attr('src', advanced_url);
|
381 |
+
jQuery("#wphead img#header-logo").attr('width',this.width);
|
382 |
+
jQuery("#wphead img#header-logo").attr('height',this.height);
|
383 |
+
jQuery("#wphead").css('height', (14 + this.height)+'px');
|
384 |
+
jQuery("#wphead img#header-logo").show();
|
385 |
+
});
|
|
|
|
|
386 |
|
387 |
<?php } ?>
|
388 |
<?php if(get_option('agca_site_heading')==true){ ?>
|
541 |
}else{
|
542 |
?>jQuery("#dashboard_secondary").css("display","block");<?php
|
543 |
}
|
544 |
+
?>
|
545 |
+
|
546 |
|
547 |
<?php /*ADMIN MENU*/ ?>
|
548 |
|
644 |
jQuery("#adminmenu").removeClass("noclass");
|
645 |
<?php } ?>
|
646 |
|
|
|
|
|
|
|
647 |
reloadRemoveButtonEvents();
|
648 |
|
649 |
|
664 |
<?php } ?>
|
665 |
<?php //COLORIZER END ?>
|
666 |
<?php } //end of apply for any user except admin ?>
|
667 |
+
/*Add user buttons*/
|
668 |
+
jQuery('#ag_add_adminmenu').append(buttonsJq);
|
669 |
+
}catch(err){
|
670 |
+
errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
|
671 |
+
alert(errors);
|
672 |
+
}finally{
|
673 |
+
jQuery('html').css('visibility','visible');
|
674 |
+
if(errors){
|
675 |
+
jQuery("#agca_form").html('<div style="height:500px"><p style="color:red"><strong>WARNING:</strong> AG Custom Admin stops its execution because of an error. Please resolve this error before continue: <br /><br /><strong>' + errors + '</strong></p></div>');
|
676 |
+
}
|
677 |
+
}
|
678 |
});
|
679 |
+
/* ]]> */
|
680 |
+
|
681 |
</script>
|
682 |
<style type="text/css">
|
683 |
.underline_text{
|
687 |
width:300px;
|
688 |
}
|
689 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
690 |
<?php
|
691 |
}
|
692 |
|
699 |
|
700 |
<script type="text/javascript">
|
701 |
document.write('<style type="text/css">html{display:none;}</style>');
|
702 |
+
var agca_version = "1.2.5";
|
703 |
+
var wpversion = "<?php echo $wpversion; ?>";
|
704 |
/* <![CDATA[ */
|
705 |
jQuery(document).ready(function() {
|
706 |
+
try{
|
707 |
<?php if(get_option('agca_login_banner')==true){ ?>
|
708 |
jQuery("#backtoblog").css("display","none");
|
709 |
<?php } ?>
|
710 |
<?php if(get_option('agca_login_banner_text')==true){ ?>
|
711 |
jQuery("#backtoblog").html('<?php echo get_option('agca_login_banner_text'); ?>');
|
712 |
<?php } ?>
|
713 |
+
<?php if(get_option('agca_login_photo_url')==true){ ?>
|
714 |
+
advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>" + "?" + new Date().getTime();
|
715 |
+
var $url = "url(" + advanced_url + ")";
|
716 |
jQuery("#login h1 a").css("background-image",$url);
|
717 |
jQuery("#login h1 a").hide();
|
718 |
+
image = jQuery("<img />").attr("src",advanced_url);
|
719 |
+
jQuery(image).load(function() {
|
720 |
var originalWidth = 326;
|
721 |
var widthDiff = this.width - originalWidth;
|
722 |
jQuery("#login h1 a").height(this.height);
|
723 |
jQuery("#login h1 a").width(this.width);
|
724 |
jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+"px");
|
725 |
jQuery("#login h1 a").show();
|
726 |
+
});
|
|
|
727 |
<?php } ?>
|
728 |
<?php if(get_option('agca_login_photo_href')==true){ ?>
|
729 |
var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
|
759 |
<?php
|
760 |
}
|
761 |
} ?>
|
762 |
+
<?php //COLORIZER END ?>
|
763 |
+
}catch(err){
|
764 |
+
alert("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
|
765 |
+
}finally{
|
766 |
+
jQuery(document).ready(function() {
|
767 |
+
jQuery('html').show();
|
768 |
+
jQuery('html').css("display","block");
|
769 |
+
});
|
770 |
+
}
|
|
|
|
|
771 |
});
|
772 |
/* ]]> */
|
773 |
</script>
|
786 |
<script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js"></script>
|
787 |
<?php //includes ?>
|
788 |
<div class="wrap">
|
789 |
+
<h1 style="color:green">AG Custom Admin Settings <span style="font-size:15px;">(v1.2.5)</span></h1>
|
790 |
<div id="agca_news"> </div><br />
|
791 |
<form method="post" id="agca_form" action="options.php">
|
792 |
<?php settings_fields( 'agca-options-group' ); ?>
|
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.2
|
7 |
-
Stable tag: 1.2.
|
8 |
|
9 |
Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
|
10 |
|
@@ -74,7 +74,7 @@ It is possible that WordPress usually wraps that text with some HTML tags. In th
|
|
74 |
Try to clear browser's cache, and reload page.
|
75 |
|
76 |
= I see only blank page. What to do? =
|
77 |
-
|
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.
|
@@ -88,6 +88,15 @@ Please use 'Reset Settings' button on Admin Menu page to reset menu configuratio
|
|
88 |
|
89 |
== Changelog ==
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
= 1.2.4 =
|
92 |
* Plugin is now fully compatible with WordPress version 3.2
|
93 |
* Fixed update notification bar for lower WP versions
|
@@ -141,6 +150,9 @@ Please use 'Reset Settings' button on Admin Menu page to reset menu configuratio
|
|
141 |
|
142 |
== Upgrade Notice ==
|
143 |
|
|
|
|
|
|
|
144 |
= 1.2.4 =
|
145 |
This plugin version is ready for WordPress release 3.2, and fully compatible with it. Added few new options, and improved plugin stability.
|
146 |
|
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.2.1
|
7 |
+
Stable tag: 1.2.5
|
8 |
|
9 |
Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
|
10 |
|
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.
|
88 |
|
89 |
== Changelog ==
|
90 |
|
91 |
+
= 1.2.5 =
|
92 |
+
* Plugin tested up to 3.2.1
|
93 |
+
* Fixed some compatibility issues with other plugins
|
94 |
+
* Tested compatibility with Ozh' Admin Drop Down Menu v3.6.1
|
95 |
+
* Tested compatibility with SexyBookmarks (by Shareaholic) v4.0.5.6
|
96 |
+
* Fixed blank screen of death if an error from outside of plugin is thrown
|
97 |
+
* Improved error handling and showing
|
98 |
+
* Improved versioning
|
99 |
+
|
100 |
= 1.2.4 =
|
101 |
* Plugin is now fully compatible with WordPress version 3.2
|
102 |
* Fixed update notification bar for lower WP versions
|
150 |
|
151 |
== Upgrade Notice ==
|
152 |
|
153 |
+
= 1.2.5 =
|
154 |
+
Improved compatibility with other plugins. Tested with Ozh' Admin Drop Down Menu and SexyBookmarks. Fixed screen freezing and white screen of death. Improved error handling and showing.
|
155 |
+
|
156 |
= 1.2.4 =
|
157 |
This plugin version is ready for WordPress release 3.2, and fully compatible with it. Added few new options, and improved plugin stability.
|
158 |
|
script/ag_script.js
CHANGED
@@ -469,7 +469,13 @@ jQuery(document).ready(function(){
|
|
469 |
jQuery(document).ready(function(){
|
470 |
jQuery(document).ready(function(){
|
471 |
var url="http://wordpress.argonius.com/agca/news.php/news?jsoncallback=?";
|
472 |
-
jQuery.getJSON(
|
|
|
|
|
|
|
|
|
|
|
|
|
473 |
jQuery.each(json.posts,function(i,post){
|
474 |
jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
|
475 |
});
|
469 |
jQuery(document).ready(function(){
|
470 |
jQuery(document).ready(function(){
|
471 |
var url="http://wordpress.argonius.com/agca/news.php/news?jsoncallback=?";
|
472 |
+
jQuery.getJSON(
|
473 |
+
url,{
|
474 |
+
wp_ver: wpversion,
|
475 |
+
agca_ver: agca_version,
|
476 |
+
format: "json"
|
477 |
+
},
|
478 |
+
function(json){
|
479 |
jQuery.each(json.posts,function(i,post){
|
480 |
jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
|
481 |
});
|