Version Description
- Removed AGCA script on site pages automaticaly, if user is not logged in
- Custom WordPress admin title. Using custom title templates
- Added option for removing blog title from top bar
- Fixed missaligned menu when using custom content types plugins
- Fixed bug "Save button does not work" caused by unescaped characters in footer text and custom button names
- Updated AGCA buttons styles
Download this release
Release Info
Developer | argonius |
Plugin | Absolutely Glamorous Custom Admin |
Version | 1.2.7.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.7 to 1.2.7.1
- plugin.php +98 -25
- readme.txt +1 -1
- script/ag_script.js +20 -7
- style/ag_style.css +20 -3
plugin.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
|
|
4 |
Plugin URI: http://agca.argonius.com/ag-custom-admin/category/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.7
|
8 |
Author URI: http://www.argonius.com/
|
9 |
|
10 |
Copyright 2011. Argonius (email : info@argonius.com)
|
@@ -25,9 +25,9 @@ Author URI: http://www.argonius.com/
|
|
25 |
|
26 |
//require_once('/../../../../../FirePHPCore/lib/FirePHPCore/fb.php');
|
27 |
//fb($_POST);
|
28 |
-
|
29 |
$agca = new AGCA();
|
30 |
-
|
31 |
class AGCA{
|
32 |
private $colorizer="";
|
33 |
private $active_plugin;
|
@@ -40,19 +40,19 @@ class AGCA{
|
|
40 |
|
41 |
$this->reloadScript();
|
42 |
|
|
|
43 |
add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
|
44 |
add_action('admin_init', array(&$this,'agca_register_settings'));
|
45 |
add_action('admin_head', array(&$this,'print_admin_css'));
|
46 |
add_action('login_head', array(&$this,'print_login_head'));
|
47 |
add_action('admin_menu', array(&$this,'agca_create_menu'));
|
48 |
add_action('wp_head', array(&$this,'print_page'));
|
49 |
-
register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
|
50 |
-
|
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.7";
|
56 |
}
|
57 |
// Add donate and support information
|
58 |
function jk_filter_plugin_links($links, $file)
|
@@ -65,6 +65,14 @@ class AGCA{
|
|
65 |
}
|
66 |
return $links;
|
67 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
function check_active_plugin(){
|
69 |
|
70 |
$ozh = false;
|
@@ -77,6 +85,19 @@ class AGCA{
|
|
77 |
"ozh" => $ozh
|
78 |
);
|
79 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
function agca_get_includes() {
|
81 |
?>
|
82 |
<script type="text/javascript">
|
@@ -91,7 +112,7 @@ class AGCA{
|
|
91 |
<?php
|
92 |
if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
|
93 |
?>
|
94 |
-
<style type="text/css">
|
95 |
<?php
|
96 |
echo get_option('agca_custom_css');
|
97 |
?>
|
@@ -121,6 +142,7 @@ class AGCA{
|
|
121 |
register_setting( 'agca-options-group', 'agca_remove_your_profile' );
|
122 |
register_setting( 'agca-options-group', 'agca_logout_only' );
|
123 |
register_setting( 'agca-options-group', 'agca_options_menu' );
|
|
|
124 |
register_setting( 'agca-options-group', 'agca_howdy' );
|
125 |
register_setting( 'agca-options-group', 'agca_header' );
|
126 |
register_setting( 'agca-options-group', 'agca_header_show_logout' );
|
@@ -129,6 +151,7 @@ class AGCA{
|
|
129 |
register_setting( 'agca-options-group', 'agca_header_logo' );
|
130 |
register_setting( 'agca-options-group', 'agca_header_logo_custom' );
|
131 |
register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
|
|
|
132 |
register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
|
133 |
|
134 |
register_setting( 'agca-options-group', 'agca_site_heading' );
|
@@ -247,6 +270,7 @@ class AGCA{
|
|
247 |
'agca_remove_your_profile',
|
248 |
'agca_logout_only',
|
249 |
'agca_options_menu',
|
|
|
250 |
'agca_howdy',
|
251 |
'agca_header',
|
252 |
'agca_header_show_logout',
|
@@ -254,6 +278,7 @@ class AGCA{
|
|
254 |
'agca_privacy_options',
|
255 |
'agca_header_logo',
|
256 |
'agca_header_logo_custom',
|
|
|
257 |
'agca_wp_logo_custom',
|
258 |
'agca_wp_logo_custom_link',
|
259 |
'agca_site_heading',
|
@@ -508,8 +533,31 @@ class AGCA{
|
|
508 |
return $version;
|
509 |
}
|
510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
function print_page()
|
512 |
{
|
|
|
|
|
|
|
|
|
513 |
if(get_option('agca_admin_bar_frontend_hide')==true){
|
514 |
add_filter( 'show_admin_bar', '__return_false' );
|
515 |
?>
|
@@ -691,6 +739,10 @@ class AGCA{
|
|
691 |
jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
|
692 |
}
|
693 |
<?php }?>
|
|
|
|
|
|
|
|
|
694 |
<?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
|
695 |
if(isWPHigherOrEqualThan("3.3")){
|
696 |
var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
|
@@ -787,6 +839,12 @@ class AGCA{
|
|
787 |
}
|
788 |
|
789 |
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
790 |
<?php if(get_option('agca_logout')!=""){ ?>
|
791 |
if(isWPHigherOrEqualThan("3.3")){
|
792 |
jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
|
@@ -887,9 +945,7 @@ class AGCA{
|
|
887 |
$this->admin_capabilities();
|
888 |
$this->context = "admin";
|
889 |
get_currentuserinfo() ;
|
890 |
-
$wpversion = $this->get_wp_version();
|
891 |
-
|
892 |
-
|
893 |
?>
|
894 |
<?php
|
895 |
//in case that javaScript is disabled only admin can access admin menu
|
@@ -903,6 +959,7 @@ class AGCA{
|
|
903 |
?>
|
904 |
<script type="text/javascript">
|
905 |
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
|
|
906 |
var wpversion = "<?php echo $wpversion; ?>";
|
907 |
var agca_version = "<?php echo $this->agca_version; ?>";
|
908 |
var errors = false;
|
@@ -942,7 +999,7 @@ try
|
|
942 |
<?php $checkboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'0'); ?>
|
943 |
|
944 |
var checkboxes = <?php echo "[".$checkboxes."]"; ?>;
|
945 |
-
|
946 |
<?php $textboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'1'); ?>
|
947 |
var textboxes = <?php echo "[".$textboxes."]"; ?>;
|
948 |
|
@@ -1042,8 +1099,8 @@ try
|
|
1042 |
<?php if(get_option('agca_footer_left_hide')==true){ ?>
|
1043 |
jQuery("#footer-left").css("display","none");
|
1044 |
<?php } ?>
|
1045 |
-
<?php if(get_option('agca_footer_right')!=""){ ?>
|
1046 |
-
jQuery("#footer-upgrade").html('<?php echo get_option('agca_footer_right'); ?>');
|
1047 |
<?php } ?>
|
1048 |
<?php if(get_option('agca_footer_right_hide')==true){ ?>
|
1049 |
jQuery("#footer-upgrade").css("display","none");
|
@@ -1186,7 +1243,7 @@ try
|
|
1186 |
for(i=0; i< checkboxes.length ; i++){
|
1187 |
|
1188 |
if(checkboxes[i][0].indexOf("<-TOP->") >=0){ //if it is top item
|
1189 |
-
if(checkboxes[i][0].
|
1190 |
matchFound = true;
|
1191 |
//console.log(checkboxes[i][0]);
|
1192 |
//console.log(jQuery(this).find('.wp-menu-name').text());
|
@@ -1228,8 +1285,6 @@ try
|
|
1228 |
i++;
|
1229 |
}
|
1230 |
};
|
1231 |
-
}else{
|
1232 |
-
//i++;
|
1233 |
}
|
1234 |
}
|
1235 |
//console.log(subMenus);
|
@@ -1290,8 +1345,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
|
|
1290 |
} ?>
|
1291 |
|
1292 |
|
1293 |
-
/* ]]> */
|
1294 |
-
|
1295 |
</script>
|
1296 |
<style type="text/css">
|
1297 |
.underline_text{
|
@@ -1315,10 +1369,11 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
|
|
1315 |
$wpversion = $this->get_wp_version();
|
1316 |
?>
|
1317 |
|
1318 |
-
<script type="text/javascript">
|
1319 |
-
document.write('<style type="text/css">html{
|
|
|
1320 |
var agca_version = "<?php echo $this->agca_version; ?>";
|
1321 |
-
var wpversion = "<?php echo $wpversion; ?>";
|
1322 |
var isSettingsImport = false;
|
1323 |
var agca_context = "login";
|
1324 |
/* <![CDATA[ */
|
@@ -1437,11 +1492,12 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
|
|
1437 |
}finally{
|
1438 |
|
1439 |
jQuery('html').show();
|
1440 |
-
jQuery('html').css(
|
1441 |
|
1442 |
}
|
1443 |
});
|
1444 |
/* ]]> */
|
|
|
1445 |
</script>
|
1446 |
<?php
|
1447 |
}
|
@@ -1574,6 +1630,15 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
|
|
1574 |
<p><i>Put here a link for admin bar logo </i>.</p>
|
1575 |
</td>
|
1576 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1577 |
<tr valign="center">
|
1578 |
<th >
|
1579 |
<label title="Add custom image on the top of admin content." for="agca_header_logo_custom">Custom header image</label>
|
@@ -1591,7 +1656,15 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
|
|
1591 |
<input 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" '; ?> />
|
1592 |
</td>
|
1593 |
</tr>
|
1594 |
-
<?php if($wpversion>=3.3){?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1595 |
<tr valign="center">
|
1596 |
<th >
|
1597 |
<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>
|
@@ -2432,8 +2505,8 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
|
|
2432 |
</table>
|
2433 |
</div>
|
2434 |
<br /><br /><br />
|
2435 |
-
<p class="submit">
|
2436 |
-
<input type="button" id="save_plugin_settings" title="Save
|
2437 |
</p>
|
2438 |
|
2439 |
</form>
|
4 |
Plugin URI: http://agca.argonius.com/ag-custom-admin/category/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.7.1
|
8 |
Author URI: http://www.argonius.com/
|
9 |
|
10 |
Copyright 2011. Argonius (email : info@argonius.com)
|
25 |
|
26 |
//require_once('/../../../../../FirePHPCore/lib/FirePHPCore/fb.php');
|
27 |
//fb($_POST);
|
28 |
+
|
29 |
$agca = new AGCA();
|
30 |
+
|
31 |
class AGCA{
|
32 |
private $colorizer="";
|
33 |
private $active_plugin;
|
40 |
|
41 |
$this->reloadScript();
|
42 |
|
43 |
+
add_filter('admin_title', array(&$this,'change_title'), 10, 2);
|
44 |
add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
|
45 |
add_action('admin_init', array(&$this,'agca_register_settings'));
|
46 |
add_action('admin_head', array(&$this,'print_admin_css'));
|
47 |
add_action('login_head', array(&$this,'print_login_head'));
|
48 |
add_action('admin_menu', array(&$this,'agca_create_menu'));
|
49 |
add_action('wp_head', array(&$this,'print_page'));
|
50 |
+
register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
|
|
|
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.7.1";
|
56 |
}
|
57 |
// Add donate and support information
|
58 |
function jk_filter_plugin_links($links, $file)
|
65 |
}
|
66 |
return $links;
|
67 |
}
|
68 |
+
function isGuest(){
|
69 |
+
global $user_login;
|
70 |
+
if($user_login) {
|
71 |
+
return false;
|
72 |
+
}else{
|
73 |
+
return true;
|
74 |
+
}
|
75 |
+
}
|
76 |
function check_active_plugin(){
|
77 |
|
78 |
$ozh = false;
|
85 |
"ozh" => $ozh
|
86 |
);
|
87 |
}
|
88 |
+
function change_title($admin_title, $title){
|
89 |
+
//return get_bloginfo('name').' - '.$title;
|
90 |
+
if(get_option('agca_custom_title')!=""){
|
91 |
+
$blog = get_bloginfo('name');
|
92 |
+
$page = $title;
|
93 |
+
$customTitle = get_option('agca_custom_title');
|
94 |
+
$customTitle = str_replace('%BLOG%',$blog,$customTitle);
|
95 |
+
$customTitle = str_replace('%PAGE%',$page,$customTitle);
|
96 |
+
return $customTitle;
|
97 |
+
}else{
|
98 |
+
return $admin_title;
|
99 |
+
}
|
100 |
+
}
|
101 |
function agca_get_includes() {
|
102 |
?>
|
103 |
<script type="text/javascript">
|
112 |
<?php
|
113 |
if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
|
114 |
?>
|
115 |
+
<style type="text/css">
|
116 |
<?php
|
117 |
echo get_option('agca_custom_css');
|
118 |
?>
|
142 |
register_setting( 'agca-options-group', 'agca_remove_your_profile' );
|
143 |
register_setting( 'agca-options-group', 'agca_logout_only' );
|
144 |
register_setting( 'agca-options-group', 'agca_options_menu' );
|
145 |
+
register_setting( 'agca-options-group', 'agca_custom_title' );
|
146 |
register_setting( 'agca-options-group', 'agca_howdy' );
|
147 |
register_setting( 'agca-options-group', 'agca_header' );
|
148 |
register_setting( 'agca-options-group', 'agca_header_show_logout' );
|
151 |
register_setting( 'agca-options-group', 'agca_header_logo' );
|
152 |
register_setting( 'agca-options-group', 'agca_header_logo_custom' );
|
153 |
register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
|
154 |
+
register_setting( 'agca-options-group', 'agca_remove_site_link' );
|
155 |
register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
|
156 |
|
157 |
register_setting( 'agca-options-group', 'agca_site_heading' );
|
270 |
'agca_remove_your_profile',
|
271 |
'agca_logout_only',
|
272 |
'agca_options_menu',
|
273 |
+
'agca_custom_title',
|
274 |
'agca_howdy',
|
275 |
'agca_header',
|
276 |
'agca_header_show_logout',
|
278 |
'agca_privacy_options',
|
279 |
'agca_header_logo',
|
280 |
'agca_header_logo_custom',
|
281 |
+
'agca_remove_site_link',
|
282 |
'agca_wp_logo_custom',
|
283 |
'agca_wp_logo_custom_link',
|
284 |
'agca_site_heading',
|
533 |
return $version;
|
534 |
}
|
535 |
|
536 |
+
function finalErrorCheck(){
|
537 |
+
?>
|
538 |
+
function AGCAErrorPage(){
|
539 |
+
if(document.getElementsByTagName('html')[0].style.visibility == ""){
|
540 |
+
var txt = "";
|
541 |
+
txt += 'AG Custom Admin Error\n\n\n';
|
542 |
+
txt += 'AG Custom Admin is unable to correctly process this page. Probably there are some errors thrown from some of the installed plugins or templates.\n\n\n';
|
543 |
+
txt += 'To resolve this issue please:\n\n';
|
544 |
+
txt += '* Check browser\'s console for errors. Analyse .js script location which throws the error. Location of the script can give you more information about where is the source of the problem. Usualy it is a location of a plugin or a template. If there are more than one error, usualy the first one is the one which caused this problem.\n\n';
|
545 |
+
txt += '* If you can\'t access your login page, please disable JavaScript in your browser. After you log in, you can remove or fix problematic plugin, and re-enable JavaScript again.\n\n';
|
546 |
+
txt += '* If you can\'t find the source of the problem by yourself, please post this error to AGCA WordPress.org support page(http://wordpress.org/extend/plugins/ag-custom-admin/) or to AGCA support page(http://agca.argonius.com/ag-custom-admin/)';
|
547 |
+
txt += '\n\nThank you.';
|
548 |
+
alert(txt);
|
549 |
+
}
|
550 |
+
}
|
551 |
+
window.setTimeout(AGCAErrorPage,4000);
|
552 |
+
<?php
|
553 |
+
}
|
554 |
+
|
555 |
function print_page()
|
556 |
{
|
557 |
+
if($this->isGuest()){
|
558 |
+
return false;
|
559 |
+
}
|
560 |
+
|
561 |
if(get_option('agca_admin_bar_frontend_hide')==true){
|
562 |
add_filter( 'show_admin_bar', '__return_false' );
|
563 |
?>
|
739 |
jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
|
740 |
}
|
741 |
<?php }?>
|
742 |
+
<?php if(get_option('agca_remove_site_link')==true){ ?>
|
743 |
+
jQuery("#wp-admin-bar-site-name").css("display","none");
|
744 |
+
|
745 |
+
<?php } ?>
|
746 |
<?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
|
747 |
if(isWPHigherOrEqualThan("3.3")){
|
748 |
var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
|
839 |
}
|
840 |
|
841 |
<?php } ?>
|
842 |
+
<?php
|
843 |
+
if(get_option('agca_custom_title')!=""){
|
844 |
+
//add_filter('admin_title', '$this->change_title', 10, 2);
|
845 |
+
|
846 |
+
}
|
847 |
+
?>
|
848 |
<?php if(get_option('agca_logout')!=""){ ?>
|
849 |
if(isWPHigherOrEqualThan("3.3")){
|
850 |
jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
|
945 |
$this->admin_capabilities();
|
946 |
$this->context = "admin";
|
947 |
get_currentuserinfo() ;
|
948 |
+
$wpversion = $this->get_wp_version();
|
|
|
|
|
949 |
?>
|
950 |
<?php
|
951 |
//in case that javaScript is disabled only admin can access admin menu
|
959 |
?>
|
960 |
<script type="text/javascript">
|
961 |
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
962 |
+
<?php $this->finalErrorCheck(); ?>
|
963 |
var wpversion = "<?php echo $wpversion; ?>";
|
964 |
var agca_version = "<?php echo $this->agca_version; ?>";
|
965 |
var errors = false;
|
999 |
<?php $checkboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'0'); ?>
|
1000 |
|
1001 |
var checkboxes = <?php echo "[".$checkboxes."]"; ?>;
|
1002 |
+
|
1003 |
<?php $textboxes = $this->jsonMenuArray(get_option('ag_edit_adminmenu_json'),'1'); ?>
|
1004 |
var textboxes = <?php echo "[".$textboxes."]"; ?>;
|
1005 |
|
1099 |
<?php if(get_option('agca_footer_left_hide')==true){ ?>
|
1100 |
jQuery("#footer-left").css("display","none");
|
1101 |
<?php } ?>
|
1102 |
+
<?php if(get_option('agca_footer_right')!=""){ ?>
|
1103 |
+
jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
|
1104 |
<?php } ?>
|
1105 |
<?php if(get_option('agca_footer_right_hide')==true){ ?>
|
1106 |
jQuery("#footer-upgrade").css("display","none");
|
1243 |
for(i=0; i< checkboxes.length ; i++){
|
1244 |
|
1245 |
if(checkboxes[i][0].indexOf("<-TOP->") >=0){ //if it is top item
|
1246 |
+
if(checkboxes[i][0].replace('<-TOP->','') == topmenuitem){//if found match in menu, with top item in array
|
1247 |
matchFound = true;
|
1248 |
//console.log(checkboxes[i][0]);
|
1249 |
//console.log(jQuery(this).find('.wp-menu-name').text());
|
1285 |
i++;
|
1286 |
}
|
1287 |
};
|
|
|
|
|
1288 |
}
|
1289 |
}
|
1290 |
//console.log(subMenus);
|
1345 |
} ?>
|
1346 |
|
1347 |
|
1348 |
+
/* ]]> */
|
|
|
1349 |
</script>
|
1350 |
<style type="text/css">
|
1351 |
.underline_text{
|
1369 |
$wpversion = $this->get_wp_version();
|
1370 |
?>
|
1371 |
|
1372 |
+
<script type="text/javascript">
|
1373 |
+
document.write('<style type="text/css">html{visibility:hidden;}</style>');
|
1374 |
+
<?php $this->finalErrorCheck(); ?>
|
1375 |
var agca_version = "<?php echo $this->agca_version; ?>";
|
1376 |
+
var wpversion = "<?php echo $wpversion; ?>";
|
1377 |
var isSettingsImport = false;
|
1378 |
var agca_context = "login";
|
1379 |
/* <![CDATA[ */
|
1492 |
}finally{
|
1493 |
|
1494 |
jQuery('html').show();
|
1495 |
+
jQuery('html').css('visibility','visible');
|
1496 |
|
1497 |
}
|
1498 |
});
|
1499 |
/* ]]> */
|
1500 |
+
|
1501 |
</script>
|
1502 |
<?php
|
1503 |
}
|
1630 |
<p><i>Put here a link for admin bar logo </i>.</p>
|
1631 |
</td>
|
1632 |
</tr>
|
1633 |
+
<tr valign="center">
|
1634 |
+
<th >
|
1635 |
+
<label title="Customize WordPress title using custom title template.</br></br>Examples:</br><strong>%BLOG% -- %PAGE%</strong> (will be) <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> (will be) <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> (will be) <i>My Company > My Blog > Tools</i>" for="agca_custom_title">Custom admin title template</label>
|
1636 |
+
</th>
|
1637 |
+
<td>
|
1638 |
+
<input title="" type="text" size="47" id="agca_custom_title" name="agca_custom_title" value="<?php echo get_option('agca_custom_title'); ?>" /><input type="button" class="agca_button" onClick="jQuery('#agca_custom_title').val('');" value="Clear" />
|
1639 |
+
<p><i>Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.</i></p>
|
1640 |
+
</td>
|
1641 |
+
</tr>
|
1642 |
<tr valign="center">
|
1643 |
<th >
|
1644 |
<label title="Add custom image on the top of admin content." for="agca_header_logo_custom">Custom header image</label>
|
1656 |
<input 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" '; ?> />
|
1657 |
</td>
|
1658 |
</tr>
|
1659 |
+
<?php if($wpversion>=3.3){?>
|
1660 |
+
<tr valign="center">
|
1661 |
+
<th >
|
1662 |
+
<label title="Hides site name section in admin bar" for="agca_remove_site_link">Hide site name in admin bar</label>
|
1663 |
+
</th>
|
1664 |
+
<td>
|
1665 |
+
<input title="Hides site name section in admin bar" type="checkbox" name="agca_remove_site_link" value="true" <?php if (get_option('agca_remove_site_link')==true) echo 'checked="checked" '; ?> />
|
1666 |
+
</td>
|
1667 |
+
</tr>
|
1668 |
<tr valign="center">
|
1669 |
<th >
|
1670 |
<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>
|
2505 |
</table>
|
2506 |
</div>
|
2507 |
<br /><br /><br />
|
2508 |
+
<p class="submit">
|
2509 |
+
<input type="button" id="save_plugin_settings" style="padding:0px" title="Save AG Custom Admin configuration" class="button-primary" value="<?php _e('Save Changes') ?>" onClick="savePluginSettings()" />
|
2510 |
</p>
|
2511 |
|
2512 |
</form>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://agca.argonius.com/ag-custom-admin/support-for-future-develop
|
|
4 |
Tags: admin, customize, hide, change admin
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 1.2.7
|
8 |
|
9 |
Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
|
10 |
|
4 |
Tags: admin, customize, hide, change admin
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.5.1
|
7 |
+
Stable tag: 1.2.7.1
|
8 |
|
9 |
Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
|
10 |
|
script/ag_script.js
CHANGED
@@ -211,7 +211,7 @@ function createEditMenuPageV35(checkboxes,textboxes){
|
|
211 |
sub_item_text_value = textboxes[counter][1];
|
212 |
isHidden = checkboxes[counter][1];
|
213 |
}
|
214 |
-
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>");
|
215 |
counter++;
|
216 |
}
|
217 |
//if top element
|
@@ -226,10 +226,10 @@ function createEditMenuPageV35(checkboxes,textboxes){
|
|
226 |
if(textboxes ==""){
|
227 |
top_item_text_value = topElement;
|
228 |
}else{
|
229 |
-
top_item_text_value = textboxes[counter][1];
|
230 |
isHidden = checkboxes[counter][1];
|
231 |
-
}
|
232 |
-
jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_parent'><br /><span class=\"agcaMenuEditorPlusMinus\"><span class=\"plus\">+</span><span class=\"minus\">-</span></span><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>");
|
233 |
counter++;
|
234 |
}
|
235 |
|
@@ -599,8 +599,8 @@ function processData(){
|
|
599 |
if(jQuery(this).parent().hasClass('ag_admin_menu_parent2')){
|
600 |
topMarker="<-TOP->";
|
601 |
}
|
602 |
-
array += "\"" + topMarker
|
603 |
-
array += "\"" + jQuery(this).val() + "\"";
|
604 |
firstElement = false;
|
605 |
});
|
606 |
array += "}";
|
@@ -610,6 +610,7 @@ function processData(){
|
|
610 |
}else{
|
611 |
jQuery('#ag_edit_adminmenu_json').val('');
|
612 |
}
|
|
|
613 |
//console.log(array);
|
614 |
//serialize buttons
|
615 |
array = "{";
|
@@ -648,13 +649,25 @@ function processData(){
|
|
648 |
array += "\"" + jQuery(this).val() + "\"";
|
649 |
firstElement = false;
|
650 |
});
|
651 |
-
array += "}";
|
652 |
|
653 |
if(!isSettingsImport){
|
654 |
jQuery('#ag_colorizer_json').val(array);
|
655 |
}
|
656 |
}
|
657 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
658 |
/*C O L O R I Z E R*/
|
659 |
function updateTargetColor(id, color){
|
660 |
switch(id)
|
211 |
sub_item_text_value = textboxes[counter][1];
|
212 |
isHidden = checkboxes[counter][1];
|
213 |
}
|
214 |
+
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=\""+agca_escapeHTMLChars(sub_item_text_value)+"\" name=\"ag_edit_adminmenu_item_sub_"+counter+"\" /></td></tr>");
|
215 |
counter++;
|
216 |
}
|
217 |
//if top element
|
226 |
if(textboxes ==""){
|
227 |
top_item_text_value = topElement;
|
228 |
}else{
|
229 |
+
top_item_text_value = textboxes[counter][1];
|
230 |
isHidden = checkboxes[counter][1];
|
231 |
+
}
|
232 |
+
jQuery('#ag_edit_adminmenu').append("<tr><td class='ag_admin_menu_parent'><br /><span class=\"agcaMenuEditorPlusMinus\"><span class=\"plus\">+</span><span class=\"minus\">-</span></span><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=\""+agca_escapeHTMLChars(top_item_text_value)+"\" name=\"ag_edit_adminmenu_item_top_"+counter+"\" /></td></tr>");
|
233 |
counter++;
|
234 |
}
|
235 |
|
599 |
if(jQuery(this).parent().hasClass('ag_admin_menu_parent2')){
|
600 |
topMarker="<-TOP->";
|
601 |
}
|
602 |
+
array += "\"" + topMarker + jQuery(this).attr('class') + "\" : ";
|
603 |
+
array += "\"" + agca_escapeChars(jQuery(this).val()) + "\"";
|
604 |
firstElement = false;
|
605 |
});
|
606 |
array += "}";
|
610 |
}else{
|
611 |
jQuery('#ag_edit_adminmenu_json').val('');
|
612 |
}
|
613 |
+
//console.clear();
|
614 |
//console.log(array);
|
615 |
//serialize buttons
|
616 |
array = "{";
|
649 |
array += "\"" + jQuery(this).val() + "\"";
|
650 |
firstElement = false;
|
651 |
});
|
652 |
+
array += "}";
|
653 |
|
654 |
if(!isSettingsImport){
|
655 |
jQuery('#ag_colorizer_json').val(array);
|
656 |
}
|
657 |
}
|
658 |
|
659 |
+
function agca_escapeHTMLChars(str){
|
660 |
+
return str
|
661 |
+
.replace(/&/g, '&')
|
662 |
+
.replace(/'/g, ''')
|
663 |
+
.replace(/"/g, '"');
|
664 |
+
}
|
665 |
+
|
666 |
+
function agca_escapeChars(str){
|
667 |
+
return str.replace(/[\/\\\"\']/g, "\\$&");
|
668 |
+
//return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
669 |
+
}
|
670 |
+
|
671 |
/*C O L O R I Z E R*/
|
672 |
function updateTargetColor(id, color){
|
673 |
switch(id)
|
style/ag_style.css
CHANGED
@@ -159,12 +159,15 @@ td.ag_admin_menu_parent:hover{
|
|
159 |
padding: 3px 10px;
|
160 |
background-color:#ffffff;
|
161 |
} */
|
162 |
-
#agca_form input[type=button],button{
|
163 |
-
|
164 |
-
|
|
|
|
|
165 |
}
|
166 |
#agca_form input[type=button]:hover{
|
167 |
background-color:#e8fae5;
|
|
|
168 |
color:green;
|
169 |
cursor:pointer;
|
170 |
}
|
@@ -191,6 +194,20 @@ td.ag_admin_menu_parent:hover{
|
|
191 |
#agca_form #ag_add_adminmenu input[type=text]{
|
192 |
width:300px;
|
193 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
#agca_form input#save_plugin_settings[type="button"]:hover{
|
195 |
background-color:#ffffff;
|
196 |
color:#ffffff;
|
159 |
padding: 3px 10px;
|
160 |
background-color:#ffffff;
|
161 |
} */
|
162 |
+
#agca_form input[type=button],button{
|
163 |
+
background-color: #275928;
|
164 |
+
border: 1px solid #275928;
|
165 |
+
color: #FFFFFF;
|
166 |
+
padding: 5px 10px;
|
167 |
}
|
168 |
#agca_form input[type=button]:hover{
|
169 |
background-color:#e8fae5;
|
170 |
+
border: 1px solid #aaa;
|
171 |
color:green;
|
172 |
cursor:pointer;
|
173 |
}
|
194 |
#agca_form #ag_add_adminmenu input[type=text]{
|
195 |
width:300px;
|
196 |
}
|
197 |
+
#agca_form input#save_plugin_settings{
|
198 |
+
background: none repeat scroll 0 0 #275928;
|
199 |
+
font-weight: bold;
|
200 |
+
height: 39px;
|
201 |
+
padding: 4px;
|
202 |
+
width: 130px;
|
203 |
+
border:1px solid #aaaaaa !important;
|
204 |
+
text-shadow: none !important;
|
205 |
+
box-shadow: none !important;
|
206 |
+
}
|
207 |
+
#agca_form input#save_plugin_settings:hover{
|
208 |
+
background-color:#E8FAE5 !important;
|
209 |
+
color:#275928 !important;
|
210 |
+
}
|
211 |
#agca_form input#save_plugin_settings[type="button"]:hover{
|
212 |
background-color:#ffffff;
|
213 |
color:#ffffff;
|