Absolutely Glamorous Custom Admin - Version 1.2.5.3

Version Description

  • Fixed issues related to WP 3.3.1 version
  • Fixed bug: Hidding/changing top admin bar WP icon
  • Advanced customization of admin top bar
  • Added options for hiding admin top bar elements
  • Login page background same as admin background
  • Added target options for custom admin buttons
Download this release

Release Info

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

Code changes from version 1.2.5.2 to 1.2.5.3

Files changed (4) hide show
  1. plugin.php +263 -115
  2. readme.txt +13 -2
  3. script/ag_script.js +152 -10
  4. style/ag_style.css +1 -0
plugin.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpress.org/extend/plugins/ag-custom-admin
5
  Description: Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
6
  Author: Argonius
7
- Version: 1.2.5.2
8
  Author URI: http://wordpress.argonius.com/ag-custom-admin
9
 
10
  Copyright 2011. Argonius (email : info@argonius.com)
@@ -23,18 +23,22 @@ Author URI: http://wordpress.argonius.com/ag-custom-admin
23
  along with this program. If not, see <http://www.gnu.org/licenses/>.
24
  */
25
 
 
 
 
26
  $agca = new AGCA();
27
 
28
  class AGCA{
29
  private $colorizer="";
30
  private $active_plugin;
 
31
  public function __construct()
32
- {
33
-
34
 
35
  add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
36
  add_action('admin_init', array(&$this,'agca_register_settings'));
37
- add_action('admin_head', array(&$this,'print_admin_css'));
 
38
  add_action('login_head', array(&$this,'print_login_head'));
39
  add_action('admin_menu', array(&$this,'agca_create_menu'));
40
  register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
@@ -44,7 +48,8 @@ class AGCA{
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)
@@ -99,6 +104,7 @@ class AGCA{
99
  register_setting( 'agca-options-group', 'agca_privacy_options' );
100
  register_setting( 'agca-options-group', 'agca_header_logo' );
101
  register_setting( 'agca-options-group', 'agca_header_logo_custom' );
 
102
  register_setting( 'agca-options-group', 'agca_site_heading' );
103
  register_setting( 'agca-options-group', 'agca_custom_site_heading' );
104
  register_setting( 'agca-options-group', 'agca_update_bar' );
@@ -130,6 +136,13 @@ class AGCA{
130
  //WP3.3
131
  register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
132
  register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
 
 
 
 
 
 
 
133
 
134
 
135
  /*Admin menu*/
@@ -160,6 +173,7 @@ class AGCA{
160
  delete_option( 'agca_privacy_options' );
161
  delete_option( 'agca_header_logo' );
162
  delete_option( 'agca_header_logo_custom' );
 
163
  delete_option( 'agca_site_heading' );
164
  delete_option( 'agca_custom_site_heading' );
165
  delete_option( 'agca_update_bar' );
@@ -191,6 +205,13 @@ class AGCA{
191
  //WP3.3
192
  delete_option( 'agca_admin_bar_comments' );
193
  delete_option( 'agca_admin_bar_new_content' );
 
 
 
 
 
 
 
194
 
195
  /*Admin menu*/
196
  delete_option( 'agca_admin_menu_turnonoff' );
@@ -208,10 +229,14 @@ class AGCA{
208
  add_management_page( 'AG Custom Admin', 'AG Custom Admin', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
209
  }
210
 
211
- function agca_create_admin_button($name,$href) {
212
  $class="";
 
 
213
  if($name == 'AG Custom Admin'){
214
  $class="agca_button_only";
 
 
215
  }
216
  $button ="";
217
  $button .= '<li id="menu-'.$name.'" class="ag-custom-button menu-top menu-top-first '.$class.' menu-top-last">';
@@ -219,7 +244,7 @@ class AGCA{
219
  <a href="edit-comments.php"><br></a>
220
  </div>*/
221
  $button .= '<div class="wp-menu-toggle" style="display: none;"><br></div>';
222
- $button .= '<a tabindex="1" class="menu-top menu-top-last" href="'.$href.'">'.$name.'<a>';
223
  $button .= '</li>';
224
 
225
  return $button;
@@ -254,7 +279,7 @@ class AGCA{
254
  $elements = json_decode($arr[0],true);
255
  if($elements !=""){
256
  foreach($elements as $k => $v){
257
- $array.='<tr><td colspan="2"><button title="'.$v.'" type="button">'.$k.'</button>&nbsp;(<a style="cursor:pointer" class="button_edit">edit</a>)&nbsp;(<a style="cursor:pointer" class="button_remove">remove</a>)</td><td></td></tr>';
258
  }
259
  }
260
  }else{
@@ -288,6 +313,15 @@ class AGCA{
288
  $version = $array[0];
289
  return $version;
290
  }
 
 
 
 
 
 
 
 
 
291
 
292
  function print_admin_css()
293
  {
@@ -311,7 +345,7 @@ class AGCA{
311
  <script type="text/javascript">
312
  document.write('<style type="text/css">html{visibility:hidden;}</style>');
313
  var wpversion = "<?php echo $wpversion; ?>";
314
- var agca_version = "1.2.5.2";
315
  var errors = false;
316
 
317
  /* <![CDATA[ */
@@ -349,7 +383,8 @@ try
349
  var buttons = '<?php echo $buttons; ?>';
350
 
351
  <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
352
- var buttonsJq = '<?php echo $buttonsJq; ?>';
 
353
 
354
  <?php if($wpversion >=3.2 ){ ?>
355
  createEditMenuPageV32(checkboxes,textboxes);
@@ -359,9 +394,26 @@ try
359
 
360
  <?php
361
  //if admin, and option to hide settings for admin is set
 
362
  if((get_option('agca_role_allbutadmin')==true) and ($user_level > 9)){
363
  ?>
364
  <?php } else{ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
 
366
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
367
  jQuery("#screen-options-link-wrap").css("display","none");
@@ -377,161 +429,171 @@ try
377
  jQuery("#privacy-on-link").css("display","none");
378
  <?php } ?>
379
  <?php if(get_option('agca_header_logo')==true){ ?>
380
- jQuery("#wphead #header-logo").css("display","none");
381
- if(wpversion=="3.3"){
382
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
383
- }
384
  <?php } ?>
385
  <?php if(get_option('agca_header_logo_custom')!=""){ ?>
386
 
387
- <?php if($wpversion < 3.3 ){ ?>
388
- jQuery("#wphead img#header-logo").attr('src','');
389
- jQuery("#wphead img#header-logo").hide();
390
- var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
391
- advanced_url = img_url+ "?" + new Date().getTime();
392
- image = jQuery("<img />").attr("src",advanced_url);
393
- jQuery(image).load(function() {
394
- jQuery("#wphead img#header-logo").attr('src', advanced_url);
395
- jQuery("#wphead img#header-logo").attr('width',this.width);
396
- jQuery("#wphead img#header-logo").attr('height',this.height);
397
- jQuery("#wphead").css('height', (14 + this.height)+'px');
398
- jQuery("#wphead img#header-logo").show();
399
- });
400
- <?php } else {?>
401
  var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
402
- //advanced_url = img_url+ "?" + new Date().getTime();
403
  advanced_url = img_url;
404
  image = jQuery("<img />").attr("src",advanced_url);
 
 
 
 
 
 
 
 
 
405
  jQuery(image).load(function() {
406
- /*jQuery("#wphead img#header-logo").attr('src', advanced_url);
407
  jQuery("#wphead img#header-logo").attr('width',this.width);
408
  jQuery("#wphead img#header-logo").attr('height',this.height);
409
  jQuery("#wphead").css('height', (14 + this.height)+'px');
410
- jQuery("#wphead img#header-logo").show();*/
411
- jQuery("#wpbody-content").prepend(image);
412
  });
413
- <?php } ?>
414
 
415
- <?php } ?>
 
 
 
 
 
 
416
  <?php if(get_option('agca_site_heading')==true){ ?>
417
  jQuery("#wphead #site-heading").css("display","none");
418
  <?php } ?>
419
  <?php if(get_option('agca_custom_site_heading')!=""){ ?>
420
  jQuery("#wphead #site-heading").after('<h1><?php echo get_option('agca_custom_site_heading'); ?></h1>');
421
  //3.3FIX
422
- if(wpversion=="3.3"){
423
  jQuery("#wp-admin-bar-site-name a:first").html('<?php echo get_option('agca_custom_site_heading'); ?>');
424
  }
425
  <?php } ?>
426
 
427
- <?php if($wpversion >="3.3"){ ?>
428
  <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
429
  jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
430
  <?php } ?>
431
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
432
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
433
  <?php } ?>
434
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
 
436
  <?php if(get_option('agca_update_bar')==true){ ?>
437
  jQuery("#update-nag").css("display","none");
438
  jQuery(".update-nag").css("display","none");
439
  <?php } ?>
440
  <?php if(get_option('agca_header')==true){ ?>
441
- jQuery("#wphead").css("display","none");
442
-
443
  //3.3FIX
444
- jQuery("#wpadminbar").css("display","none");
445
- <?php } ?>
446
- <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
447
- var clon ="";
448
- jQuery("div#user_info a").each(function(){
449
- if(jQuery(this).text() =="Log Out"){
450
- clon = jQuery(this).clone();
451
- }
452
- });
453
- if(clon !=""){
454
- jQuery(clon).attr('style','float:right;padding:15px');
455
- jQuery(clon).html('<?php echo ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout')); ?>');
456
- }
457
- jQuery("#wphead").after(clon);
458
 
459
- //3.3.FIX
460
- if(wpversion == "3.3"){
461
- jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item">Log Out</a>');
462
-
 
 
 
 
 
 
 
 
 
 
 
 
 
463
  }
464
 
465
  <?php } ?>
466
  <?php if(get_option('agca_footer')==true){ ?>
467
  jQuery("#footer").css("display","none");
468
  <?php } ?>
469
- <?php if(get_option('agca_howdy')!=""){ ?>
470
- <?php //code for wp version >= 3.2 ?>
471
- <?php if($wpversion >= 3.2 && $wpversion < 3.3){ ?>
472
  var alltext="";
473
  alltext="";
474
- alltext = jQuery('#user_info div.hide-if-no-js').html();
475
  alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
476
- jQuery("#user_info div.hide-if-no-js").html(alltext);
477
-
478
- <?php }
479
- //3.3FIX
480
- else if($wpversion == 3.3){ ?>
481
  var alltext="";
482
  alltext="";
483
- alltext = jQuery('li#wp-admin-bar-my-account').html();
484
  alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
485
- jQuery("li#wp-admin-bar-my-account").html(alltext);
486
- <?php }else{ ?>
487
- <?php //code for wp version < 3.2 ?>
488
- var howdyText = jQuery("#user_info").html();
489
- if(howdyText !=null){
490
  jQuery("#user_info").html("<p>"+"<?php echo get_option('agca_howdy'); ?>"+howdyText.substr(9));
491
- }
492
- <?php } ?>
493
  <?php } ?>
494
- <?php if(get_option('agca_logout')!=""){ ?>
495
- <?php //code for wp version >= 3.2 ?>
496
- <?php if($wpversion >= 3.2 ){ ?>
497
- jQuery("#user_info #user_info_links a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
498
- <?php }
499
- if($wpversion >= 3.3 ){ ?>
500
  jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
501
- <?php }
502
- if($wpversion < 3.2){ ?>
503
- <?php //code for wp version < 3.2 ?>
504
  jQuery("#user_info a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
505
- <?php } ?>
 
506
  <?php } ?>
507
- <?php if(get_option('agca_remove_your_profile')==true){ ?>
508
- <?php if($wpversion >= 3.2 ){ ?>
509
- jQuery("#user_info #user_info_links li:eq(0)").remove();
510
- <?php }?>
511
- <?php if($wpversion >= 3.3 ){ ?>
512
  jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
513
  jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
514
- <?php }?>
 
 
515
  <?php } ?>
516
  <?php if(get_option('agca_logout_only')==true){ ?>
517
- <?php //code for wp version >= 3.2 ?>
518
- <?php if($wpversion >= 3.2 ){ ?>
 
 
519
  var logoutText = jQuery("#user_info a:nth-child(2)").text();
520
  <?php if(get_option('agca_logout')!=""){ ?>
521
  logoutText = "<?php echo get_option('agca_logout'); ?>";
522
  <?php } ?>
523
  var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
524
  jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
525
- <?php } ?>
526
- <?php if($wpversion >= 3.3 ){ ?>
527
- var logout_content = jQuery("li#wp-admin-bar-logout").html();
528
- jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
529
- <?php } ?>
530
- <?php if($wpversion < 3.2){ ?>
531
  var logoutText = jQuery("#user_info a:nth-child(2)").text();
532
  var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
533
  jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
534
- <?php } ?>
535
  <?php } ?>
536
 
537
 
@@ -777,7 +839,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
777
 
778
  <script type="text/javascript">
779
  document.write('<style type="text/css">html{display:none;}</style>');
780
- var agca_version = "1.2.5.2";
781
  var wpversion = "<?php echo $wpversion; ?>";
782
  /* <![CDATA[ */
783
  jQuery(document).ready(function() {
@@ -817,25 +879,40 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
817
  <?php //COLORIZER ?>
818
  <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
819
  jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
820
- <?php
821
-
 
 
 
 
822
  if($this->colorizer['color_background']!=""){
823
  ?>
824
- updateTargetColor("color_background","<?php echo $this->colorizer['color_background'];?>");
 
825
  <?php
826
  }
827
  if($this->colorizer['color_header']!=""){
828
  ?>
829
  <?php if($wpversion < 3.2){ ?>
830
  jQuery("#backtoblog").css("background","<?php echo $this->colorizer['color_header'];?>");
 
831
  <?php } ?>
832
  <?php
833
  }
834
  if($this->colorizer['color_font_header']!=""){
835
  ?>
836
  jQuery("#backtoblog a,#backtoblog p").css("color","<?php echo $this->colorizer['color_font_header'];?>");
 
837
  <?php
838
- }
 
 
 
 
 
 
 
 
839
  } ?>
840
  <?php //COLORIZER END ?>
841
  }catch(err){
@@ -864,7 +941,7 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
864
  <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js"></script>
865
  <?php //includes ?>
866
  <div class="wrap">
867
- <h1 style="color:green">AG Custom Admin Settings <span style="font-size:15px;">(v1.2.5.2)</span></h1>
868
  <div id="agca_news">&nbsp;</div><br />
869
  <form method="post" id="agca_form" action="options.php">
870
  <?php settings_fields( 'agca-options-group' ); ?>
@@ -905,10 +982,10 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
905
  </tr>
906
  <tr valign="center" class="ag_table_major_options" >
907
  <td>
908
- <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>
909
  </td>
910
  <td>
911
- <input type="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" '; ?> />
912
  </td>
913
  </tr>
914
  <tr valign="center">
@@ -929,11 +1006,20 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
929
  <?php } ?>
930
  <tr valign="center">
931
  <th >
932
- <label title="Change default WordPress logo with custom image." for="agca_header_logo_custom">Change WordPress logo</label>
933
  </th>
934
  <td>
935
- <input title="If this field is not empty, image from provided url will be visible in top bar" type="text" size="47" name="agca_header_logo_custom" value="<?php echo get_option('agca_header_logo_custom'); ?>" />
936
- &nbsp;<p><i>Put here link of new top bar photo</i>.</p>
 
 
 
 
 
 
 
 
 
937
  </td>
938
  </tr>
939
  <tr valign="center">
@@ -947,19 +1033,75 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
947
  <?php if($wpversion>=3.3){?>
948
  <tr valign="center">
949
  <th >
950
- <label title="Removes comments block from admin bar" for="agca_admin_bar_comments">Hide admin bar comments</label>
951
  </th>
952
  <td>
953
- <input title="Removes comments block from admin bar" type="checkbox" name="agca_admin_bar_comments" value="true" <?php if (get_option('agca_admin_bar_comments')==true) echo 'checked="checked" '; ?> />
954
  </td>
955
  </tr>
956
  <tr valign="center">
957
  <th >
958
- <label title="Removes 'New' block with its contents from admin bar" for="agca_admin_bar_new_content">Hide admin bar new content</label>
 
 
 
 
 
 
 
 
959
  </th>
960
  <td>
961
  <input title="Removes 'New' block with its contents from admin bar" type="checkbox" name="agca_admin_bar_new_content" value="true" <?php if (get_option('agca_admin_bar_new_content')==true) echo 'checked="checked" '; ?> />
962
  </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
963
  </tr>
964
  <?php } ?>
965
 
@@ -1362,6 +1504,12 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1362
  <td colspan="2">
1363
  name:<input type="text" size="47" title="New button visible name" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
1364
  url:<input type="text" size="47" title="New button link" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
 
 
 
 
 
 
1365
  <button type="button" id="ag_add_adminmenu_button" title="Add new item button" name="ag_add_adminmenu_button">Add new item</button>
1366
  </td><td></td>
1367
  </tr>
4
  Plugin URI: http://wordpress.org/extend/plugins/ag-custom-admin
5
  Description: Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
6
  Author: Argonius
7
+ Version: 1.2.5.3
8
  Author URI: http://wordpress.argonius.com/ag-custom-admin
9
 
10
  Copyright 2011. Argonius (email : info@argonius.com)
23
  along with this program. If not, see <http://www.gnu.org/licenses/>.
24
  */
25
 
26
+ require_once('/../../../../FirePHPCore/lib/FirePHPCore/fb.php');
27
+ //fb($var);
28
+
29
  $agca = new AGCA();
30
 
31
  class AGCA{
32
  private $colorizer="";
33
  private $active_plugin;
34
+ private $agca_version;
35
  public function __construct()
36
+ {
 
37
 
38
  add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
39
  add_action('admin_init', array(&$this,'agca_register_settings'));
40
+ add_action('admin_head', array(&$this,'print_admin_css'));
41
+ add_action('wp_head', array(&$this,'print_page'));
42
  add_action('login_head', array(&$this,'print_login_head'));
43
  add_action('admin_menu', array(&$this,'agca_create_menu'));
44
  register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
48
  // add_action('login_head', array(&$this,'agca_get_styles'));
49
 
50
  /*Initialize properties*/
51
+ $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
52
+ $this->agca_version = "1.2.5.3";
53
  }
54
  // Add donate and support information
55
  function jk_filter_plugin_links($links, $file)
104
  register_setting( 'agca-options-group', 'agca_privacy_options' );
105
  register_setting( 'agca-options-group', 'agca_header_logo' );
106
  register_setting( 'agca-options-group', 'agca_header_logo_custom' );
107
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
108
  register_setting( 'agca-options-group', 'agca_site_heading' );
109
  register_setting( 'agca-options-group', 'agca_custom_site_heading' );
110
  register_setting( 'agca-options-group', 'agca_update_bar' );
136
  //WP3.3
137
  register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
138
  register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
139
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_post' );
140
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_link' );
141
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_page' );
142
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_user' );
143
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_media' );
144
+ register_setting( 'agca-options-group', 'agca_admin_bar_update_notifications' );
145
+ register_setting( 'agca-options-group', 'agca_remove_top_bar_dropdowns' );
146
 
147
 
148
  /*Admin menu*/
173
  delete_option( 'agca_privacy_options' );
174
  delete_option( 'agca_header_logo' );
175
  delete_option( 'agca_header_logo_custom' );
176
+ delete_option( 'agca_wp_logo_custom' );
177
  delete_option( 'agca_site_heading' );
178
  delete_option( 'agca_custom_site_heading' );
179
  delete_option( 'agca_update_bar' );
205
  //WP3.3
206
  delete_option( 'agca_admin_bar_comments' );
207
  delete_option( 'agca_admin_bar_new_content' );
208
+ delete_option( 'agca_admin_bar_new_content_post' );
209
+ delete_option( 'agca_admin_bar_new_content_link' );
210
+ delete_option( 'agca_admin_bar_new_content_page' );
211
+ delete_option( 'agca_admin_bar_new_content_user' );
212
+ delete_option( 'agca_admin_bar_new_content_media' );
213
+ delete_option( 'agca_admin_bar_update_notifications' );
214
+ delete_option( 'agca_remove_top_bar_dropdowns' );
215
 
216
  /*Admin menu*/
217
  delete_option( 'agca_admin_menu_turnonoff' );
229
  add_management_page( 'AG Custom Admin', 'AG Custom Admin', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
230
  }
231
 
232
+ function agca_create_admin_button($name,$arr) {
233
  $class="";
234
+ $href = $arr["value"];
235
+ $target =$arr["target"];;
236
  if($name == 'AG Custom Admin'){
237
  $class="agca_button_only";
238
+ $target = "_self";
239
+ $href = $arr;
240
  }
241
  $button ="";
242
  $button .= '<li id="menu-'.$name.'" class="ag-custom-button menu-top menu-top-first '.$class.' menu-top-last">';
244
  <a href="edit-comments.php"><br></a>
245
  </div>*/
246
  $button .= '<div class="wp-menu-toggle" style="display: none;"><br></div>';
247
+ $button .= '<a tabindex="1" target="'.$target.'" class="menu-top menu-top-last" href="'.$href.'">'.$name.'<a>';
248
  $button .= '</li>';
249
 
250
  return $button;
279
  $elements = json_decode($arr[0],true);
280
  if($elements !=""){
281
  foreach($elements as $k => $v){
282
+ $array.='<tr><td colspan="2"><button target="'.$v["target"].'" title="'.$v["value"].'" type="button">'.$k.'</button>&nbsp;(<a style="cursor:pointer" class="button_edit">edit</a>)&nbsp;(<a style="cursor:pointer" class="button_remove">remove</a>)</td><td></td></tr>';
283
  }
284
  }
285
  }else{
313
  $version = $array[0];
314
  return $version;
315
  }
316
+
317
+ function print_page()
318
+ {
319
+ ?><style type="text/css">
320
+ #wpadminbar{
321
+ display:none;
322
+ }
323
+ </style><?php
324
+ }
325
 
326
  function print_admin_css()
327
  {
345
  <script type="text/javascript">
346
  document.write('<style type="text/css">html{visibility:hidden;}</style>');
347
  var wpversion = "<?php echo $wpversion; ?>";
348
+ var agca_version = "<?php echo $this->agca_version; ?>";
349
  var errors = false;
350
 
351
  /* <![CDATA[ */
383
  var buttons = '<?php echo $buttons; ?>';
384
 
385
  <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
386
+ var buttonsJq = '<?php echo $buttonsJq; ?>';
387
+
388
 
389
  <?php if($wpversion >=3.2 ){ ?>
390
  createEditMenuPageV32(checkboxes,textboxes);
394
 
395
  <?php
396
  //if admin, and option to hide settings for admin is set
397
+ //fb($user_level);
398
  if((get_option('agca_role_allbutadmin')==true) and ($user_level > 9)){
399
  ?>
400
  <?php } else{ ?>
401
+
402
+ if(isWPHigherOrEqualThan("3.3")){
403
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
404
+
405
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").hover("visibility","hidden");
406
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo a").attr("href","");
407
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo a").attr("title","");
408
+
409
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-site-name").hover("visibility","hidden");
410
+
411
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
412
+ jQuery(".new_content_header_submenu").hide();
413
+ <?php } ?>
414
+
415
+ <?php } ?>
416
+ }
417
 
418
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
419
  jQuery("#screen-options-link-wrap").css("display","none");
429
  jQuery("#privacy-on-link").css("display","none");
430
  <?php } ?>
431
  <?php if(get_option('agca_header_logo')==true){ ?>
432
+ jQuery("#wphead #header-logo").css("display","none");
433
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
434
+
 
435
  <?php } ?>
436
  <?php if(get_option('agca_header_logo_custom')!=""){ ?>
437
 
438
+
439
+ if(isWPHigherOrEqualThan("3.3")){
 
 
 
 
 
 
 
 
 
 
 
 
440
  var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
441
+
442
  advanced_url = img_url;
443
  image = jQuery("<img />").attr("src",advanced_url);
444
+ jQuery(image).load(function() {
445
+ jQuery("#wpbody-content").prepend(image);
446
+ });
447
+ }else{
448
+ jQuery("#wphead img#header-logo").attr('src','');
449
+ jQuery("#wphead img#header-logo").hide();
450
+ var img_url = '<?php echo get_option('agca_header_logo_custom'); ?>';
451
+ advanced_url = img_url+ "?" + new Date().getTime();
452
+ image = jQuery("<img />").attr("src",advanced_url);
453
  jQuery(image).load(function() {
454
+ jQuery("#wphead img#header-logo").attr('src', advanced_url);
455
  jQuery("#wphead img#header-logo").attr('width',this.width);
456
  jQuery("#wphead img#header-logo").attr('height',this.height);
457
  jQuery("#wphead").css('height', (14 + this.height)+'px');
458
+ jQuery("#wphead img#header-logo").show();
 
459
  });
460
+ }
461
 
462
+ <?php } ?>
463
+ <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
464
+ if(isWPHigherOrEqualThan("3.3")){
465
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css("background-image","url('<?php echo get_option('agca_wp_logo_custom'); ?>')");
466
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css("background-position","0");
467
+ }
468
+ <?php }?>
469
  <?php if(get_option('agca_site_heading')==true){ ?>
470
  jQuery("#wphead #site-heading").css("display","none");
471
  <?php } ?>
472
  <?php if(get_option('agca_custom_site_heading')!=""){ ?>
473
  jQuery("#wphead #site-heading").after('<h1><?php echo get_option('agca_custom_site_heading'); ?></h1>');
474
  //3.3FIX
475
+ if(isWPHigherOrEqualThan("3.3")){
476
  jQuery("#wp-admin-bar-site-name a:first").html('<?php echo get_option('agca_custom_site_heading'); ?>');
477
  }
478
  <?php } ?>
479
 
480
+ if(isWPHigherOrEqualThan("3.3")){
481
  <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
482
  jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
483
  <?php } ?>
484
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
485
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
486
  <?php } ?>
487
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
488
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
489
+ <?php } ?>
490
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
491
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
492
+ <?php } ?>
493
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
494
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
495
+ <?php } ?>
496
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
497
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
498
+ <?php } ?>
499
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
500
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
501
+ <?php } ?>
502
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
503
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
504
+ <?php } ?>
505
+ }
506
 
507
  <?php if(get_option('agca_update_bar')==true){ ?>
508
  jQuery("#update-nag").css("display","none");
509
  jQuery(".update-nag").css("display","none");
510
  <?php } ?>
511
  <?php if(get_option('agca_header')==true){ ?>
512
+
 
513
  //3.3FIX
514
+ if(isWPHigherOrEqualThan("3.3")){
515
+ jQuery("#wpadminbar").css("display","none");
516
+ }else{
517
+ jQuery("#wphead").css("display","none");
518
+ }
 
 
 
 
 
 
 
 
 
519
 
520
+ <?php } ?>
521
+ <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
522
+
523
+ if(isWPHigherOrEqualThan("3.3")){
524
+ jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item">Log Out</a>');
525
+ }else{
526
+ var clon ="";
527
+ jQuery("div#user_info a").each(function(){
528
+ if(jQuery(this).text() =="Log Out"){
529
+ clon = jQuery(this).clone();
530
+ }
531
+ });
532
+ if(clon !=""){
533
+ jQuery(clon).attr('style','float:right;padding:15px');
534
+ jQuery(clon).html('<?php echo ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout')); ?>');
535
+ }
536
+ jQuery("#wphead").after(clon);
537
  }
538
 
539
  <?php } ?>
540
  <?php if(get_option('agca_footer')==true){ ?>
541
  jQuery("#footer").css("display","none");
542
  <?php } ?>
543
+ <?php if(get_option('agca_howdy')!=""){ ?>
544
+ if(isWPHigherOrEqualThan("3.3")){
 
545
  var alltext="";
546
  alltext="";
547
+ alltext = jQuery('li#wp-admin-bar-my-account').html();
548
  alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
549
+ jQuery("li#wp-admin-bar-my-account").html(alltext);
550
+ }else if(isWPHigherOrEqualThan("3.2")){
 
 
 
551
  var alltext="";
552
  alltext="";
553
+ alltext = jQuery('#user_info div.hide-if-no-js').html();
554
  alltext = alltext.replace('Howdy',"<?php echo get_option('agca_howdy'); ?>");
555
+ jQuery("#user_info div.hide-if-no-js").html(alltext);
556
+ }else{
557
+ var howdyText = jQuery("#user_info").html();
558
+ if(howdyText !=null){
 
559
  jQuery("#user_info").html("<p>"+"<?php echo get_option('agca_howdy'); ?>"+howdyText.substr(9));
560
+ }
561
+ }
562
  <?php } ?>
563
+ <?php if(get_option('agca_logout')!=""){ ?>
564
+ if(isWPHigherOrEqualThan("3.3")){
 
 
 
 
565
  jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
566
+ }else if(isWPHigherOrEqualThan("3.2")){
567
+ jQuery("#user_info #user_info_links a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
568
+ }else{
569
  jQuery("#user_info a:eq(1)").text("<?php echo get_option('agca_logout'); ?>");
570
+ }
571
+
572
  <?php } ?>
573
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
574
+ if(isWPHigherOrEqualThan("3.3")){
 
 
 
575
  jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
576
  jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
577
+ }else if(isWPHigherOrEqualThan("3.2")){
578
+ jQuery("#user_info #user_info_links li:eq(0)").remove();
579
+ }
580
  <?php } ?>
581
  <?php if(get_option('agca_logout_only')==true){ ?>
582
+ if(isWPHigherOrEqualThan("3.3")){
583
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
584
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout">'+ logout_content +'</li>');
585
+ }else if(isWPHigherOrEqualThan("3.2")){
586
  var logoutText = jQuery("#user_info a:nth-child(2)").text();
587
  <?php if(get_option('agca_logout')!=""){ ?>
588
  logoutText = "<?php echo get_option('agca_logout'); ?>";
589
  <?php } ?>
590
  var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
591
  jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
592
+ }else{
 
 
 
 
 
593
  var logoutText = jQuery("#user_info a:nth-child(2)").text();
594
  var logoutLink = jQuery("#user_info a:nth-child(2)").attr("href");
595
  jQuery("#user_info").html("<a href=\""+logoutLink+"\" title=\"Log Out\">"+logoutText+"</a>");
596
+ }
597
  <?php } ?>
598
 
599
 
839
 
840
  <script type="text/javascript">
841
  document.write('<style type="text/css">html{display:none;}</style>');
842
+ var agca_version = "<?php echo $this->agca_version; ?>";
843
  var wpversion = "<?php echo $wpversion; ?>";
844
  /* <![CDATA[ */
845
  jQuery(document).ready(function() {
879
  <?php //COLORIZER ?>
880
  <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
881
  jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
882
+
883
+ if(isWPHigherOrEqualThan("3.3")){
884
+ jQuery("body.login").css("background","<?php echo $this->colorizer['color_background'];?>");
885
+ }else{
886
+
887
+ <?php
888
  if($this->colorizer['color_background']!=""){
889
  ?>
890
+ updateTargetColor("color_background","<?php echo $this->colorizer['color_background'];?>");
891
+
892
  <?php
893
  }
894
  if($this->colorizer['color_header']!=""){
895
  ?>
896
  <?php if($wpversion < 3.2){ ?>
897
  jQuery("#backtoblog").css("background","<?php echo $this->colorizer['color_header'];?>");
898
+
899
  <?php } ?>
900
  <?php
901
  }
902
  if($this->colorizer['color_font_header']!=""){
903
  ?>
904
  jQuery("#backtoblog a,#backtoblog p").css("color","<?php echo $this->colorizer['color_font_header'];?>");
905
+
906
  <?php
907
+ }
908
+
909
+ ?>
910
+ }
911
+
912
+
913
+ <?php
914
+
915
+
916
  } ?>
917
  <?php //COLORIZER END ?>
918
  }catch(err){
941
  <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js"></script>
942
  <?php //includes ?>
943
  <div class="wrap">
944
+ <h1 style="color:green">AG Custom Admin Settings <span style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
945
  <div id="agca_news">&nbsp;</div><br />
946
  <form method="post" id="agca_form" action="options.php">
947
  <?php settings_fields( 'agca-options-group' ); ?>
982
  </tr>
983
  <tr valign="center" class="ag_table_major_options" >
984
  <td>
985
+ <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>
986
  </td>
987
  <td>
988
+ <input type="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" '; ?> />
989
  </td>
990
  </tr>
991
  <tr valign="center">
1006
  <?php } ?>
1007
  <tr valign="center">
1008
  <th >
1009
+ <label title="Change default WordPress logo with custom image." for="agca_wp_logo_custom">Change WordPress logo</label>
1010
  </th>
1011
  <td>
1012
+ <input title="If this field is not empty, image from provided url will be visible in top bar" type="text" size="47" name="agca_wp_logo_custom" value="<?php echo get_option('agca_wp_logo_custom'); ?>" />
1013
+ &nbsp;<p><i>Put here an URL of the new top bar image (20 x 20px)</i>.</p>
1014
+ </td>
1015
+ </tr>
1016
+ <tr valign="center">
1017
+ <th >
1018
+ <label title="Add custom image on the top of admin content." for="agca_header_logo_custom">Custom header image</label>
1019
+ </th>
1020
+ <td>
1021
+ <input title="If this field is not empty, image from provided url will be visible in header" type="text" size="47" name="agca_header_logo_custom" value="<?php echo get_option('agca_header_logo_custom'); ?>" />
1022
+ &nbsp;<p><i>Add custom header image</i>.</p>
1023
  </td>
1024
  </tr>
1025
  <tr valign="center">
1033
  <?php if($wpversion>=3.3){?>
1034
  <tr valign="center">
1035
  <th >
1036
+ <label title="Hides default WordPress top bar dropdown menus" for="agca_remove_top_bar_dropdowns">Hide WordPress top bar dropdown menus</label>
1037
  </th>
1038
  <td>
1039
+ <input title="Hides default WordPress top bar dropdown menus" type="checkbox" name="agca_remove_top_bar_dropdowns" value="true" <?php if (get_option('agca_remove_top_bar_dropdowns')==true) echo 'checked="checked" '; ?> />
1040
  </td>
1041
  </tr>
1042
  <tr valign="center">
1043
  <th >
1044
+ <label title="Removes comments block from admin bar" for="agca_admin_bar_comments">Hide admin bar "Comments"</label>
1045
+ </th>
1046
+ <td>
1047
+ <input title="Removes comments block from admin bar" type="checkbox" name="agca_admin_bar_comments" value="true" <?php if (get_option('agca_admin_bar_comments')==true) echo 'checked="checked" '; ?> />
1048
+ </td>
1049
+ </tr>
1050
+ <tr valign="center" style="margin-top:20px;">
1051
+ <th >
1052
+ <label title="Removes 'New' block with its contents from admin bar" for="agca_admin_bar_new_content">Hide admin bar "New" content</label>
1053
  </th>
1054
  <td>
1055
  <input title="Removes 'New' block with its contents from admin bar" type="checkbox" name="agca_admin_bar_new_content" value="true" <?php if (get_option('agca_admin_bar_new_content')==true) echo 'checked="checked" '; ?> />
1056
  </td>
1057
+ </tr>
1058
+ <tr class="new_content_header_submenu" valign="center">
1059
+ <th >
1060
+ <label title="Removes 'Post' submenu from 'New' option from admin bar" for="agca_admin_bar_new_content_post">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hide "New" content -> Post submenu</label>
1061
+ </th>
1062
+ <td>
1063
+ <input title="Removes 'Post' submenu from 'New' option from admin bar" type="checkbox" name="agca_admin_bar_new_content_post" value="true" <?php if (get_option('agca_admin_bar_new_content_post')==true) echo 'checked="checked" '; ?> />
1064
+ </td>
1065
+ </tr>
1066
+ <tr class="new_content_header_submenu" valign="center">
1067
+ <th >
1068
+ <label title="Removes 'Link' submenu from 'New' option from admin bar" for="agca_admin_bar_new_content_link">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hide "New" content -> Link submenu</label>
1069
+ </th>
1070
+ <td>
1071
+ <input title="Removes 'Link' submenu from 'New' option from admin bar" type="checkbox" name="agca_admin_bar_new_content_link" value="true" <?php if (get_option('agca_admin_bar_new_content_link')==true) echo 'checked="checked" '; ?> />
1072
+ </td>
1073
+ </tr>
1074
+ <tr class="new_content_header_submenu" valign="center">
1075
+ <th >
1076
+ <label title="Removes 'Page' submenu from 'New' option from admin bar" for="agca_admin_bar_new_content_page">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hide "New" content -> Page submenu</label>
1077
+ </th>
1078
+ <td>
1079
+ <input title="Removes 'Page' submenu from 'New' option from admin bar" type="checkbox" name="agca_admin_bar_new_content_page" value="true" <?php if (get_option('agca_admin_bar_new_content_page')==true) echo 'checked="checked" '; ?> />
1080
+ </td>
1081
+ </tr>
1082
+ <tr class="new_content_header_submenu" valign="center">
1083
+ <th >
1084
+ <label title="Removes 'User' submenu from 'New' option from admin bar" for="agca_admin_bar_new_content_user">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hide "New" content -> User submenu</label>
1085
+ </th>
1086
+ <td>
1087
+ <input title="Removes 'User' submenu from 'New' option from admin bar" type="checkbox" name="agca_admin_bar_new_content_user" value="true" <?php if (get_option('agca_admin_bar_new_content_user')==true) echo 'checked="checked" '; ?> />
1088
+ </td>
1089
+ </tr>
1090
+ <tr class="new_content_header_submenu" valign="center">
1091
+ <th >
1092
+ <label title="Removes 'Media' submenu from 'New' option from admin bar" for="agca_admin_bar_new_content_media">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hide "New" content -> Media submenu</label>
1093
+ </th>
1094
+ <td>
1095
+ <input title="Removes 'Media' submenu from 'New' option from admin bar" type="checkbox" name="agca_admin_bar_new_content_media" value="true" <?php if (get_option('agca_admin_bar_new_content_media')==true) echo 'checked="checked" '; ?> />
1096
+ </td>
1097
+ </tr>
1098
+ <tr valign="center">
1099
+ <th >
1100
+ <label title="Removes update notifications from admin bar" for="agca_admin_bar_update_notifications">Hide admin bar update notifications</label>
1101
+ </th>
1102
+ <td>
1103
+ <input 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" '; ?> />
1104
+ </td>
1105
  </tr>
1106
  <?php } ?>
1107
 
1504
  <td colspan="2">
1505
  name:<input type="text" size="47" title="New button visible name" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
1506
  url:<input type="text" size="47" title="New button link" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
1507
+ <select id="ag_add_adminmenu_target" style="width:64px">
1508
+ <option value="_blank" selected >blank</option>
1509
+ <option value="_self">self</option>
1510
+ <option value="_parent">parent</option>
1511
+ <option value="_top">top</option>
1512
+ </select>
1513
  <button type="button" id="ag_add_adminmenu_button" title="Add new item button" name="ag_add_adminmenu_button">Add new item</button>
1514
  </td><td></td>
1515
  </tr>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: argonius
3
  Donate link: http://wordpress.argonius.com/donate
4
  Tags: admin, customize, hide, change admin
5
  Requires at least: 3.0
6
- Tested up to: 3.3
7
- Stable tag: 1.2.5.2
8
 
9
  Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
10
 
@@ -88,6 +88,14 @@ Please use 'Reset Settings' button on Admin Menu page to reset menu configuratio
88
 
89
  == Changelog ==
90
 
 
 
 
 
 
 
 
 
91
  = 1.2.5.2 =
92
  * Fixed several issues with WP 3.3
93
  * Added options for hidding "comments" and "new" from admin bar
@@ -165,6 +173,9 @@ Please use 'Reset Settings' button on Admin Menu page to reset menu configuratio
165
 
166
  == Upgrade Notice ==
167
 
 
 
 
168
  = 1.2.5.2 =
169
  Full compatibility with WP 3.3. Fixed several issues with this version. Removed obsolete options for old WP versions, added new options to fit 3.3 version. Update is highly recommonded for WP 3.3 users.
170
 
3
  Donate link: http://wordpress.argonius.com/donate
4
  Tags: admin, customize, hide, change admin
5
  Requires at least: 3.0
6
+ Tested up to: 3.3.1
7
+ Stable tag: 1.2.5.3
8
 
9
  Hide or change items in admin panel. Customize buttons from admin menu. Colorize admin and login page with custom colors.
10
 
88
 
89
  == Changelog ==
90
 
91
+ = 1.2.5.3 =
92
+ * Fixed issues related to WP 3.3.1 version
93
+ * Fixed bug: Hidding/changing top admin bar WP icon
94
+ * Advanced customization of admin top bar
95
+ * Added options for hiding admin top bar elements
96
+ * Login page background same as admin background
97
+ * Added target options for custom admin buttons
98
+
99
  = 1.2.5.2 =
100
  * Fixed several issues with WP 3.3
101
  * Added options for hidding "comments" and "new" from admin bar
173
 
174
  == Upgrade Notice ==
175
 
176
+ = 1.2.5.3 =
177
+ Fixed issues related to WordPress version 3.3.1
178
+
179
  = 1.2.5.2 =
180
  Full compatibility with WP 3.3. Fixed several issues with this version. Removed obsolete options for old WP versions, added new options to fit 3.3 version. Update is highly recommonded for WP 3.3 users.
181
 
script/ag_script.js CHANGED
@@ -189,6 +189,39 @@ function hideAllSections(){
189
  }
190
  function reloadRemoveButtonEvents(){
191
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  jQuery(document).ready(function(){
193
  jQuery('a.button_remove').live("click", function(){
194
  jQuery(this).parent().parent().remove();
@@ -196,9 +229,11 @@ jQuery(document).ready(function(){
196
  jQuery('a.button_edit').live("click", function(){
197
  if(editingButtonNow == false){
198
  var name = jQuery(this).parent().find('button').text();
199
- var url = jQuery(this).parent().find('button').attr('title');
 
 
200
  editingButtonNow = name;
201
- jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" /><button type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit">Save changes</button></div>');
202
  reloadRemoveButtonEvents();
203
  }
204
  });/*Save editing changes*/
@@ -206,6 +241,8 @@ jQuery(document).ready(function(){
206
  //alert(jQuery(this).parent().html());
207
  var name = jQuery('#ag_add_adminmenu_name_edit').val();
208
  var url = jQuery('#ag_add_adminmenu_url_edit').val();
 
 
209
  name = name.replace(/["']{1}/gi,"");
210
  url = url.replace(/["']{1}/gi,"");
211
  jQuery('#temporary_button_edit').remove();
@@ -216,6 +253,7 @@ jQuery(document).ready(function(){
216
  if(element > 0){
217
  if(jQuery(this).html() == editingButtonNow){
218
  jQuery(this).attr('title',url);
 
219
  jQuery(this).html(name);
220
  }
221
  }
@@ -243,12 +281,14 @@ jQuery(document).ready(function(){
243
  /*Add new menu item button - creates new HTMl button elements*/
244
  jQuery('#ag_add_adminmenu_button').click(function(){
245
  var name = jQuery('#ag_add_adminmenu_name').val();
246
- var url = jQuery('#ag_add_adminmenu_url').val();
 
247
  name = name.replace(/["']{1}/gi,"");
248
  url = url.replace(/["']{1}/gi,"");
249
  jQuery('#ag_add_adminmenu_name').val("");
250
  jQuery('#ag_add_adminmenu_url').val("");
251
- jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button title="'+url+'" type="button">'+name+'</button>&nbsp;(<a style="cursor:pointer" class="button_edit">edit</a>)&nbsp;(<a style="cursor:pointer" class="button_remove">remove</a>)</td><td></td></tr>');
 
252
  reloadRemoveButtonEvents();
253
  });
254
 
@@ -277,8 +317,20 @@ jQuery(document).ready(function(){
277
  });
278
 
279
  /*SECTION FOCUS*/
280
- jQuery('.section_title').focus(function(){
281
  });
 
 
 
 
 
 
 
 
 
 
 
 
282
  });
283
 
284
  /*CLICKING ON ITEMS HANDLING*/
@@ -346,15 +398,17 @@ jQuery(document).ready(function(){
346
  if(element > 1){
347
  array += ", ";
348
  }
349
- array += "\"" + jQuery(this).html() + "\" : ";
350
- array += "\"" + jQuery(this).attr('title') + "\"";
 
 
 
351
  }
352
  element++;
353
  });
354
  array += "}";
355
  if(element == 1){array="";}
356
- jQuery('#ag_add_adminmenu_json').val(array);
357
-
358
 
359
  /*Serialize colors*/
360
  var array = "{";
@@ -515,4 +569,92 @@ jQuery(document).ready(function(){
515
  }, 5000);
516
 
517
  });
518
- /*A J A X*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
  }
190
  function reloadRemoveButtonEvents(){
191
  }
192
+ function createTargetCombo(target,clas){
193
+
194
+ var combo = ""
195
+
196
+ combo+= "<select";
197
+ if( clas != null){
198
+ combo+=" class=\"editTarget\" ";
199
+ }
200
+ combo+= ">";
201
+ combo+= "<option value=\"_blank\"";
202
+ if(target == "_blank"){
203
+ combo+= " selected ";
204
+ }
205
+ combo+= ">blank</option>";
206
+ combo+= "<option value=\"_self\"";
207
+ if(target == "_self"){
208
+ combo+= " selected ";
209
+ }
210
+ combo+= ">self</option>";
211
+ combo+= "<option value=\"_parent\"";
212
+ if(target == "_parent"){
213
+ combo+= " selected ";
214
+ }
215
+ combo+= ">parent</option>";
216
+ combo+= "<option value=\"_top\"";
217
+ if(target == "_top"){
218
+ combo+= " selected ";
219
+ }
220
+ combo+= ">top</option>";
221
+ combo+= "</select>";
222
+ return combo;
223
+ }
224
+
225
  jQuery(document).ready(function(){
226
  jQuery('a.button_remove').live("click", function(){
227
  jQuery(this).parent().parent().remove();
229
  jQuery('a.button_edit').live("click", function(){
230
  if(editingButtonNow == false){
231
  var name = jQuery(this).parent().find('button').text();
232
+ var url = jQuery(this).parent().find('button').attr('title');
233
+ var target = jQuery(this).parent().find('button').attr('target');
234
+ //console.log(target);
235
  editingButtonNow = name;
236
+ jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" />' + createTargetCombo(target,"edit")+ '<button type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit">Save changes</button></div>');
237
  reloadRemoveButtonEvents();
238
  }
239
  });/*Save editing changes*/
241
  //alert(jQuery(this).parent().html());
242
  var name = jQuery('#ag_add_adminmenu_name_edit').val();
243
  var url = jQuery('#ag_add_adminmenu_url_edit').val();
244
+ var target = jQuery('select.editTarget').val();
245
+ //var target = jQuery(this).parent().find('button').attr('target');
246
  name = name.replace(/["']{1}/gi,"");
247
  url = url.replace(/["']{1}/gi,"");
248
  jQuery('#temporary_button_edit').remove();
253
  if(element > 0){
254
  if(jQuery(this).html() == editingButtonNow){
255
  jQuery(this).attr('title',url);
256
+ jQuery(this).attr('target',target);
257
  jQuery(this).html(name);
258
  }
259
  }
281
  /*Add new menu item button - creates new HTMl button elements*/
282
  jQuery('#ag_add_adminmenu_button').click(function(){
283
  var name = jQuery('#ag_add_adminmenu_name').val();
284
+ var url = jQuery('#ag_add_adminmenu_url').val();
285
+ var target = jQuery('#ag_add_adminmenu_target').val();
286
  name = name.replace(/["']{1}/gi,"");
287
  url = url.replace(/["']{1}/gi,"");
288
  jQuery('#ag_add_adminmenu_name').val("");
289
  jQuery('#ag_add_adminmenu_url').val("");
290
+ jQuery('#ag_add_adminmenu_target').val("_none");
291
+ jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;(<a style="cursor:pointer" class="button_edit">edit</a>)&nbsp;(<a style="cursor:pointer" class="button_remove">remove</a>)</td><td></td></tr>');
292
  reloadRemoveButtonEvents();
293
  });
294
 
317
  });
318
 
319
  /*SECTION FOCUS*/
320
+ jQuery('.section_title').focus(function(){
321
  });
322
+
323
+ /*HIDE/SHOW New items click*/
324
+ jQuery('input[name=agca_admin_bar_new_content]').bind("click",function(){
325
+ var checked = jQuery(this).is(":checked");
326
+ if(!checked){
327
+ jQuery(".new_content_header_submenu").show("slide");
328
+ }else{
329
+ jQuery(".new_content_header_submenu").hide("slideDown");
330
+ }
331
+ });
332
+
333
+
334
  });
335
 
336
  /*CLICKING ON ITEMS HANDLING*/
398
  if(element > 1){
399
  array += ", ";
400
  }
401
+ array += "\"" + jQuery(this).html() + "\" : {";
402
+ array += " \"value\" : ";
403
+ array += "\"" + jQuery(this).attr('title') + "\"";
404
+ array += ", \"target\" : ";
405
+ array += "\"" + jQuery(this).attr('target') + "\"}";
406
  }
407
  element++;
408
  });
409
  array += "}";
410
  if(element == 1){array="";}
411
+ jQuery('#ag_add_adminmenu_json').val(array);
 
412
 
413
  /*Serialize colors*/
414
  var array = "{";
569
  }, 5000);
570
 
571
  });
572
+ /*A J A X*/
573
+
574
+ function isWPHigherOrEqualThan(targetVersion){
575
+ var versions = ["0.7",
576
+ "0.71",
577
+ "0.711",
578
+ "0.72",
579
+ "1.0",
580
+ "1.0.1",
581
+ "1.0.2",
582
+ "1.2",
583
+ "1.2.1",
584
+ "1.2.2",
585
+ "1.5",
586
+ "1.5.1",
587
+ "1.5.1.2",
588
+ "1.5.1.3",
589
+ "1.5.2",
590
+ "2.0",
591
+ "2.0.1",
592
+ "2.0.2",
593
+ "2.0.3",
594
+ "2.0.4",
595
+ "2.0.5",
596
+ "2.0.6",
597
+ "2.0.7",
598
+ "2.0.8",
599
+ "2.0.9",
600
+ "2.0.10",
601
+ "2.0.11",
602
+ "2.1",
603
+ "2.1.1",
604
+ "2.1.2",
605
+ "2.1.3",
606
+ "2.2",
607
+ "2.2.1",
608
+ "2.2.2",
609
+ "2.2.3",
610
+ "2.3",
611
+ "2.3.1",
612
+ "2.3.2",
613
+ "2.3.3",
614
+ "2.5",
615
+ "2.5.1",
616
+ "2.6",
617
+ "2.6.1",
618
+ "2.6.2",
619
+ "2.6.3",
620
+ "2.6.5",
621
+ "2.7",
622
+ "2.7.1",
623
+ "2.8",
624
+ "2.8.1",
625
+ "2.8.2",
626
+ "2.8.3",
627
+ "2.8.4",
628
+ "2.8.5",
629
+ "2.8.6",
630
+ "2.9",
631
+ "2.9.1",
632
+ "2.9.2",
633
+ "3.0",
634
+ "3.0.1",
635
+ "3.0.2",
636
+ "3.0.3",
637
+ "3.0.4",
638
+ "3.0.5",
639
+ "3.0.6",
640
+ "3.1",
641
+ "3.1.1",
642
+ "3.1.2",
643
+ "3.1.3",
644
+ "3.1.4",
645
+ "3.2",
646
+ "3.2.1",
647
+ "3.3",
648
+ "3.3.1"];
649
+ //remove sufixes, beta RC etc
650
+ if (wpversion.indexOf("-")!=-1){
651
+ var parts = wpversion.split("-");
652
+ wpversion = parts[0];
653
+ }
654
+ for(var i in versions){
655
+ if(versions[i] == targetVersion){
656
+ if(wpversion >= targetVersion) return true;
657
+ }
658
+ }
659
+ return false;
660
+ }
style/ag_style.css CHANGED
@@ -2,6 +2,7 @@
2
  display:block;
3
  height:32px;
4
  border-bottom:3px solid green;
 
5
  }
6
  #ag_main_menu li{
7
  display:block;
2
  display:block;
3
  height:32px;
4
  border-bottom:3px solid green;
5
+ margin-top:2px;
6
  }
7
  #ag_main_menu li{
8
  display:block;