Absolutely Glamorous Custom Admin - Version 5.5

Version Description

  • Resolved JavaScript error on AGCA page in WP 4.5 version
  • Added compatibility support with Cusmin plugin
  • Added compatibility support with WPS Hide Login plugin
  • Changed plugin versioning
Download this release

Release Info

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

Code changes from version 1.5.4.3 to 5.5

Files changed (5) hide show
  1. plugin.php +1541 -1523
  2. readme.txt +11 -2
  3. script/ag_script.js +369 -362
  4. script/agca_tmpl.js +269 -268
  5. style/ag_style.css +523 -400
plugin.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: AG Custom Admin
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: WAP
7
- Version: 1.5.4.3
8
  Author URI: http://www.wordpressadminpanel.com/
9
 
10
  Copyright 2016. WAP (email : info@wordpressadminpanel.com)
@@ -27,7 +27,7 @@ $agca = new AGCA();
27
 
28
  class AGCA{
29
  private $colorizer="";
30
- private $active_plugin;
31
  private $agca_version;
32
  private $agca_debug = false;
33
  private $admin_capabilities;
@@ -60,7 +60,7 @@ class AGCA{
60
  /*Initialize properties*/
61
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
62
 
63
- $this->agca_version = "1.5.4.3";
64
 
65
  //TODO:upload images programmaticaly
66
 
@@ -91,7 +91,7 @@ class AGCA{
91
 
92
  function agca_init_session(){
93
  if (!session_id())
94
- session_start();
95
  }
96
 
97
  function checkGET(){
@@ -113,20 +113,20 @@ class AGCA{
113
 
114
  function checkPOST(){
115
  if(isset($_POST['_agca_save_template'])){
116
- $this->verifyPostRequest();
117
- //print_r($_POST);
118
- $data = $_POST['templates_data'];
119
- $parts = explode("|||",$data);
120
 
121
- $common_data = $parts [0];
122
- $admin_js = $parts [1];
123
- $admin_css = $parts [2];
124
- $login_js = $parts [3];
125
- $login_css = $parts [4];
126
- $settings = $parts [5];
127
- $images = $parts [6];
128
 
129
- $template_name = $_POST['templates_name'];
130
 
131
  update_option('agca_selected_template', $template_name);
132
 
@@ -145,7 +145,7 @@ class AGCA{
145
  'logincss'=>$login_css,
146
  'images'=>$images,
147
  'settings'=>$settings
148
- );
149
  update_option('agca_templates', $templates);
150
 
151
  $_POST = array();
@@ -156,7 +156,7 @@ class AGCA{
156
  if($_POST['template'] !="")
157
  $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
158
 
159
- print_r($_SESSION);
160
  echo "_agca_templates_session:OK";
161
  exit;
162
  }else if(isset($_POST['_agca_templates_session_remove_license'])){
@@ -204,9 +204,11 @@ class AGCA{
204
  function my_sideload_image() {
205
  $remoteurl = $_POST['_agca_upload_image'];
206
  $file = media_sideload_image( $remoteurl, 0 ,"AG Custom Admin Template Image (do not delete)");
207
- $fileparts = explode("src='",$file);
208
- $url=explode("'",$fileparts[1]);
209
- echo $url[0];
 
 
210
  exit;
211
  }
212
  add_action( 'admin_init', 'my_sideload_image' );
@@ -250,42 +252,42 @@ class AGCA{
250
 
251
  function delete_template_images_all(){
252
  $templates = get_option('agca_templates');
253
- if($templates != null && $templates != ""){
254
- foreach($templates as $template){
255
- if($template != null && $template['images'] != null && $template['images'] != ""){
256
- //print_r($template['images']);
257
- $imgs = explode(',',$template['images']);
258
- foreach($imgs as $imageSrc){
259
- $this->delete_attachment_by_src($imageSrc);
260
- }
261
- //print_r($imgs);
262
  }
 
263
  }
264
  }
 
265
  //print_r($templates);
266
  }
267
 
268
  function delete_template_images($template_name){
269
  $templates = get_option('agca_templates');
270
- if($templates != null && $templates != ""){
271
- $template = $templates[$template_name];
272
- if($template != null && $template['images'] != null && $template['images'] != ""){
273
- //print_r($template['images']); exit;
274
- $imgs = explode(',',$template['images']);
275
- foreach($imgs as $imageSrc){
276
- $this->delete_attachment_by_src($imageSrc);
277
- }
278
- //print_r($imgs);
279
  }
 
280
  }
 
281
  //print_r($templates);
282
  }
283
 
284
  function delete_attachment_by_src ($image_src) {
285
- global $wpdb;
286
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
287
- $id = $wpdb->get_var($query);
288
- wp_delete_attachment( $id, $true );
289
  }
290
 
291
  function get_installed_agca_templates(){
@@ -306,20 +308,8 @@ class AGCA{
306
  return true;
307
  }
308
  }
309
- function check_active_plugin(){
310
-
311
- $ozh = false;
312
-
313
- if (is_plugin_active('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')) {
314
- $ozh = true;
315
- }
316
-
317
- $this->active_plugin = array(
318
- "ozh" => $ozh
319
- );
320
- }
321
  function change_title($admin_title, $title){
322
- //return get_bloginfo('name').' - '.$title;
323
  if(get_option('agca_custom_title')!=""){
324
  $blog = get_bloginfo('name');
325
  $page = $title;
@@ -332,61 +322,76 @@ class AGCA{
332
  }
333
  }
334
  function agca_get_includes() {
 
 
 
 
 
335
  ?>
336
- <script type="text/javascript">
337
- <?php
338
- //AGCA GLOBALS
339
- echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';";
340
- ?>
341
- </script>
342
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
343
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>" />
344
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
345
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
346
 
 
 
 
 
347
  <?php
348
- if($this->context == "login"){
349
- ?>
350
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/login.min.css" />
 
 
 
 
 
 
 
 
 
351
  <?php
352
- }else{
353
  ?>
354
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/admin.min.css" />
355
- <?php
 
 
 
 
 
356
  }
357
- ?>
358
- <?php
359
- echo $this->templateCustomizations;
360
-
361
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
362
- ?>
363
- <style type="text/css">
364
- <?php
365
- echo get_option('agca_custom_css');
366
- ?>
367
- </style>
368
- <script type="text/javascript">
369
- try{
370
- eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
371
- }catch(e){
372
- alert('AG CUSTOM ADMIN : There is an error in your custom JS script. Please fix it: \n\n' + e + '\n\n (AG CUSTOM ADMIN -> Advanced -> Custom JavaScript)');
373
- console.log(e);
374
- }
375
- </script>
376
- <?php
377
- }
378
  }
379
 
380
  function agca_enqueue_scripts() {
381
  wp_enqueue_script('jquery');
382
  }
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  function reloadScript(){
385
  $isAdmin = false;
386
  if(defined('WP_ADMIN') && WP_ADMIN == 1){
387
  $isAdmin = true;
388
  }
389
- if(in_array((isset($GLOBALS['pagenow'])?$GLOBALS['pagenow']:""), array('wp-login.php', 'wp-register.php')) || $isAdmin){
390
  add_action('init', array(&$this,'agca_enqueue_scripts'));
391
  }
392
  }
@@ -485,37 +490,37 @@ class AGCA{
485
  register_setting( 'agca-options-group', 'agca_custom_css' );
486
 
487
 
488
- if(!empty($_POST)){
489
- if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
490
- $this->verifyPostRequest();
491
- if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
492
- if($_FILES["settings_import_file"]["error"] > 0){
493
- }else{
494
- $file = $_FILES['settings_import_file'];
495
- if($this->startsWith($file['name'],'AGCA_Settings')){
496
- if (file_exists($file['tmp_name'])) {
497
- $fh = fopen($file['tmp_name'], 'r');
498
- $theData = "";
499
- if(filesize($file['tmp_name']) > 0){
500
- $theData = fread($fh,filesize($file['tmp_name']));
501
- }
502
- fclose($fh);
503
- $this->importSettings($theData);
504
- }
505
- }
506
  }
 
 
507
  }
508
- }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
509
- $this->verifyPostRequest();
510
- $this->exportSettings();
511
  }
512
  }
 
 
 
 
 
513
 
514
- if(isset($_GET['agca_action'])){
515
- if($_GET['agca_action'] == "disablewarning"){
516
- update_option('agca_disablewarning', true);
517
- }
518
- }
519
  }
520
 
521
  function agca_deactivate() {
@@ -523,201 +528,201 @@ class AGCA{
523
  }
524
 
525
  function getOptions(){
526
- return Array(
527
- 'agca_role_allbutadmin',
528
- 'agca_admin_bar_frontend',
529
- 'agca_admin_bar_frontend_hide',
530
- 'agca_login_register_remove',
531
- 'agca_login_register_href',
532
- 'agca_login_lostpassword_remove',
533
- 'agca_admin_capability',
534
- 'agca_screen_options_menu',
535
- 'agca_help_menu',
536
- 'agca_logout',
537
- 'agca_remove_your_profile',
538
- 'agca_logout_only',
539
- 'agca_custom_title',
540
- 'agca_howdy',
541
- 'agca_header',
542
- 'agca_header_show_logout',
543
- 'agca_footer',
544
- 'agca_privacy_options',
545
- 'agca_header_logo',
546
- 'agca_header_logo_custom',
547
- 'agca_remove_site_link',
548
- 'agca_wp_logo_custom',
549
- 'agca_wp_logo_custom_link',
550
- 'agca_site_heading',
551
- 'agca_custom_site_heading',
552
- 'agca_update_bar',
553
- 'agca_footer_left',
554
- 'agca_footer_left_hide',
555
- 'agca_footer_right',
556
- 'agca_footer_right_hide',
557
- 'agca_login_banner',
558
- 'agca_login_banner_text',
559
- 'agca_login_photo_remove',
560
- 'agca_login_photo_url',
561
- 'agca_login_photo_href',
562
- 'agca_login_round_box',
563
- 'agca_login_round_box_size',
564
- 'agca_dashboard_icon',
565
- 'agca_dashboard_text',
566
- 'agca_dashboard_text_paragraph',
567
- 'agca_dashboard_widget_welcome',
568
- 'agca_dashboard_widget_activity',
569
- 'agca_dashboard_widget_il',
570
- 'agca_dashboard_widget_plugins',
571
- 'agca_dashboard_widget_qp',
572
- 'agca_dashboard_widget_rn',
573
- 'agca_dashboard_widget_rd',
574
- 'agca_dashboard_widget_primary',
575
- 'agca_dashboard_widget_secondary',
576
- 'agca_admin_bar_comments',
577
- 'agca_admin_bar_new_content',
578
- 'agca_admin_bar_new_content_post',
579
- 'agca_admin_bar_new_content_link',
580
- 'agca_admin_bar_new_content_page',
581
- 'agca_admin_bar_new_content_user',
582
- 'agca_admin_bar_new_content_media',
583
- 'agca_admin_bar_update_notifications',
584
- 'agca_admin_bar_admin_themes',
585
- 'agca_remove_top_bar_dropdowns',
586
- 'agca_admin_menu_turnonoff',
587
- 'agca_admin_menu_agca_button_only',
588
- 'agca_admin_menu_separators',
589
- 'agca_admin_menu_icons',
590
- 'agca_admin_menu_arrow',
591
- 'agca_admin_menu_submenu_round',
592
- 'agca_admin_menu_submenu_round_size',
593
- 'agca_admin_menu_brand',
594
- 'agca_admin_menu_brand_link',
595
- 'agca_admin_menu_autofold',
596
- 'agca_admin_menu_collapse_button',
597
- 'ag_edit_adminmenu_json',
598
- 'ag_edit_adminmenu_json_new',
599
- 'ag_add_adminmenu_json',
600
- 'ag_colorizer_json',
601
- 'agca_colorizer_turnonof',
602
- 'agca_custom_js',
603
- 'agca_custom_css',
604
- 'agca_colorizer_turnonoff',
605
- 'agca_disablewarning',
606
- 'agca_selected_template',
607
- 'agca_templates',
608
- );
609
- }
610
 
611
- function getTextEditor($name){
612
- $settings = array(
613
- 'textarea_name' => $name,
614
- 'media_buttons' => true,
615
- 'tinymce' => array(
616
- 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
617
- 'bullist,blockquote,|,justifyleft,justifycenter' .
618
- ',justifyright,justifyfull,|,link,unlink,|' .
619
- ',spellchecker,wp_fullscreen,wp_adv'
620
- )
621
- );
622
- wp_editor( get_option($name), $name, $settings );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  }
624
 
625
- function importSettings($settings){
626
- $exploaded = explode("|^|^|", $settings);
627
- // $str = "EEE: ";
628
 
629
- $savedOptions = array();
630
 
631
- foreach ($exploaded as $setting){
 
 
 
 
 
 
 
 
 
 
 
 
 
632
 
633
- $key = current(explode(':', $setting));
634
- $value = substr($setting, strlen($key)+1);
635
- $cleanedValue = str_replace('|^|^|','',$value);
636
- $savedOptions[$key] = $cleanedValue;
637
  }
 
 
 
638
 
639
- // print_r($savedOptions);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
 
641
- $optionNames = $this->getOptions();
642
 
643
- foreach ($optionNames as $optionName){
644
- $optionValue = "";
645
- $optionValue = $savedOptions[$optionName];
646
 
647
- if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
648
- $optionValue = str_replace("\\\"", "\"", $optionValue);
649
- $optionValue = str_replace("\\\'", "\'", $optionValue);
650
- }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
651
- //fb($optionValue);
652
- $optionValue = htmlspecialchars_decode($optionValue);
653
- $optionValue = str_replace("\'", '"', $optionValue);
654
- $optionValue = str_replace('\"', "'", $optionValue);
655
- //fb($optionValue);
656
- }else{
657
 
658
- }
659
- update_option($optionName, $optionValue);
660
- $str.="/".$optionName."/".$optionValue."\n";
 
661
  }
 
662
 
663
- //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
664
- //agca_script_css
665
- //
666
- // fb($savedOptions);
667
- if($savedOptions['agca_script_css'] != null){
668
- $optionValue = "";
669
- $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
670
- $optionValue = str_replace('\"', "'", $optionValue);
671
- update_option('agca_custom_css', $optionValue);
672
- }
673
- if($savedOptions['agca_script_js'] != null){
674
- $optionValue = "";
675
- $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
676
- $optionValue = str_replace('\"', "'", $optionValue);
677
- update_option('agca_custom_js', $optionValue);
678
- }
679
-
680
- //echo $str;
681
-
682
- //save imported settings
683
- $this->saveAfterImport = true;
684
- }
685
-
686
- function exportSettings(){
687
- $str = "";
688
-
689
- $include_menu_settings = false;
690
- if(isset($_POST['export_settings_include_admin_menu'])){
691
- if($_POST['export_settings_include_admin_menu'] == 'on'){
692
- $include_menu_settings = true;
693
  }
694
  }
695
-
696
- foreach ($_POST as $key => $value) {
697
- if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
698
- if($this->startsWith($key,'ag_edit_adminmenu')){
699
- if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
700
- }else{
701
- $str .=$key. ":".$value."|^|^|";
702
- }
703
- }
704
- }
705
-
706
- $filename = 'AGCA_Settings_'.date("Y-M-d_H-i-s").'.agca';
707
- header("Cache-Control: public");
708
- header("Content-Description: File Transfer");
709
- header("Content-Disposition: attachment; filename=$filename");
710
- header("Content-Type: text/plain; ");
711
- header("Content-Transfer-Encoding: binary");
712
- echo $str;
713
- die();
714
  }
715
 
716
- function startsWith($haystack, $needle)
717
- {
718
- $length = strlen($needle);
719
- return (substr($haystack, 0, $length) === $needle);
720
- }
 
 
 
 
 
 
 
 
 
 
721
 
722
 
723
 
@@ -805,80 +810,80 @@ class AGCA{
805
 
806
  function print_page()
807
  {
808
- if($this->isGuest() && get_option('agca_admin_bar_frontend_hide')){
809
- return false;
810
- }
811
- if(!$this->isGuest()){
812
- ?><style type="text/css"><?php echo get_option('agca_custom_css'); ?></style><?php
813
- }
814
 
815
- if(get_option('agca_admin_bar_frontend_hide')==true){
816
- add_filter( 'show_admin_bar', '__return_false' );
817
- ?>
818
- <style type="text/css">
819
- #wpadminbar{
820
- display: none;
821
- }
822
- </style>
823
- <script type="text/javascript">
824
- window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
825
- </script>
826
- <?php
827
- }
828
  if(get_option('agca_admin_bar_frontend')!=true){
829
 
830
  $this->context = "page";
831
  $wpversion = $this->get_wp_version();
832
 
833
- ?>
834
 
835
 
836
- <script type="text/javascript">
837
- var wpversion = "<?php echo $wpversion; ?>";
838
- var agca_version = "<?php echo $this->agca_version; ?>";
839
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
840
- var jQueryScriptOutputted = false;
841
- var agca_context = "page";
842
- var agca_orig_admin_menu = [];
843
- function initJQuery() {
844
- //if the jQuery object isn't available
845
- if (typeof(jQuery) == 'undefined') {
846
- if (! jQueryScriptOutputted) {
847
- //only output the script once..
848
- jQueryScriptOutputted = true;
849
- //output the script (load it from google api)
850
- document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></scr" + "ipt>");
851
- }
852
- setTimeout("initJQuery()", 50);
853
- } else {
854
- jQuery(function() {
855
- try
856
- {
857
- <?php if(get_option('agca_header')!=true){ ?>
858
- jQuery('#wpadminbar').show();
859
- <?php } ?>
860
-
861
- <?php $this->print_admin_bar_scripts(); ?>
862
- }catch(ex){}
863
- });
864
  }
 
 
 
 
 
 
 
 
 
 
 
 
865
  }
866
- initJQuery();
867
- </script>
868
- <script type="text/javascript">
869
- <?php echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';"; ?>
870
- </script>
871
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
872
- <script type="text/javascript">
 
873
  jQuery(document).ready(function(){
874
- <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
875
- foreach($this->colorizer as $k => $v){
876
- if(($k !="") and ($v !="")){
877
- if(
878
- $k == "color_header" ||
879
- $k == "color_font_header"
880
- ){
881
- ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
882
  }
883
 
884
  }
@@ -889,180 +894,180 @@ class AGCA{
889
  }
890
  ?>
891
  });
892
- </script>
893
- <?php
894
  }
895
 
896
  }
897
 
898
- function print_admin_bar_scripts(){
899
- ?>
900
- <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
901
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
902
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
903
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
904
-
905
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
906
- jQuery(".new_content_header_submenu").hide();
907
- <?php } ?>
908
-
909
- <?php } ?>
910
-
911
- <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
912
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
913
- <?php } ?>
914
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
915
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
916
- <?php } ?>
917
- <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
918
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
919
- <?php } ?>
920
- <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
921
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
922
- <?php } ?>
923
- <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
924
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
925
- <?php } ?>
926
- <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
927
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
928
- <?php } ?>
929
- <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
930
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
931
- <?php } ?>
932
- <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
933
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
934
- <?php } ?>
935
- <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
936
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
937
- <?php } ?>
938
-
939
-
940
-
941
- <?php if(get_option('agca_header_logo')==true){ ?>
942
- jQuery("#wphead #header-logo").css("display","none");
943
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
944
-
945
- <?php } ?>
946
- <?php if(get_option('agca_header_logo_custom')!=""){ ?>
947
-
948
- var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
949
-
950
- advanced_url = img_url;
951
- image = jQuery("<img />").attr("src",advanced_url);
952
- jQuery(image).load(function() {
953
- jQuery("#wpbody-content").prepend(image);
954
- });
955
-
956
- <?php } ?>
957
- <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
958
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").html("<img style=\"height:28px;margin-top:-4px\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />");
959
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('background-image','none');
960
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('width','auto');
961
- jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',"<?php echo get_bloginfo('wpurl'); ?>");
962
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
963
- jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
964
- jQuery("#wp-admin-bar-wp-logo").show();
965
- <?php }?>
966
- <?php if(get_option('agca_remove_site_link')==true){ ?>
967
- jQuery("#wp-admin-bar-site-name").css("display","none");
968
-
969
- <?php } ?>
970
- <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
971
- var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
972
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
973
- if(href == "%SWITCH%"){
974
- href = "<?php echo get_bloginfo('wpurl'); ?>";
975
- <?php if($this->context == "page"){
976
- ?>href+="/wp-admin";<?php
977
- }
978
- ?>
979
- }
980
- jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
981
-
982
- <?php }?>
983
- <?php if(get_option('agca_site_heading')==true){ ?>
984
- jQuery("#wphead #site-heading").css("display","none");
985
- <?php } ?>
986
- <?php if(get_option('agca_custom_site_heading')!=""){ ?>
987
- jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
988
- jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
989
-
990
- <?php } ?>
991
- <?php if(get_option('agca_header')==true && $this->context =='admin'){
992
- ?>
993
- jQuery("#wpadminbar").css("display","none");
994
- jQuery("body.admin-bar").css("padding-top","0");
995
- jQuery("#wphead").css("display","none");
996
- jQuery('html.wp-toolbar').css("padding-top","0");
997
-
998
- <?php } ?>
999
- <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
1000
- <?php
1001
- $agca_logout_text = ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout'));
1002
- ?>
1003
- jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
1004
-
1005
-
1006
- <?php } ?>
1007
- <?php if(get_option('agca_howdy')!=""){ ?>
1008
- var alltext="";
1009
- alltext="";
1010
- jQuery('li#wp-admin-bar-my-account').css('cursor','default');
1011
- alltext = jQuery('li#wp-admin-bar-my-account').html();
1012
- if(alltext!=null){
1013
- var parts = alltext.split(',');
1014
- alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
1015
- }
1016
- jQuery("li#wp-admin-bar-my-account").html("<a href=\"#\" class=\"ab-item\">"+alltext+"</a>");
1017
 
1018
- <?php } ?>
1019
- <?php
1020
- if(get_option('agca_custom_title')!=""){
1021
- //add_filter('admin_title', '$this->change_title', 10, 2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1022
 
1023
- }
1024
- ?>
1025
- <?php if(get_option('agca_logout')!=""){ ?>
1026
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1027
- <?php } ?>
1028
- <?php if(get_option('agca_remove_your_profile')==true){ ?>
1029
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1030
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1031
- jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1032
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1033
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1034
- <?php } ?>
1035
- <?php if(get_option('agca_logout_only')==true){ ?>
1036
- var logout_content = jQuery("li#wp-admin-bar-logout").html();
1037
- jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout" style="display:block;">'+ logout_content +'</li>');
1038
- jQuery("#wp-admin-bar-logout a").css('padding','0 8px');
 
 
 
1039
 
 
 
 
 
1040
 
1041
- <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1042
 
1043
- <?php
1044
 
1045
 
1046
- }
1047
 
1048
  function updateAllColors(){
1049
 
1050
- ?>
1051
- function updateAllColors(){
1052
- <?php
1053
- foreach($this->colorizer as $k => $v){
1054
- if(($k !="") and ($v !="")){
1055
- ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1056
- }
1057
- }
1058
- ?>
1059
- jQuery('.color_picker').each(function(){
1060
- updateColor(jQuery(this).attr('id'),jQuery(this).val())
1061
- });
1062
- jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1063
- jQuery('#adminmenu li.wp-menu-open').css('border','none');
1064
- jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1065
- }<?php
1066
 
1067
  }
1068
  function admin_capabilities(){
@@ -1078,14 +1083,14 @@ class AGCA{
1078
  die;*/
1079
  ksort($capabs);
1080
  foreach($capabs as $k=>$v){
1081
- $selected = "";
1082
- if($this->startsWith($k, 'level_')) continue;
1083
- if($selectedValue == $k){
1084
- $selected = " selected=\"selected\" ";
1085
- }
1086
- //TODO:Find out why this does not work
1087
- //$capabilitySelector .="<option val=\"$k\" $selected >".str_replace(' ', ' ', ucwords(str_replace('_', ' ', $k))) ."</option>\n";
1088
- $capabilitySelector .="<option val=\"$k\" $selected >".$k."</option>\n";
1089
  }
1090
 
1091
  $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
@@ -1238,55 +1243,55 @@ class AGCA{
1238
  }
1239
  }
1240
 
1241
- function agca_error_check(){
1242
- ?>
1243
- <script type="text/javascript">
1244
- function AGCAErrorPage(msg, url, line){
1245
- var agca_error_details = "___________________________________________________<br/>";
1246
- agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1247
- agca_error_details += "___________________________________________________<br/>";
1248
- window.agca_error_details_text = agca_error_details + '<br/>This JavaScript error could stop AG Custom Admin plugin to work properly. If everything still works, you can ignore this notification. <br/><br/>Possible solutions:<br/><br/>1) Make sure to have everything up to date: WordPress site, plugins and themes.<br/><br/>2) Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.<br/><br/>3) Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.<br/><br/>4) If it\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support. <br/><br/>5) Try activating default WordPress theme instead of your current theme.<br/><br/>6) Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.<br/><br/>7) Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AG Custom Admin plugin, or something unexpected happens, please report that on our <a href="http://wordpressadminpanel.com/agca-support/ag_custom_admin/error-ocurred-javascript-error-caught/" target="_blank">SUPPORT PAGE</a>';
1249
- document.getElementsByTagName('html')[0].style.visibility = "visible";
1250
- var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
1251
  AG Custom Admin caught an error on your site!&nbsp;<a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(show/hide more...)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">'+agca_error_details_text+'</div></div>';
1252
 
1253
- var ph = document.getElementById('agca_error_placeholder');
1254
- ph.innerHTML = errorDivHtml;
1255
- document.getElementById('agca_news').style.visibility = "hidden";
 
 
 
 
1256
  }
1257
- window.onerror = function(msg, url, line) {
1258
- window.onload = function() {
1259
- AGCAErrorPage(msg, url, line);
1260
- }
1261
- return true;
1262
- };
1263
- </script>
1264
- <?php
1265
- }
1266
- function error_check(){
1267
- ?>
1268
- <script type="text/javascript">
1269
- function AGCAErrorOtherPages(msg, url, line){
1270
- var agca_error_details = "___________________________________________________\n";
1271
- agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
1272
 
1273
- document.getElementsByTagName('html')[0].style.visibility = "visible";
1274
 
1275
- if(typeof window.console === "object"){
1276
- console.log("___________________________________________________");
1277
- console.log("AG Custom Admin caught a JavaScript on your site:");
1278
- console.log(agca_error_details);
1279
- }
1280
  }
1281
- window.onerror = function(msg, url, line) {
1282
- window.onload = function() {
1283
- AGCAErrorOtherPages(msg, url, line);
1284
- }
1285
- return true;
1286
- };
1287
- </script>
1288
- <?php
1289
- }
 
1290
 
1291
  function menu_item_cleartext($name){
1292
  if(strpos($name,' <span') !== false){
@@ -1504,6 +1509,15 @@ class AGCA{
1504
  update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1505
  update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1506
  }
 
 
 
 
 
 
 
 
 
1507
  function print_admin_css()
1508
  {
1509
  $agcaTemplateSession = $this->agcaAdminSession();
@@ -1519,6 +1533,7 @@ class AGCA{
1519
  var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1520
  var errors = false;
1521
  var isSettingsImport = false;
 
1522
  var agca_context = "admin";
1523
  var roundedSidberSize = 0;
1524
  var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
@@ -1529,31 +1544,31 @@ class AGCA{
1529
  $this->agca_get_includes();
1530
  $this->admin_capabilities();
1531
  get_currentuserinfo() ;
1532
- ?>
1533
- <?php
1534
- //in case that javaScript is disabled only admin can access admin menu
1535
- if(!current_user_can($this->admin_capability())){
1536
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1537
  <style type="text/css">
1538
- #adminmenu{display:none;}
 
1539
  </style>
1540
- <?php
1541
- }
1542
- ?>
1543
- <script type="text/javascript">
1544
- document.write('<style type="text/css">html{visibility:hidden;}</style>');
1545
- <?php
1546
- if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1547
- echo 'isSettingsImport = true;';
1548
- }
1549
- ?>
1550
- </script>
1551
- <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1552
- <style type="text/css">
1553
- .wp-has-current-submenu:after{border:none !important;}
1554
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1555
- </style>
1556
- <?php }
1557
 
1558
  if($currentScreen->id == 'tools_page_ag-custom-admin/plugin'){
1559
  ?>
@@ -1568,30 +1583,28 @@ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='t
1568
  <?php
1569
  }
1570
  ?>
1571
- <script type="text/javascript">
1572
- /* <![CDATA[ */
1573
- jQuery(document).ready(function() {
1574
- try
1575
- {
1576
-
1577
- <?php /*CHECK OTHER PLUGINS*/
1578
- $this->check_active_plugin();
1579
 
1580
- if($this->active_plugin["ozh"]){
1581
- ?>
1582
- jQuery('ul#adminmenu').css('display','none');
1583
- jQuery('#footer-ozh-oam').css('display','none');
1584
- jQuery('#ag_main_menu li').each(function(){
1585
- if(jQuery(this).text() == "Admin Menu"){
1586
- jQuery(this).hide();
1587
- }
1588
- });
1589
- <?php
1590
- }
1591
- ?>
 
1592
 
1593
 
1594
- //get saved onfigurations
1595
 
1596
  <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1597
  var buttons = '<?php echo $buttons; ?>';
@@ -1602,105 +1615,104 @@ try
1602
  createEditMenuPageNew(agca_admin_menu);
1603
  //createEditMenuPageV32(checkboxes, textboxes);
1604
 
1605
- <?php
1606
- //if admin, and option to hide settings for admin is set
1607
-
1608
- if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability())){
1609
- ?>
1610
- <?php } else{ ?>
1611
- <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1612
- additionalStyles = ' style="margin-bottom:-4px" ';
1613
- jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1614
- <?php } ?>
1615
- <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1616
 
1617
- var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1618
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1619
 
1620
- jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1621
- jQuery("#sidebar_adminmenu_logo").attr('title',href);
1622
 
1623
- <?php }else{ ?>
1624
- href = "<?php echo get_bloginfo('wpurl'); ?>";
1625
- jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1626
- jQuery("#sidebar_adminmenu_logo").attr('title',href);
1627
- <?php } ?>
1628
 
1629
  <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1630
- jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1631
- jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1632
- <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1633
- roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1634
 
1635
 
1636
  <?php } ?>
1637
  <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1638
- jQuery("body").addClass("auto-fold");
1639
  <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1640
- jQuery("body").removeClass("auto-fold");
1641
  <?php } ?>
1642
 
1643
  <?php $this->print_admin_bar_scripts(); ?>
1644
 
1645
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
1646
- jQuery("#screen-options-link-wrap").css("display","none");
1647
  <?php } ?>
1648
  <?php if(get_option('agca_help_menu')==true){ ?>
1649
- jQuery("#contextual-help-link-wrap").css("display","none");
1650
- jQuery("#contextual-help-link").css("display","none");
1651
  <?php } ?>
1652
  <?php if(get_option('agca_privacy_options')==true){ ?>
1653
- jQuery("#privacy-on-link").css("display","none");
1654
  <?php } ?>
1655
 
1656
  <?php if(get_option('agca_update_bar')==true){ ?>
1657
- <?php
1658
- if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1659
- function c2c_no_update_nag() {
1660
- remove_action( 'admin_notices', 'update_nag', 3 );
1661
- }
1662
- endif;
1663
- add_action( 'admin_init', 'c2c_no_update_nag' );
1664
- ?>
1665
- jQuery("#update-nag").css("display","none");
1666
- jQuery(".update-nag").css("display","none");
1667
  <?php } ?>
1668
 
1669
  <?php if(get_option('agca_footer')==true){ ?>
1670
- jQuery("#footer,#wpfooter").css("display","none");
1671
  <?php } ?>
1672
 
1673
  <?php if(get_option('agca_footer_left')!=""){ ?>
1674
- jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1675
  <?php } ?>
1676
  <?php if(get_option('agca_footer_left_hide')==true){ ?>
1677
- jQuery("#footer-left").css("display","none");
1678
  <?php } ?>
1679
  <?php if(get_option('agca_footer_right')!=""){ ?>
1680
- jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1681
  <?php } ?>
1682
  <?php if(get_option('agca_footer_right_hide')==true){ ?>
1683
- jQuery("#footer-upgrade").css("display","none");
1684
  <?php } ?>
1685
 
1686
  <?php if(get_option('agca_language_bar')==true){ ?>
1687
- jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1688
  <?php } ?>
1689
  <?php if(get_option('agca_dashboard_icon')==true){ ?>
1690
- var className = jQuery("#icon-index").attr("class");
1691
- if(className=='icon32'){
1692
- jQuery("#icon-index").attr("id","icon-index-removed");
1693
- }
1694
  <?php } ?>
1695
  <?php if(get_option('agca_dashboard_text')!=""){ ?>
1696
- jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1697
  <?php } ?>
1698
  <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1699
  require_once(ABSPATH . 'wp-includes/formatting.php');
1700
  ?>
1701
- jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1702
 
1703
- jQuery("#agca_custom_dashboard_content").html('<br /><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(wpautop(get_option('agca_dashboard_text_paragraph')))); ?>');
1704
  <?php } ?>
1705
 
1706
  <?php /*Remove Dashboard widgets*/ ?>
@@ -1756,101 +1768,101 @@ try
1756
 
1757
  <?php /*ADMIN MENU*/ ?>
1758
 
1759
- <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1760
- jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1761
- <?php } ?>
1762
- <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1763
- jQuery(".wp-menu-image").each(function(){
1764
- jQuery(this).css("display","none");
1765
- });
1766
- jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1767
- <?php } ?>
1768
- <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1769
- jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1770
-
1771
- <?php } ?>
1772
  <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1773
 
1774
  <?php /*If Turned on*/ ?>
1775
 
1776
- <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1777
- jQuery('#adminmenu > li').each(function(){
1778
- if(!jQuery(this).hasClass('agca_button_only')){
1779
- jQuery(this).addClass('noclass');
1780
- }
1781
- });
1782
- <?php /*Only admin see button*/
1783
- if (current_user_can($this->admin_capability())){ ?>
1784
- jQuery('#adminmenu').append('<?php echo $this->agca_create_admin_button('AG Custom Admin',array('value'=>'tools.php?page=ag-custom-admin/plugin.php','target'=>'_self')); ?>');
1785
- <?php } ?>
1786
- <?php } ?>
1787
 
1788
 
1789
- <?php /*EDIT MENU ITEMS*/?>
1790
- <?php if(get_option('ag_edit_adminmenu_json')!=""){
1791
 
1792
- $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1793
 
1794
- $checkboxes = json_decode($arr[0]);
1795
- $textboxes = json_decode($arr[1]);
1796
 
1797
- $this->migrate_menu_customizations($checkboxes, $textboxes);
1798
 
1799
- } ?>
1800
 
1801
- <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1802
- $this->customized_menu();
1803
- } ?>
1804
 
1805
 
1806
 
1807
 
1808
- /*Add user buttons*/
1809
- jQuery('#adminmenu').append(buttons);
1810
 
1811
  <?php /*END If Turned on*/ ?>
1812
  <?php } else{ ?>
1813
- jQuery("#adminmenu").removeClass("noclass");
1814
  <?php } ?>
1815
 
1816
  reloadRemoveButtonEvents();
1817
 
1818
  <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1819
- //remove collapse menu button
1820
- jQuery('#collapse-menu').remove();
1821
  <?php } ?>
1822
 
1823
  <?php //COLORIZER ?>
1824
  updateAllColors();
1825
  <?php //COLORIZER END ?>
1826
- <?php } //end of apply for any user except admin ?>
1827
- /*Add user buttons*/
1828
- jQuery('#ag_add_adminmenu').append(buttonsJq);
1829
 
1830
 
1831
- }catch(err){
1832
- errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
1833
- console.log(errors);
1834
- }finally{
1835
- jQuery('html').css('visibility','visible');
1836
- }
1837
- <?php
1838
- if($this->saveAfterImport == true){
1839
- ?>savePluginSettings();<?php
1840
  }
1841
  ?>
1842
 
1843
- });
1844
 
1845
- <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
1846
- $this->updateAllColors();
1847
- }else{
1848
- ?>function updateAllColors(){}; <?php
1849
  } ?>
1850
 
1851
 
1852
- /* ]]> */
1853
- </script>
1854
  <style type="text/css">
1855
  .underline_text{
1856
  text-decoration:underline;
@@ -1863,123 +1875,128 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1863
  border:none;
1864
  }
1865
  </style>
1866
- <?php
1867
  }
1868
 
1869
  function print_login_head(){
 
 
 
 
1870
  $this->context = "login";
1871
  $this->error_check();
1872
  $wpversion = $this->get_wp_version();
1873
 
1874
  ?>
1875
  <script type="text/javascript">
1876
- document.write('<style type="text/css">html{visibility:hidden;}</style>');
1877
- var agca_version = "<?php echo $this->agca_version; ?>";
1878
- <?php //var wpversion = "echo $wpversion; ?>
1879
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1880
- var isSettingsImport = false;
1881
- var agca_context = "login";
 
1882
  </script>
1883
  <?php
1884
  $this->prepareAGCALoginTemplates();
1885
  $this->agca_get_includes();
1886
 
1887
- ?>
1888
 
1889
  <script type="text/javascript">
1890
 
1891
 
1892
- /* <![CDATA[ */
1893
  jQuery(document).ready(function() {
1894
  try{
1895
- <?php if(get_option('agca_login_round_box')==true){ ?>
1896
- jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1897
- jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1898
- jQuery("#login h1 a").css("margin-bottom",'10px');
1899
- jQuery("#login h1 a").css("padding-bottom",'0');
1900
- jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1901
  <?php } ?>
1902
  <?php if(get_option('agca_login_banner')==true){ ?>
1903
- jQuery("#backtoblog").css("display","none");
1904
  <?php } ?>
1905
  <?php if(get_option('agca_login_banner_text')==true){ ?>
1906
- jQuery("#backtoblog a").html('<?php echo "← " . addslashes(get_option('agca_login_banner_text')); ?>');
1907
  <?php } ?>
1908
  <?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
1909
- advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
1910
- var $url = "url(" + advanced_url + ")";
1911
- jQuery("#login h1 a").css("background",$url+' no-repeat');
1912
- jQuery("#login h1 a").hide();
1913
- image = jQuery("<img />").attr("src",advanced_url);
1914
- jQuery(image).load(function() {
1915
- var originalWidth = 326;
1916
- var widthDiff = this.width - originalWidth;
1917
- jQuery("#login h1 a").height(this.height);
1918
- jQuery("#login h1 a").width(this.width);
1919
- jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
1920
-
1921
- var loginWidth = jQuery('#login').width();
1922
- var originalLoginWidth = 320;
1923
- var photoWidth = this.width;
1924
-
1925
- if(loginWidth > photoWidth){
1926
- jQuery("#login h1 a").css('margin','auto');
1927
- }else{
1928
- jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
1929
- }
1930
 
1931
- jQuery("#login h1 a").show();
1932
- });
1933
  <?php } ?>
1934
  <?php if(get_option('agca_login_photo_href')==true){ ?>
1935
- var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
1936
- $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1937
 
1938
- jQuery("#login h1 a").attr("href",$href);
1939
  <?php } ?>
1940
  <?php if(get_option('agca_login_photo_remove')==true){ ?>
1941
- jQuery("#login h1 a").css("display","none");
1942
  <?php } ?>
1943
 
1944
- jQuery("#login h1 a").attr("title","");
1945
 
1946
  <?php if(get_option('agca_login_register_remove')==true){ ?>
1947
- if(jQuery('p#nav').size() > 0){
1948
- jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
1949
- }
1950
- jQuery('p#nav a').each(function(){
1951
- if(jQuery(this).attr('href').indexOf('register') != -1){
1952
- jQuery(this).remove();
1953
- }
1954
- });
1955
 
1956
  <?php } ?>
1957
  <?php if(get_option('agca_login_register_href')!=""){ ?>
1958
- jQuery('p#nav a').each(function(){
1959
- if(jQuery(this).attr('href').indexOf('register') != -1){
1960
- jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
1961
- }
1962
- });
1963
 
1964
  <?php } ?>
1965
 
1966
  <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
1967
- if(jQuery('p#nav').size() > 0){
1968
- jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
1969
- }
1970
- jQuery('p#nav a').each(function(){
1971
- if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
1972
- jQuery(this).remove();
1973
- }
1974
- });
1975
 
1976
  <?php } ?>
1977
 
1978
 
1979
  <?php //COLORIZER ?>
1980
  <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
1981
- jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1982
- jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
1983
 
1984
 
1985
  <?php
@@ -1987,17 +2004,17 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
1987
 
1988
  } ?>
1989
  <?php //COLORIZER END ?>
1990
- }catch(err){
1991
- console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
1992
- }finally{
1993
- jQuery('html').show();
1994
- jQuery('html').css('visibility','visible');
1995
- }
1996
  });
1997
- /* ]]> */
1998
 
1999
  </script>
2000
- <?php
2001
  }
2002
 
2003
  function agca_admin_page() {
@@ -2006,17 +2023,17 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2006
  $this->agca_error_check();
2007
  ?>
2008
  <?php //includes ?>
2009
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
2010
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2011
 
2012
- <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
2013
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2014
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
2015
- <script type="text/javascript">
2016
- var templates_ep = "<?php echo $this->templates_ep; ?>";
2017
- var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
2018
- </script>
2019
- <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
2020
  <?php //includes ?>
2021
  <div class="wrap">
2022
  <h1 id="agca-title">AG Custom Admin Settings <span style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
@@ -2024,43 +2041,44 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2024
  <div class="fb-like" data-href="https://www.facebook.com/AG-Custom-Admin-892218404232342/timeline" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div>
2025
  </div>
2026
  <div id="agca_error_placeholder"></div>
2027
- <div id="agca_news">&nbsp;</div><br />
2028
  <form method="post" id="agca_form" action="options.php">
2029
  <?php wp_nonce_field('agca_form','_agca_token'); ?>
2030
  <?php settings_fields( 'agca-options-group' ); ?>
2031
- <div id="agca-your-feedback">
2032
- <strong>
2033
- <span style="color:#005B69">Your feedback:</span>
2034
- </strong>
2035
- <a class="feedback positive" target="_blank" title="POSITIVE FEEDBACK: I like this plugin!" href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-positive-feedback/">
2036
- <span class="dashicons dashicons-thumbs-up"></span>
2037
- </a>
2038
- <a class="feedback negative" target="_blank" title="NEGATIVE FEEDBACK: I don't like this plugin." href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-negative-feedback/">
2039
- <span class="dashicons dashicons-thumbs-down"></span>
2040
- </a>
2041
- </div>
2042
- <br />
2043
- <ul id="ag_main_menu">
2044
- <li class="selected"><a href="#general-settings" title="General Settings" >General</a></li>
2045
- <li class="normal"><a href="#admin-bar-settings" title="Settings for admin bar" >Admin Bar</a></li>
2046
- <li class="normal"><a href="#admin-footer-settings" title="Settings for admin footer" >Admin Footer</a></li>
2047
- <li class="normal"><a href="#dashboad-page-settings" title="Settings for Dashboard page">Dashboard Page</a></li>
2048
- <li class="normal"><a href="#login-page-settings" title="Settings for Login page">Login Page</a></li>
2049
- <li class="normal" ><a href="#admin-menu-settings" title="Settings for main admin menu">Admin Menu</a></li>
2050
- <li class="normal"><a href="#ag-colorizer-setttings" title="AG colorizer settings">Colorizer</a></li>
2051
- <li class="normal"><a href="#ag-advanced" title="My custom scripts">Advanced</a></li>
2052
- <li class="normal" style=""><a style="color:#DB6014;font-weight:bolder;" href="#ag-templates" title="AG Custom Admin Themes">Admin Themes</a></li>
2053
-
2054
- <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" target="_blank" style="margin-left:8px" title="Like this plugin? You can support its future development by giving a donation by your wish " href="http://wordpressadminpanel.com/agca-support/support-for-future-development/"><img alt="Donate" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>images/btn_donate_LG.gif" /></a>
2055
- </li>
2056
- <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2057
- </ul>
2058
- <div id="agca_advertising">
2059
- <ul>
2060
- <li style="min-height:105px;display: block"></li>
2061
- </ul>
2062
- </div>
2063
- <div class="agca-clear"></div>
 
2064
  <div id="section_general" style="display:none" class="ag_section">
2065
  <h2 class="section_title">General Settings</h2>
2066
  <p tabindex="0" class="agca-clear agca-tip"><i><strong>Tip: </strong>Move mouse cursor over the option label to see more information about an option</i></p>
@@ -2134,701 +2152,701 @@ jQuery('#ag_add_adminmenu').append(buttonsJq);
2134
  </tr>
2135
  </table>
2136
  </div>
2137
- <div id="section_admin_bar" class="ag_section">
2138
- <h2 class="section_title">Admin Bar Settings</h2>
2139
- <table class="form-table" width="500px">
2140
 
2141
- <?php
2142
- $this->print_checkbox(array(
2143
- 'attributes'=>array(
2144
- 'class'=>'ag_table_major_options',
2145
- ),
2146
- 'hide'=>true,
2147
- 'title'=>'Hides admin bar completely from the admin panel',
2148
- 'name'=>'agca_header',
2149
- 'label'=>'<strong>Admin bar</strong>',
2150
- 'input-attributes'=>'data-dependant="#agca_header_show_logout_content"',
2151
- 'input-class'=>'has-dependant',
2152
- ));
2153
-
2154
- $this->print_checkbox(array(
2155
- 'attributes'=>array(
2156
- 'class'=>'ag_table_major_options',
2157
- 'style'=> ((get_option('agca_header')!='true')?'display:none':''),
2158
- 'id'=>'agca_header_show_logout_content',
2159
- ),
2160
- 'title'=>'Check this if you want to show Log Out button in top right corner of the admin page',
2161
- 'name'=>'agca_header_show_logout',
2162
- 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2163
- 'label'=>'<strong>(but show Log Out button)</strong>'
2164
- ));
2165
-
2166
- $this->print_checkbox(array(
2167
- 'title'=>'Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.',
2168
- 'name'=>'agca_admin_bar_frontend',
2169
- 'hide'=>true,
2170
- 'label'=>'Site pages: Admin bar customizations'
2171
- ));
2172
-
2173
- $this->print_checkbox(array(
2174
- 'title'=>'Hides admin bar completely for authenticated users on site pages.',
2175
- 'name'=>'agca_admin_bar_frontend_hide',
2176
- 'hide'=>true,
2177
- 'label'=>'Site pages: Admin bar'
2178
- ));
2179
-
2180
- $this->print_options_h3('Left Side');
2181
-
2182
- $this->print_input(array(
2183
- 'title'=>'Change default WordPress logo with custom image.',
2184
- 'name'=>'agca_wp_logo_custom',
2185
- 'label'=>'Admin bar logo',
2186
- 'hint' =>'Image URL (maximum height is 28px)'
2187
- ));
2188
-
2189
- $this->print_input(array(
2190
- 'title'=>'Custom link on admin bar logo.</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL</br><strong>%SWITCH%</strong> - to switch betweent admin and site area',
2191
- 'name'=>'agca_wp_logo_custom_link',
2192
- 'label'=>'Admin bar logo link',
2193
- 'hint' =>'Link'
2194
- ));
2195
-
2196
- $this->print_input(array(
2197
- '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>',
2198
- 'name'=>'agca_custom_title',
2199
- 'label'=>'Page title template',
2200
- 'hint' =>'Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.'
2201
- ));
2202
-
2203
- $this->print_input(array(
2204
- 'title'=>'Add custom image on the top of the admin content.',
2205
- 'name'=>'agca_header_logo_custom',
2206
- 'label'=>'Header image',
2207
- 'hint' =>'Image URL'
2208
- ));
2209
-
2210
-
2211
- $this->print_checkbox(array(
2212
- 'hide'=>true,
2213
- 'title'=>'Hides small Wordpress logo from the admin bar',
2214
- 'name'=>'agca_header_logo',
2215
- 'label'=>'WordPress logo'
2216
- ));
2217
-
2218
- $this->print_checkbox(array(
2219
- 'hide'=>true,
2220
- 'title'=>'Hides WordPress context menu on WordPress logo icon from admin bar',
2221
- 'name'=>'agca_remove_top_bar_dropdowns',
2222
- 'label'=>'WordPress logo context menu'
2223
- ));
2224
-
2225
- $this->print_checkbox(array(
2226
- 'hide'=>true,
2227
- 'title'=>'Hides site name link from the admin bar',
2228
- 'name'=>'agca_remove_site_link',
2229
- 'label'=>'Site name'
2230
- ));
2231
-
2232
- $this->print_checkbox(array(
2233
- 'hide'=>true,
2234
- 'title'=>'Hides update notifications from admin bar',
2235
- 'name'=>'agca_admin_bar_update_notifications',
2236
- 'label'=>'Update notifications'
2237
- ));
2238
-
2239
- $this->print_checkbox(array(
2240
- 'hide'=>true,
2241
- 'title'=>'Hides comments block from admin bar',
2242
- 'name'=>'agca_admin_bar_comments',
2243
- 'label'=>'"Comments" block'
2244
- ));
2245
-
2246
- $this->print_checkbox(array(
2247
- 'hide'=>true,
2248
- 'attributes'=>array(
2249
- 'style'=>'margin-top:20px;'
2250
- ),
2251
- 'title'=>'Hides "+ New" block and its context menu from admin bar',
2252
- 'name'=>'agca_admin_bar_new_content',
2253
- 'label'=>'"+ New" block',
2254
- 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2255
- 'input-class'=>'has-dependant dependant-opposite'
2256
- ));
2257
-
2258
- $this->print_checkbox(array(
2259
- 'hide'=>true,
2260
- 'attributes'=>array(
2261
- 'class'=>'new_content_header_submenu'
2262
- ),
2263
- 'title'=>'Hides "Post" sub-menu from "+ New" block on admin bar',
2264
- 'name'=>'agca_admin_bar_new_content_post',
2265
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Post sub-menu'
2266
- ));
2267
-
2268
- $this->print_checkbox(array(
2269
- 'hide'=>true,
2270
- 'attributes'=>array(
2271
- 'class'=>'new_content_header_submenu'
2272
- ),
2273
- 'title'=>'Hides "Link" sub-menu from "+ New" block on admin bar',
2274
- 'name'=>'agca_admin_bar_new_content_link',
2275
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Link sub-menu'
2276
- ));
2277
-
2278
- $this->print_checkbox(array(
2279
- 'hide'=>true,
2280
- 'attributes'=>array(
2281
- 'class'=>'new_content_header_submenu'
2282
- ),
2283
- 'title'=>'Hides "Page" sub-menu from "+ New" block on admin bar',
2284
- 'name'=>'agca_admin_bar_new_content_page',
2285
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Page sub-menu'
2286
- ));
2287
-
2288
- $this->print_checkbox(array(
2289
- 'hide'=>true,
2290
- 'attributes'=>array(
2291
- 'class'=>'new_content_header_submenu'
2292
- ),
2293
- 'title'=>'Hides "User" sub-menu from "+ New" block on admin bar',
2294
- 'name'=>'agca_admin_bar_new_content_user',
2295
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> User sub-menu'
2296
- ));
2297
-
2298
- $this->print_checkbox(array(
2299
- 'hide'=>true,
2300
- 'attributes'=>array(
2301
- 'class'=>'new_content_header_submenu'
2302
- ),
2303
- 'title'=>'Hides "Media" sub-menu from "+ New" block on admin bar',
2304
- 'name'=>'agca_admin_bar_new_content_media',
2305
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Media sub-menu'
2306
- ));
2307
-
2308
- $this->print_checkbox(array(
2309
- 'hide'=>true,
2310
- 'title'=>'Hides "Admin themes" from admin bar',
2311
- 'name'=>'agca_admin_bar_admin_themes',
2312
- 'label'=>'"Admin themes"'
2313
- ));
2314
-
2315
- $this->print_textarea(array(
2316
- 'title'=>'Adds custom text in admin top bar.',
2317
- 'name'=>'agca_custom_site_heading',
2318
- 'label'=>'Custom blog heading',
2319
- 'hint'=>"<strong>Tip: </strong>You can use HTML tags like &lt;h1&gt; or &lt;a&gt;"
2320
- ));
2321
-
2322
-
2323
- $this->print_checkbox(array(
2324
- 'hide'=>true,
2325
- 'title'=>'Hides yellow bar with information about new WordPress release',
2326
- 'name'=>'agca_update_bar',
2327
- 'label'=>'Update WordPress notification'
2328
- ));
2329
-
2330
- $this->print_options_h3('Right Side');
2331
-
2332
- $this->print_input(array(
2333
- 'name'=>'agca_howdy',
2334
- 'label'=>'Change Howdy text',
2335
- ));
2336
-
2337
- $this->print_input(array(
2338
- 'title'=>'Put \'Exit\', for example',
2339
- 'name'=>'agca_logout',
2340
- 'label'=>'Change Log out text',
2341
- ));
2342
-
2343
- $this->print_checkbox(array(
2344
- 'hide'=>true,
2345
- 'name'=>'agca_remove_your_profile',
2346
- 'label'=>'"Edit My Profile" option from dropdown menu'
2347
- ));
2348
-
2349
- $this->print_checkbox(array(
2350
- 'title'=>'If selected, hides all elements in top right corner, except Log Out button',
2351
- 'name'=>'agca_logout_only',
2352
- 'label'=>'Log out only'
2353
- ));
2354
 
2355
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2356
 
2357
- </table>
2358
- </div>
2359
-
2360
- <div id="section_admin_footer" style="display:none" class="ag_section">
2361
- <h2 class="section_title">Admin Footer Settings</h2>
2362
- <table class="form-table" width="500px">
2363
- <?php
2364
- $this->print_checkbox(array(
2365
- 'hide'=>true,
2366
- 'attributes'=>array(
2367
- 'class'=>'ag_table_major_options'
2368
- ),
2369
- 'title'=>'Hides footer with all elements',
2370
- 'name'=>'agca_footer',
2371
- 'label'=>'<strong>Footer</strong>'
2372
- ));
2373
-
2374
- $this->print_options_h3('Footer Options');
2375
-
2376
- $this->print_checkbox(array(
2377
- 'hide'=>true,
2378
- 'title'=>'Hides default text in footer',
2379
- 'name'=>'agca_footer_left_hide',
2380
- 'label'=>'Footer text'
2381
- ));
2382
-
2383
- $this->print_textarea(array(
2384
- 'title'=>'Replaces text \'Thank you for creating with WordPress\' with custom text',
2385
- 'name'=>'agca_footer_left',
2386
- 'label'=>'Change footer text'
2387
- ));
2388
-
2389
- $this->print_checkbox(array(
2390
- 'hide'=>true,
2391
- 'title'=>'Hides text \'Get Version ...\' on right',
2392
- 'name'=>'agca_footer_right_hide',
2393
- 'label'=>'Version text'
2394
- ));
2395
-
2396
- $this->print_textarea(array(
2397
- 'title'=>'Replaces text \'Get Version ...\' with custom text',
2398
- 'name'=>'agca_footer_right',
2399
- 'label'=>'Change version text'
2400
- ));
2401
-
2402
- ?>
2403
-
2404
- </table>
2405
- </div>
2406
- <div id="section_dashboard_page" style="display:none" class="ag_section">
2407
- <h2 class="section_title">Dashboard Page Settings</h2>
2408
- <table class="form-table" width="500px">
2409
- <?php
2410
-
2411
- $this->print_options_h3('Dashboard Page Options');
2412
-
2413
- $this->print_input(array(
2414
- 'title'=>"Main heading ('Dashboard') on Dashboard page",
2415
- 'name'=>'agca_dashboard_text',
2416
- 'label'=>'Change Dashboard heading text',
2417
- ));
2418
-
2419
- ?>
2420
- <tr valign="center">
2421
- <th scope="row">
2422
- <label title="Adds custom text (or HTML) between heading and widgets area on Dashboard page" for="agca_dashboard_text_paragraph">Add custom Dashboard content<br> <em>(text or HTML content)</em></label>
2423
- </th>
2424
- <td class="agca_editor">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2425
  <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2426
- </td>
2427
- </tr>
2428
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2429
 
2430
- $this->print_options_h3('Dashboard Widgets Options');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2431
 
2432
- ?>
2433
- <tr>
2434
- <td colspan="2">
2435
- <p tabindex="0" class="agca-tip"><i><strong>Note:</strong> These settings override settings in Screen options on Dashboard page.</i></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2436
  </td>
2437
- </tr>
2438
- <?php
2439
- $this->print_checkbox(array(
2440
- 'hide'=>true,
2441
- 'title'=>'Hides Welcome WordPress widget',
2442
- 'name'=>'agca_dashboard_widget_welcome',
2443
- 'label'=>'"Welcome" widget'
2444
- ));
2445
-
2446
- $this->print_checkbox(array(
2447
- 'hide'=>true,
2448
- 'title'=>'Hides Activity dashboard widget',
2449
- 'name'=>'agca_dashboard_widget_activity',
2450
- 'label'=>'"Activity" widget'
2451
- ));
2452
-
2453
- $this->print_checkbox(array(
2454
- 'hide'=>true,
2455
- 'title'=>'Hides Quick Draft dashboard widget',
2456
- 'name'=>'agca_dashboard_widget_qp',
2457
- 'label'=>'"Quick Draft" widget'
2458
- ));
2459
-
2460
- $this->print_checkbox(array(
2461
- 'hide'=>true,
2462
- 'title'=>'Hides At a Glance dashboard widget',
2463
- 'name'=>'agca_dashboard_widget_rn',
2464
- 'label'=>'"At a Glance" widget'
2465
- ));
2466
-
2467
- $this->print_checkbox(array(
2468
- 'hide'=>true,
2469
- 'name'=>'agca_dashboard_widget_primary',
2470
- 'title'=>"This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions",
2471
- 'label'=>'"WordPress News" widget'
2472
- ));
2473
-
2474
- $this->print_checkbox(array(
2475
- 'hide'=>true,
2476
- 'name'=>'agca_dashboard_widget_secondary',
2477
- 'title'=>"This is 'Other WordPress News' widget by default",
2478
- 'label'=>'Secondary widget area'
2479
- ));
2480
-
2481
- ?>
2482
- </table>
2483
- </div>
2484
- <div id="section_login_page" style="display:none" class="ag_section">
2485
- <h2 class="section_title">Login Page Settings</h2>
2486
- <table class="form-table" width="500px">
2487
- <?php
2488
-
2489
- $this->print_options_h3('Login Page Options');
2490
-
2491
- $this->print_checkbox(array(
2492
- 'hide'=>true,
2493
- 'name'=>'agca_login_banner',
2494
- 'title'=>"Hide back to blog block",
2495
- 'label'=>'Back to blog text'
2496
- ));
2497
-
2498
- $this->print_input(array(
2499
- 'name'=>'agca_login_banner_text',
2500
- 'title'=>"Changes '<- Back to ...' text in top bar on Login page",
2501
- 'label'=>'Change back to blog text'
2502
- ));
2503
-
2504
- $this->print_input(array(
2505
- 'title'=>'If this field is not empty, image from provided url will be visible on Login page',
2506
- 'name'=>'agca_login_photo_url',
2507
- 'label'=>'Change Login header image',
2508
- 'hint'=>'Image URL'
2509
- ));
2510
-
2511
- $this->print_input(array(
2512
- 'title'=>'Put here custom link to a web location, that will be triggered on image click',
2513
- 'name'=>'agca_login_photo_href',
2514
- 'label'=>'Change link on login image',
2515
- 'hint'=>'For blog URL use %BLOG%'
2516
- ));
2517
-
2518
- $this->print_checkbox(array(
2519
- 'hide'=>true,
2520
- 'title'=>'Hides login image completely',
2521
- 'name'=>'agca_login_photo_remove',
2522
- 'label'=>'Login header image',
2523
- ));
2524
-
2525
- $this->print_checkbox(array(
2526
- 'title'=>'Rounds box on login page',
2527
- 'name'=>'agca_login_round_box',
2528
- 'label'=>'Round box corners',
2529
- 'input-class'=>'has-dependant',
2530
- 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2531
- ));
2532
-
2533
- $this->print_input(array(
2534
- 'attributes'=>array(
2535
- 'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2536
- 'id'=>'agca_login_round_box_size_block'
2537
- ),
2538
- 'title'=>'Size of rounded box curve',
2539
- 'name'=>'agca_login_round_box_size',
2540
- 'label'=>'Round box corners - size',
2541
- 'input-class'=>'validateNumber',
2542
- 'hint'=>'(Size in px)'
2543
- ));
2544
-
2545
- $this->print_checkbox(array(
2546
- 'hide'=>true,
2547
- 'title'=>'Hides register link on login page',
2548
- 'name'=>'agca_login_register_remove',
2549
- 'label'=>'Register link',
2550
- 'input-class'=>'has-dependant dependant-opposite',
2551
- 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2552
- ));
2553
-
2554
- $this->print_input(array(
2555
- 'attributes'=>array(
2556
- 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2557
- 'id'=>'agca_login_register_href_block'
2558
- ),
2559
- 'title'=>'Change register link on login page to point to your custom registration page.',
2560
- 'name'=>'agca_login_register_href',
2561
- 'label'=>'Change register link',
2562
- 'hint'=>'Link to new registration page'
2563
- ));
2564
-
2565
- $this->print_checkbox(array(
2566
- 'hide'=>true,
2567
- 'title'=>'Hides lost password link on login page',
2568
- 'name'=>'agca_login_lostpassword_remove',
2569
- 'label'=>'Lost password link',
2570
- ));
2571
- ?>
2572
- </table>
2573
- </div>
2574
  <?php
2575
- /*ADMIN MENU*/
2576
  ?>
2577
- <div id="section_admin_menu" style="display:none" class="ag_section">
2578
- <h2 class="section_title">Admin Menu Settings</h2>
2579
- <table class="form-table" width="500px">
2580
- <tr valign="center" class="ag_table_major_options">
2581
- <td><label for="agca_admin_menu_turnonoff"><strong>Apply admin menu customizations</strong></label></td>
2582
- <td>
2583
- <strong>
2584
-
2585
- <input class="agca-radio" type="radio" id="agca_admin_menu_turnonoff_on" name="agca_admin_menu_turnonoff" title="Apply admin menu customizations" value="on" <?php if(get_option('agca_admin_menu_turnonoff') == 'on') echo 'checked="checked" '; ?> />
2586
- <span class="agca-radio-text on">YES</span>
2587
- &nbsp;&nbsp;&nbsp;&nbsp;
2588
- <input class="agca-radio" type="radio" name="agca_admin_menu_turnonoff" title="Do not apply admin menu customizations" value="off" <?php if(get_option('agca_admin_menu_turnonoff') != 'on') echo 'checked="checked"'; ?> />
2589
- <span class="agca-radio-text off">NO</span>
2590
- </strong>
2591
- </td>
2592
- </tr>
2593
- <tr valign="center" class="ag_table_major_options">
2594
- <td><label for="agca_admin_menu_agca_button_only"><strong>Admin menu</strong></label></td>
2595
- <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_agca_button_only" title="Hides admin menu completly (administrator can see 'AG custom admin' button)" value="true" <?php if (get_option('agca_admin_menu_agca_button_only')==true) echo 'checked="checked" '; ?> /></td>
2596
- </tr>
2597
- <?php
2598
- $this->print_options_h3('Edit / Remove Menu Items');
2599
- ?>
2600
- <tr>
2601
- <td colspan="2">
2602
- <input type="button" class="agca_button" id="ag_edit_adminmenu_reset_button" title="Reset menu settings to default values" name="ag_edit_adminmenu_reset_button" value="Reset to default settings" /><br />
2603
- <p tabindex="0"><em>(click on the top menu item to show its sub-menus)</em></p>
2604
- <table id="ag_edit_adminmenu">
2605
- <tr style="background-color:#999;">
2606
- <td width="300px"><div style="float:left;color:#fff;"><h3>Item</h3></div><div style="float:right;color:#fff;"><h3>Visibility</h3></div></td><td width="300px" style="color:#fff;" ><h3>Change Text</h3>
2607
- </td>
2608
- </tr>
2609
- </table>
2610
- <input type="hidden" size="47" id="ag_edit_adminmenu_json" name="ag_edit_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_edit_adminmenu_json')); ?>" />
2611
- <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2612
- </td>
2613
- <td></td>
2614
- </tr>
2615
- <?php
2616
- $this->print_options_h3('Add New Menu Items');
2617
- ?>
2618
- <tr>
2619
- <td colspan="2">
2620
- <table id="ag_add_adminmenu">
2621
- <tr>
2622
- <td colspan="2">
2623
- name:<input type="text" size="47" title="New button visible name" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
2624
- url:<input type="text" size="47" title="New button link" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
2625
- open in:<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:95px">
2626
- <option value="_self" selected>same tab</option>
2627
- <option value="_blank" >new tab</option>
2628
- </select>
2629
- <input type="button" id="ag_add_adminmenu_button" class="agca_button" title="Add new item button" name="ag_add_adminmenu_button" value="Add new item" />
2630
- </td><td></td>
2631
- </tr>
2632
- </table>
2633
  <input type="hidden" size="47" id="ag_add_adminmenu_json" name="ag_add_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_add_adminmenu_json')); ?>" />
2634
- </td>
2635
- <td>
2636
- </td>
2637
- </tr>
2638
- <?php
2639
- $this->print_options_h3('Admin Menu Settings');
2640
- ?>
2641
- <tr valign="center">
2642
- <th scope="row">
2643
- <label title="Choose how admin menu should behave on mobile devices / small screens" for="agca_admin_menu_autofold">Admin menu auto folding</label>
2644
- </th>
2645
- <td>
2646
- <select title="Choose how admin menu should behave on mobile devices / small screens" class="agca-selectbox" name="agca_admin_menu_autofold" >
2647
- <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> >Default</option>
2648
- <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> >Force admin menu auto-folding</option>
2649
- <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> >Disable admin menu auto-folding</option>
2650
- </select>
2651
- </td>
2652
- </tr>
2653
- <?php
2654
-
2655
- $this->print_checkbox(array(
2656
- 'hide'=>true,
2657
- 'title'=>'Removes empty space between some top menu items',
2658
- 'name'=>'agca_admin_menu_separators',
2659
- 'label'=>'Menu items separators',
2660
- ));
2661
-
2662
- $this->print_checkbox(array(
2663
- 'hide'=>true,
2664
- 'title'=>'Removes icons from dmin menu buttons',
2665
- 'name'=>'agca_admin_menu_icons',
2666
- 'label'=>'Menu icons',
2667
- ));
2668
-
2669
- $this->print_checkbox(array(
2670
- 'hide'=>true,
2671
- 'title'=>'Removes small arrow that appears on the top button hover',
2672
- 'name'=>'agca_admin_menu_arrow',
2673
- 'label'=>'Sub-menu arrow',
2674
- ));
2675
-
2676
- $this->print_checkbox(array(
2677
- 'hide'=>true,
2678
- 'title'=>'Removes collapse button at the end of admin menu',
2679
- 'name'=>'agca_admin_menu_collapse_button',
2680
- 'label'=>'"Collapse menu" button',
2681
- ));
2682
-
2683
- $this->print_checkbox(array(
2684
- 'title'=>'Rounds submenu pop-up box',
2685
- 'name'=>'agca_admin_menu_submenu_round',
2686
- 'label'=>'Round sub-menu pop-up box',
2687
- 'input-attributes'=>'data-dependant="#agca_admin_menu_submenu_round_size"',
2688
- 'input-class'=>'has-dependant',
2689
- ));
2690
-
2691
- $this->print_input(array(
2692
- 'attributes'=>array(
2693
- 'style'=> ((get_option('agca_admin_menu_submenu_round')!='true')?'display:none':''),
2694
- 'id'=>'agca_admin_menu_submenu_round_size'
2695
- ),
2696
- 'title'=>'Size of rounded box curve',
2697
- 'name'=>'agca_admin_menu_submenu_round_size',
2698
- 'label'=>'Round sub-menu pop-up box - size',
2699
- 'input-class'=>'validateNumber',
2700
- 'hint'=>'(Size in px)'
2701
- ));
2702
-
2703
- $this->print_input(array(
2704
- 'title'=>'Adds custom logo above the admin menu',
2705
- 'name'=>'agca_admin_menu_brand',
2706
- 'label'=>'Admin menu branding with logo',
2707
- 'hint'=>'Image URL'
2708
- ));
2709
-
2710
- $this->print_input(array(
2711
- 'title'=>'Change branding logo link</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL',
2712
- 'name'=>'agca_admin_menu_brand_link',
2713
- 'label'=>'Branding logo link',
2714
- 'hint'=>'Branding image URL'
2715
- ));
2716
- ?>
2717
- </table>
2718
- </div>
2719
- <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2720
- <h2 class="section_title">Colorizer Page</h2>
2721
- <table class="form-table" width="500px">
2722
- <tr valign="center" class="ag_table_major_options">
2723
- <td><label for="agca_colorizer_turnonoff"><strong>Apply Colorizer settings</strong></label></td>
2724
- <td><strong><input class="agca-radio" type="radio" name="agca_colorizer_turnonoff" title="Apply Colorizer customizations" value="on" <?php if(get_option('agca_colorizer_turnonoff') == 'on') echo 'checked="checked" '; ?> /><span class="agca-radio-text on">YES</span>&nbsp;&nbsp;&nbsp;&nbsp;<input class="agca-radio" type="radio" name="agca_colorizer_turnonoff" title="Do not apply Colorizer customizations" value="off" <?php if(get_option('agca_colorizer_turnonoff') != 'on') echo 'checked="checked"'; ?> /><span class="agca-radio-text off">NO</span></strong></td>
2725
- </tr>
2726
- <?php
2727
- $this->print_options_h3('Global Color Options');
2728
-
2729
- $this->print_color('color_background','Background:','Change admin page background color');
2730
- $this->print_color('login_color_background','Login page background:','Change login page background color');
2731
- $this->print_color('color_header','Admin bar:','Change admin bar (on top) color in admin panel');
2732
-
2733
- $this->print_options_h3('Admin Menu Color Options');
2734
-
2735
- $this->print_color('color_admin_menu_top_button_background','Button background:','Change button background color');
2736
- $this->print_color('color_admin_menu_font','Button text:','Change button text color');
2737
- $this->print_color('color_admin_menu_top_button_current_background','Selected button background:','Change button background color for current button');
2738
- $this->print_color('color_admin_menu_top_button_hover_background','Hover button background:','Change button background color on mouseover');
2739
- $this->print_color('color_admin_menu_submenu_background','Sub-menu button background:','Change submenu item background color');
2740
- $this->print_color('color_admin_menu_submenu_background_hover','Sub-menu hover button background:','Change submenu item background color on mouseover');
2741
- $this->print_color('color_admin_submenu_font','Sub-menu text:','Sub-menu text color');
2742
- $this->print_color('color_admin_menu_behind_background','Wrapper background:','Change background color of element behind admin menu');
2743
-
2744
- $this->print_options_h3('Font Color Options');
2745
-
2746
- $this->print_color('color_font_content','Content text:','Change color in content text');
2747
- $this->print_color('color_font_header','Admin bar text:','Change color of admin bar text');
2748
- $this->print_color('color_font_footer','Footer text:','Change color in fotter text');
2749
-
2750
- $this->print_options_h3('Widgets Color Options');
2751
-
2752
- $this->print_color('color_widget_bar','Title bar background:','Change color in header text');
2753
- $this->print_color('color_widget_background','Background:','Change widget background color');
2754
 
2755
- ?>
2756
- </table>
2757
- <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
2758
- <div id="picker"></div>
2759
- </div>
2760
- <div id="section_templates" style="display:none" class="ag_section">
2761
- <h2 class="section_title"><span style="float:left">Admin Themes</span></h2>
2762
- <table class="form-table" width="500px">
2763
- <tr valign="center">
2764
- <td>
2765
- <div id="agca_templates"></div>
2766
- </td>
2767
- </tr>
2768
- <tr>
2769
- <td>
2770
- <div id="advanced_template_options" style="display:none">
2771
- <div class="agca-feedback-and-support">
2772
- <ul>
2773
- <li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=theme" title="If you have any ideas for theme improvements, or you have new themes requests, please feel free to send us a message" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;Submit your admin themes ideas</a></li>
2774
- <li><a style="background: #f08080;color:#fff;" href="javascript:agca_removeAllTemplates();" title="WARNING: All installed themes will be removed. To activate them again, you would need to install theme and activate using valid license keys. Free themes can be installed again."><span style="color:#fff" class="dashicons dashicons-trash"></span>&nbsp;&nbsp;Uninstall all installed themes</a></li>
2775
- </ul>
2776
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2777
  </div>
2778
- </td>
2779
- </tr>
2780
- </table>
2781
- </div>
2782
- <div id="section_advanced" style="display:none" class="ag_section">
2783
- <h2 class="section_title">Advanced</h2>
2784
- <table class="form-table" width="500px">
2785
- <tr valign="center">
2786
- <td colspan="2">
2787
- <p class="agca-tip"><i><strong>Note: </strong>These options will override existing customizations</i></p>
2788
- </td><td></td>
2789
- </tr>
2790
- <tr valign="center">
2791
- <th scope="row">
2792
- <label title="Add custom CSS script to override existing styles" for="agca_script_css">Custom CSS script</em></label>
2793
- </th>
2794
- <td>
2795
- <textarea style="width:100%;height:200px" title="Add custom CSS script to override existing styles" rows="5" id="agca_custom_css" name="agca_custom_css" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_css')); ?></textarea>
2796
- </td>
2797
- </tr>
2798
- <tr valign="center">
2799
- <th scope="row">
2800
- <label title="Add additional custom JavaScript" for="agca_custom_js">Custom JavaScript</label>
2801
- </th>
2802
- <td>
2803
- <textarea style="width:100%;height:200px" title="Add additional custom JavaScript" rows="5" name="agca_custom_js" id="agca_custom_js" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_js')); ?></textarea>
2804
- </td>
2805
- </tr>
2806
- <tr valign="center">
2807
- <th scope="row">
2808
- <label title="Export / import settings" for="agca_export_import">Export / import settings</label>
2809
- </th>
2810
- <td id="import_file_area">
2811
- <input class="agca_button" type="button" name="agca_export_settings" value="Export Settings" onclick="exportSettings();"/></br>
2812
- <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
2813
- <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
2814
- <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
2815
- <input class="agca_button" type="button" name="agca_import_settings" value="Import Settings" onclick="importSettings();"/>
2816
- </td>
2817
- </tr>
2818
- </table>
2819
- </div>
 
2820
  <p class="submit">
2821
- <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()" />
2822
  </p>
2823
 
2824
  </form>
2825
  <form id="agca_templates_form" name="agca_templates_form" action="<?php echo $_SERVER['PHP_SELF'];?>?page=ag-custom-admin/plugin.php" method="post">
2826
- <?php wp_nonce_field('agca_form','_agca_token'); ?>
2827
- <input type="hidden" name="_agca_save_template" value="true" />
2828
- <input type="hidden" id="templates_data" name="templates_data" value="" />
2829
- <input type="hidden" id="templates_name" name="templates_name" value="" />
2830
  </form>
2831
- </div>
2832
  <?php
2833
  }
2834
 
4
  Plugin URI: http://wordpressadminpanel.com/ag-custom-admin/
5
  Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
  Author: WAP
7
+ Version: 5.5
8
  Author URI: http://www.wordpressadminpanel.com/
9
 
10
  Copyright 2016. WAP (email : info@wordpressadminpanel.com)
27
 
28
  class AGCA{
29
  private $colorizer="";
30
+ private $active_plugins = null;
31
  private $agca_version;
32
  private $agca_debug = false;
33
  private $admin_capabilities;
60
  /*Initialize properties*/
61
  $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
62
 
63
+ $this->agca_version = "5.5";
64
 
65
  //TODO:upload images programmaticaly
66
 
91
 
92
  function agca_init_session(){
93
  if (!session_id())
94
+ session_start();
95
  }
96
 
97
  function checkGET(){
113
 
114
  function checkPOST(){
115
  if(isset($_POST['_agca_save_template'])){
116
+ $this->verifyPostRequest();
117
+ //print_r($_POST);
118
+ $data = $_POST['templates_data'];
119
+ $parts = explode("|||",$data);
120
 
121
+ $common_data = $parts [0];
122
+ $admin_js = $parts [1];
123
+ $admin_css = $parts [2];
124
+ $login_js = $parts [3];
125
+ $login_css = $parts [4];
126
+ $settings = $parts [5];
127
+ $images = $parts [6];
128
 
129
+ $template_name = $_POST['templates_name'];
130
 
131
  update_option('agca_selected_template', $template_name);
132
 
145
  'logincss'=>$login_css,
146
  'images'=>$images,
147
  'settings'=>$settings
148
+ );
149
  update_option('agca_templates', $templates);
150
 
151
  $_POST = array();
156
  if($_POST['template'] !="")
157
  $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
158
 
159
+ //print_r($_SESSION);
160
  echo "_agca_templates_session:OK";
161
  exit;
162
  }else if(isset($_POST['_agca_templates_session_remove_license'])){
204
  function my_sideload_image() {
205
  $remoteurl = $_POST['_agca_upload_image'];
206
  $file = media_sideload_image( $remoteurl, 0 ,"AG Custom Admin Template Image (do not delete)");
207
+ try{
208
+ $fileparts = explode("src='", $file);
209
+ $url=explode("'",$fileparts[1]);
210
+ echo $url[0];
211
+ }catch (\Exception $e){}
212
  exit;
213
  }
214
  add_action( 'admin_init', 'my_sideload_image' );
252
 
253
  function delete_template_images_all(){
254
  $templates = get_option('agca_templates');
255
+ if($templates != null && $templates != ""){
256
+ foreach($templates as $template){
257
+ if($template != null && $template['images'] != null && $template['images'] != ""){
258
+ //print_r($template['images']);
259
+ $imgs = explode(',',$template['images']);
260
+ foreach($imgs as $imageSrc){
261
+ $this->delete_attachment_by_src($imageSrc);
 
 
262
  }
263
+ //print_r($imgs);
264
  }
265
  }
266
+ }
267
  //print_r($templates);
268
  }
269
 
270
  function delete_template_images($template_name){
271
  $templates = get_option('agca_templates');
272
+ if($templates != null && $templates != ""){
273
+ $template = $templates[$template_name];
274
+ if($template != null && $template['images'] != null && $template['images'] != ""){
275
+ //print_r($template['images']); exit;
276
+ $imgs = explode(',',$template['images']);
277
+ foreach($imgs as $imageSrc){
278
+ $this->delete_attachment_by_src($imageSrc);
 
 
279
  }
280
+ //print_r($imgs);
281
  }
282
+ }
283
  //print_r($templates);
284
  }
285
 
286
  function delete_attachment_by_src ($image_src) {
287
+ global $wpdb;
288
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
289
+ $id = $wpdb->get_var($query);
290
+ wp_delete_attachment( $id, $true );
291
  }
292
 
293
  function get_installed_agca_templates(){
308
  return true;
309
  }
310
  }
 
 
 
 
 
 
 
 
 
 
 
 
311
  function change_title($admin_title, $title){
312
+ //return get_bloginfo('name').' - '.$title;
313
  if(get_option('agca_custom_title')!=""){
314
  $blog = get_bloginfo('name');
315
  $page = $title;
322
  }
323
  }
324
  function agca_get_includes() {
325
+ ?>
326
+ <script type="text/javascript">
327
+ <?php
328
+ //AGCA GLOBALS
329
+ echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';";
330
  ?>
331
+ </script>
332
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
333
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>" />
334
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
335
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
 
 
 
 
 
336
 
337
+ <?php
338
+ if($this->context == "login"){
339
+ ?>
340
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/login.min.css" />
341
  <?php
342
+ }else{
343
+ ?>
344
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/admin.min.css" />
345
+ <?php
346
+ }
347
+ ?>
348
+ <?php
349
+ echo $this->templateCustomizations;
350
+
351
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
352
+ ?>
353
+ <style type="text/css">
354
  <?php
355
+ echo get_option('agca_custom_css');
356
  ?>
357
+ </style>
358
+ <script type="text/javascript">
359
+ try{
360
+ eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
361
+ }catch(e){
362
+ alert('AG CUSTOM ADMIN : There is an error in your custom JS script. Please fix it: \n\n' + e + '\n\n (AG CUSTOM ADMIN -> Advanced -> Custom JavaScript)');
363
+ console.log(e);
364
  }
365
+ </script>
366
+ <?php
367
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
368
  }
369
 
370
  function agca_enqueue_scripts() {
371
  wp_enqueue_script('jquery');
372
  }
373
 
374
+ function WPSPluginIsLoginPage(){
375
+ if(!$this->isPluginActive('wps-hide-login/wps-hide-login.php')){
376
+ return '';
377
+ }
378
+ if ( $slug = get_option( 'whl_page' ) ) {
379
+ return $slug;
380
+ } else if ( ( is_multisite() && is_plugin_active_for_network( $this->basename() ) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
381
+ return $slug;
382
+ } else if ( $slug = 'login' ) {
383
+ return $slug;
384
+ }
385
+ $requestURI = $_SERVER['REQUEST_URI'];
386
+ return $this->startsWith('/'.$slug.'/', $requestURI);
387
+ }
388
+
389
  function reloadScript(){
390
  $isAdmin = false;
391
  if(defined('WP_ADMIN') && WP_ADMIN == 1){
392
  $isAdmin = true;
393
  }
394
+ if(in_array((isset($GLOBALS['pagenow'])?$GLOBALS['pagenow']:""), array('wp-login.php', 'wp-register.php')) || $isAdmin || $this->WPSPluginIsLoginPage()){
395
  add_action('init', array(&$this,'agca_enqueue_scripts'));
396
  }
397
  }
490
  register_setting( 'agca-options-group', 'agca_custom_css' );
491
 
492
 
493
+ if(!empty($_POST)){
494
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
495
+ $this->verifyPostRequest();
496
+ if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
497
+ if($_FILES["settings_import_file"]["error"] > 0){
498
+ }else{
499
+ $file = $_FILES['settings_import_file'];
500
+ if($this->startsWith($file['name'],'AGCA_Settings')){
501
+ if (file_exists($file['tmp_name'])) {
502
+ $fh = fopen($file['tmp_name'], 'r');
503
+ $theData = "";
504
+ if(filesize($file['tmp_name']) > 0){
505
+ $theData = fread($fh,filesize($file['tmp_name']));
 
 
 
 
 
506
  }
507
+ fclose($fh);
508
+ $this->importSettings($theData);
509
  }
510
+ }
 
 
511
  }
512
  }
513
+ }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
514
+ $this->verifyPostRequest();
515
+ $this->exportSettings();
516
+ }
517
+ }
518
 
519
+ if(isset($_GET['agca_action'])){
520
+ if($_GET['agca_action'] == "disablewarning"){
521
+ update_option('agca_disablewarning', true);
522
+ }
523
+ }
524
  }
525
 
526
  function agca_deactivate() {
528
  }
529
 
530
  function getOptions(){
531
+ return Array(
532
+ 'agca_role_allbutadmin',
533
+ 'agca_admin_bar_frontend',
534
+ 'agca_admin_bar_frontend_hide',
535
+ 'agca_login_register_remove',
536
+ 'agca_login_register_href',
537
+ 'agca_login_lostpassword_remove',
538
+ 'agca_admin_capability',
539
+ 'agca_screen_options_menu',
540
+ 'agca_help_menu',
541
+ 'agca_logout',
542
+ 'agca_remove_your_profile',
543
+ 'agca_logout_only',
544
+ 'agca_custom_title',
545
+ 'agca_howdy',
546
+ 'agca_header',
547
+ 'agca_header_show_logout',
548
+ 'agca_footer',
549
+ 'agca_privacy_options',
550
+ 'agca_header_logo',
551
+ 'agca_header_logo_custom',
552
+ 'agca_remove_site_link',
553
+ 'agca_wp_logo_custom',
554
+ 'agca_wp_logo_custom_link',
555
+ 'agca_site_heading',
556
+ 'agca_custom_site_heading',
557
+ 'agca_update_bar',
558
+ 'agca_footer_left',
559
+ 'agca_footer_left_hide',
560
+ 'agca_footer_right',
561
+ 'agca_footer_right_hide',
562
+ 'agca_login_banner',
563
+ 'agca_login_banner_text',
564
+ 'agca_login_photo_remove',
565
+ 'agca_login_photo_url',
566
+ 'agca_login_photo_href',
567
+ 'agca_login_round_box',
568
+ 'agca_login_round_box_size',
569
+ 'agca_dashboard_icon',
570
+ 'agca_dashboard_text',
571
+ 'agca_dashboard_text_paragraph',
572
+ 'agca_dashboard_widget_welcome',
573
+ 'agca_dashboard_widget_activity',
574
+ 'agca_dashboard_widget_il',
575
+ 'agca_dashboard_widget_plugins',
576
+ 'agca_dashboard_widget_qp',
577
+ 'agca_dashboard_widget_rn',
578
+ 'agca_dashboard_widget_rd',
579
+ 'agca_dashboard_widget_primary',
580
+ 'agca_dashboard_widget_secondary',
581
+ 'agca_admin_bar_comments',
582
+ 'agca_admin_bar_new_content',
583
+ 'agca_admin_bar_new_content_post',
584
+ 'agca_admin_bar_new_content_link',
585
+ 'agca_admin_bar_new_content_page',
586
+ 'agca_admin_bar_new_content_user',
587
+ 'agca_admin_bar_new_content_media',
588
+ 'agca_admin_bar_update_notifications',
589
+ 'agca_admin_bar_admin_themes',
590
+ 'agca_remove_top_bar_dropdowns',
591
+ 'agca_admin_menu_turnonoff',
592
+ 'agca_admin_menu_agca_button_only',
593
+ 'agca_admin_menu_separators',
594
+ 'agca_admin_menu_icons',
595
+ 'agca_admin_menu_arrow',
596
+ 'agca_admin_menu_submenu_round',
597
+ 'agca_admin_menu_submenu_round_size',
598
+ 'agca_admin_menu_brand',
599
+ 'agca_admin_menu_brand_link',
600
+ 'agca_admin_menu_autofold',
601
+ 'agca_admin_menu_collapse_button',
602
+ 'ag_edit_adminmenu_json',
603
+ 'ag_edit_adminmenu_json_new',
604
+ 'ag_add_adminmenu_json',
605
+ 'ag_colorizer_json',
606
+ 'agca_colorizer_turnonof',
607
+ 'agca_custom_js',
608
+ 'agca_custom_css',
609
+ 'agca_colorizer_turnonoff',
610
+ 'agca_disablewarning',
611
+ 'agca_selected_template',
612
+ 'agca_templates',
613
+ );
614
+ }
615
 
616
+ function getTextEditor($name){
617
+ $settings = array(
618
+ 'textarea_name' => $name,
619
+ 'media_buttons' => true,
620
+ 'tinymce' => array(
621
+ 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
622
+ 'bullist,blockquote,|,justifyleft,justifycenter' .
623
+ ',justifyright,justifyfull,|,link,unlink,|' .
624
+ ',spellchecker,wp_fullscreen,wp_adv'
625
+ )
626
+ );
627
+ wp_editor( get_option($name), $name, $settings );
628
+ }
629
+
630
+ function importSettings($settings){
631
+ $exploaded = explode("|^|^|", $settings);
632
+ // $str = "EEE: ";
633
+
634
+ $savedOptions = array();
635
+
636
+ foreach ($exploaded as $setting){
637
+
638
+ $key = current(explode(':', $setting));
639
+ $value = substr($setting, strlen($key)+1);
640
+ $cleanedValue = str_replace('|^|^|','',$value);
641
+ $savedOptions[$key] = $cleanedValue;
642
  }
643
 
644
+ // print_r($savedOptions);
 
 
645
 
646
+ $optionNames = $this->getOptions();
647
 
648
+ foreach ($optionNames as $optionName){
649
+ $optionValue = "";
650
+ $optionValue = $savedOptions[$optionName];
651
+
652
+ if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
653
+ $optionValue = str_replace("\\\"", "\"", $optionValue);
654
+ $optionValue = str_replace("\\\'", "\'", $optionValue);
655
+ }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
656
+ //fb($optionValue);
657
+ $optionValue = htmlspecialchars_decode($optionValue);
658
+ $optionValue = str_replace("\'", '"', $optionValue);
659
+ $optionValue = str_replace('\"', "'", $optionValue);
660
+ //fb($optionValue);
661
+ }else{
662
 
 
 
 
 
663
  }
664
+ update_option($optionName, $optionValue);
665
+ $str.="/".$optionName."/".$optionValue."\n";
666
+ }
667
 
668
+ //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
669
+ //agca_script_css
670
+ //
671
+ // fb($savedOptions);
672
+ if($savedOptions['agca_script_css'] != null){
673
+ $optionValue = "";
674
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
675
+ $optionValue = str_replace('\"', "'", $optionValue);
676
+ update_option('agca_custom_css', $optionValue);
677
+ }
678
+ if($savedOptions['agca_script_js'] != null){
679
+ $optionValue = "";
680
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
681
+ $optionValue = str_replace('\"', "'", $optionValue);
682
+ update_option('agca_custom_js', $optionValue);
683
+ }
684
 
685
+ //echo $str;
686
 
687
+ //save imported settings
688
+ $this->saveAfterImport = true;
689
+ }
690
 
691
+ function exportSettings(){
692
+ $str = "";
 
 
 
 
 
 
 
 
693
 
694
+ $include_menu_settings = false;
695
+ if(isset($_POST['export_settings_include_admin_menu'])){
696
+ if($_POST['export_settings_include_admin_menu'] == 'on'){
697
+ $include_menu_settings = true;
698
  }
699
+ }
700
 
701
+ foreach ($_POST as $key => $value) {
702
+ if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
703
+ if($this->startsWith($key,'ag_edit_adminmenu')){
704
+ if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
705
+ }else{
706
+ $str .=$key. ":".$value."|^|^|";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  }
708
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  }
710
 
711
+ $filename = 'AGCA_Settings_'.date("Y-M-d_H-i-s").'.agca';
712
+ header("Cache-Control: public");
713
+ header("Content-Description: File Transfer");
714
+ header("Content-Disposition: attachment; filename=$filename");
715
+ header("Content-Type: text/plain; ");
716
+ header("Content-Transfer-Encoding: binary");
717
+ echo $str;
718
+ die();
719
+ }
720
+
721
+ function startsWith($haystack, $needle)
722
+ {
723
+ $length = strlen($needle);
724
+ return (substr($haystack, 0, $length) === $needle);
725
+ }
726
 
727
 
728
 
810
 
811
  function print_page()
812
  {
813
+ if($this->isGuest() && get_option('agca_admin_bar_frontend_hide') or $this->isCusminActive()){
814
+ return false;
815
+ }
816
+ if(!$this->isGuest()){
817
+ ?><style type="text/css"><?php echo get_option('agca_custom_css'); ?></style><?php
818
+ }
819
 
820
+ if(get_option('agca_admin_bar_frontend_hide')==true){
821
+ add_filter( 'show_admin_bar', '__return_false' );
822
+ ?>
823
+ <style type="text/css">
824
+ #wpadminbar{
825
+ display: none;
826
+ }
827
+ </style>
828
+ <script type="text/javascript">
829
+ window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
830
+ </script>
831
+ <?php
832
+ }
833
  if(get_option('agca_admin_bar_frontend')!=true){
834
 
835
  $this->context = "page";
836
  $wpversion = $this->get_wp_version();
837
 
838
+ ?>
839
 
840
 
841
+ <script type="text/javascript">
842
+ var wpversion = "<?php echo $wpversion; ?>";
843
+ var agca_version = "<?php echo $this->agca_version; ?>";
844
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
845
+ var jQueryScriptOutputted = false;
846
+ var agca_context = "page";
847
+ var agca_orig_admin_menu = [];
848
+ function initJQuery() {
849
+ //if the jQuery object isn't available
850
+ if (typeof(jQuery) == 'undefined') {
851
+ if (! jQueryScriptOutputted) {
852
+ //only output the script once..
853
+ jQueryScriptOutputted = true;
854
+ //output the script (load it from google api)
855
+ document.write("<scr" + "ipt type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></scr" + "ipt>");
 
 
 
 
 
 
 
 
 
 
 
 
 
856
  }
857
+ setTimeout("initJQuery()", 50);
858
+ } else {
859
+ jQuery(function() {
860
+ try
861
+ {
862
+ <?php if(get_option('agca_header')!=true){ ?>
863
+ jQuery('#wpadminbar').show();
864
+ <?php } ?>
865
+
866
+ <?php $this->print_admin_bar_scripts(); ?>
867
+ }catch(ex){}
868
+ });
869
  }
870
+ }
871
+ initJQuery();
872
+ </script>
873
+ <script type="text/javascript">
874
+ <?php echo "var agca_global_plugin_url = '".trailingslashit(plugins_url(basename(dirname(__FILE__))))."';"; ?>
875
+ </script>
876
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
877
+ <script type="text/javascript">
878
  jQuery(document).ready(function(){
879
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
880
+ foreach($this->colorizer as $k => $v){
881
+ if(($k !="") and ($v !="")){
882
+ if(
883
+ $k == "color_header" ||
884
+ $k == "color_font_header"
885
+ ){
886
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
887
  }
888
 
889
  }
894
  }
895
  ?>
896
  });
897
+ </script>
898
+ <?php
899
  }
900
 
901
  }
902
 
903
+ function print_admin_bar_scripts(){
904
+ ?>
905
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
906
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
907
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
908
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
909
+
910
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
911
+ jQuery(".new_content_header_submenu").hide();
912
+ <?php } ?>
913
+
914
+ <?php } ?>
915
+
916
+ <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
917
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
918
+ <?php } ?>
919
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
920
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
921
+ <?php } ?>
922
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
923
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
924
+ <?php } ?>
925
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
926
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
927
+ <?php } ?>
928
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
929
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
930
+ <?php } ?>
931
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
932
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
933
+ <?php } ?>
934
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
935
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
936
+ <?php } ?>
937
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
938
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
939
+ <?php } ?>
940
+ <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
941
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
942
+ <?php } ?>
943
+
944
+
945
+
946
+ <?php if(get_option('agca_header_logo')==true){ ?>
947
+ jQuery("#wphead #header-logo").css("display","none");
948
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
949
+
950
+ <?php } ?>
951
+ <?php if(get_option('agca_header_logo_custom')!=""){ ?>
952
+
953
+ var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
954
+
955
+ advanced_url = img_url;
956
+ image = jQuery("<img />").attr("src",advanced_url);
957
+ jQuery(image).load(function() {
958
+ jQuery("#wpbody-content").prepend(image);
959
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
960
 
961
+ <?php } ?>
962
+ <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
963
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").html("<img style=\"height:28px;margin-top:-4px\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />");
964
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('background-image','none');
965
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon").css('width','auto');
966
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',"<?php echo get_bloginfo('wpurl'); ?>");
967
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
968
+ jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
969
+ jQuery("#wp-admin-bar-wp-logo").show();
970
+ <?php }?>
971
+ <?php if(get_option('agca_remove_site_link')==true){ ?>
972
+ jQuery("#wp-admin-bar-site-name").css("display","none");
973
+
974
+ <?php } ?>
975
+ <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
976
+ var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
977
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
978
+ if(href == "%SWITCH%"){
979
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
980
+ <?php if($this->context == "page"){
981
+ ?>href+="/wp-admin";<?php
982
+ }
983
+ ?>
984
+ }
985
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
986
+
987
+ <?php }?>
988
+ <?php if(get_option('agca_site_heading')==true){ ?>
989
+ jQuery("#wphead #site-heading").css("display","none");
990
+ <?php } ?>
991
+ <?php if(get_option('agca_custom_site_heading')!=""){ ?>
992
+ jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
993
+ jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
994
+
995
+ <?php } ?>
996
+ <?php if(get_option('agca_header')==true && $this->context =='admin'){
997
+ ?>
998
+ jQuery("#wpadminbar").css("display","none");
999
+ jQuery("body.admin-bar").css("padding-top","0");
1000
+ jQuery("#wphead").css("display","none");
1001
+ jQuery('html.wp-toolbar').css("padding-top","0");
1002
 
1003
+ <?php } ?>
1004
+ <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
1005
+ <?php
1006
+ $agca_logout_text = ((get_option('agca_logout')=="")?"Log Out":get_option('agca_logout'));
1007
+ ?>
1008
+ jQuery("#wpbody-content").prepend('<a href="../wp-login.php?action=logout" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
1009
+
1010
+
1011
+ <?php } ?>
1012
+ <?php if(get_option('agca_howdy')!=""){ ?>
1013
+ var alltext="";
1014
+ alltext="";
1015
+ jQuery('li#wp-admin-bar-my-account').css('cursor','default');
1016
+ alltext = jQuery('li#wp-admin-bar-my-account').html();
1017
+ if(alltext!=null){
1018
+ var parts = alltext.split(',');
1019
+ alltext = "<?php echo get_option('agca_howdy'); ?>" + ", " + parts[1];
1020
+ }
1021
+ jQuery("li#wp-admin-bar-my-account").html("<a href=\"#\" class=\"ab-item\">"+alltext+"</a>");
1022
 
1023
+ <?php } ?>
1024
+ <?php
1025
+ if(get_option('agca_custom_title')!=""){
1026
+ //add_filter('admin_title', '$this->change_title', 10, 2);
1027
 
1028
+ }
1029
+ ?>
1030
+ <?php if(get_option('agca_logout')!=""){ ?>
1031
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1032
+ <?php } ?>
1033
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
1034
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1035
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1036
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1037
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1038
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1039
+ <?php } ?>
1040
+ <?php if(get_option('agca_logout_only')==true){ ?>
1041
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
1042
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout" style="display:block;">'+ logout_content +'</li>');
1043
+ jQuery("#wp-admin-bar-logout a").css('padding','0 8px');
1044
+
1045
+
1046
+ <?php } ?>
1047
 
1048
+ <?php
1049
 
1050
 
1051
+ }
1052
 
1053
  function updateAllColors(){
1054
 
1055
+ ?>
1056
+ function updateAllColors(){
1057
+ <?php
1058
+ foreach($this->colorizer as $k => $v){
1059
+ if(($k !="") and ($v !="")){
1060
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1061
+ }
1062
+ }
1063
+ ?>
1064
+ jQuery('.color_picker').each(function(){
1065
+ updateColor(jQuery(this).attr('id'),jQuery(this).val())
1066
+ });
1067
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1068
+ jQuery('#adminmenu li.wp-menu-open').css('border','none');
1069
+ jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1070
+ }<?php
1071
 
1072
  }
1073
  function admin_capabilities(){
1083
  die;*/
1084
  ksort($capabs);
1085
  foreach($capabs as $k=>$v){
1086
+ $selected = "";
1087
+ if($this->startsWith($k, 'level_')) continue;
1088
+ if($selectedValue == $k){
1089
+ $selected = " selected=\"selected\" ";
1090
+ }
1091
+ //TODO:Find out why this does not work
1092
+ //$capabilitySelector .="<option val=\"$k\" $selected >".str_replace(' ', ' ', ucwords(str_replace('_', ' ', $k))) ."</option>\n";
1093
+ $capabilitySelector .="<option val=\"$k\" $selected >".$k."</option>\n";
1094
  }
1095
 
1096
  $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
1243
  }
1244
  }
1245
 
1246
+ function agca_error_check(){
1247
+ ?>
1248
+ <script type="text/javascript">
1249
+ function AGCAErrorPage(msg, url, line){
1250
+ var agca_error_details = "___________________________________________________<br/>";
1251
+ agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1252
+ agca_error_details += "___________________________________________________<br/>";
1253
+ window.agca_error_details_text = agca_error_details + '<br/>This JavaScript error could stop AG Custom Admin plugin to work properly. If everything still works, you can ignore this notification. <br/><br/>Possible solutions:<br/><br/>1) Make sure to have everything up to date: WordPress site, plugins and themes.<br/><br/>2) Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.<br/><br/>3) Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.<br/><br/>4) If it\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support. <br/><br/>5) Try activating default WordPress theme instead of your current theme.<br/><br/>6) Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.<br/><br/>7) Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AG Custom Admin plugin, or something unexpected happens, please report that on our <a href="http://wordpressadminpanel.com/agca-support/ag_custom_admin/error-ocurred-javascript-error-caught/" target="_blank">SUPPORT PAGE</a>';
1254
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1255
+ var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
1256
  AG Custom Admin caught an error on your site!&nbsp;<a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(show/hide more...)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">'+agca_error_details_text+'</div></div>';
1257
 
1258
+ var ph = document.getElementById('agca_error_placeholder');
1259
+ ph.innerHTML = errorDivHtml;
1260
+ document.getElementById('agca_news').style.visibility = "hidden";
1261
+ }
1262
+ window.onerror = function(msg, url, line) {
1263
+ window.onload = function() {
1264
+ AGCAErrorPage(msg, url, line);
1265
  }
1266
+ return true;
1267
+ };
1268
+ </script>
1269
+ <?php
1270
+ }
1271
+ function error_check(){
1272
+ ?>
1273
+ <script type="text/javascript">
1274
+ function AGCAErrorOtherPages(msg, url, line){
1275
+ var agca_error_details = "___________________________________________________\n";
1276
+ agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
 
 
 
 
1277
 
1278
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1279
 
1280
+ if(typeof window.console === "object"){
1281
+ console.log("___________________________________________________");
1282
+ console.log("AG Custom Admin caught a JavaScript on your site:");
1283
+ console.log(agca_error_details);
 
1284
  }
1285
+ }
1286
+ window.onerror = function(msg, url, line) {
1287
+ window.onload = function() {
1288
+ AGCAErrorOtherPages(msg, url, line);
1289
+ }
1290
+ return true;
1291
+ };
1292
+ </script>
1293
+ <?php
1294
+ }
1295
 
1296
  function menu_item_cleartext($name){
1297
  if(strpos($name,' <span') !== false){
1509
  update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1510
  update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1511
  }
1512
+ function isCusminActive(){
1513
+ return $this->isPluginActive('cusmin/cusmin.php');
1514
+ }
1515
+ function isPluginActive($plugin){
1516
+ if(!$this->active_plugins){
1517
+ $this->active_plugins = get_option( 'active_plugins');
1518
+ }
1519
+ return in_array( $plugin , $this->active_plugins);
1520
+ }
1521
  function print_admin_css()
1522
  {
1523
  $agcaTemplateSession = $this->agcaAdminSession();
1533
  var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1534
  var errors = false;
1535
  var isSettingsImport = false;
1536
+ var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
1537
  var agca_context = "admin";
1538
  var roundedSidberSize = 0;
1539
  var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
1544
  $this->agca_get_includes();
1545
  $this->admin_capabilities();
1546
  get_currentuserinfo() ;
1547
+ ?>
1548
+ <?php
1549
+ //in case that javaScript is disabled only admin can access admin menu
1550
+ if(!current_user_can($this->admin_capability())){
1551
+ ?>
1552
+ <style type="text/css">
1553
+ #adminmenu{display:none;}
1554
+ </style>
1555
+ <?php
1556
+ }
1557
+ ?>
1558
+ <script type="text/javascript">
1559
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
1560
+ <?php
1561
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1562
+ echo 'isSettingsImport = true;';
1563
+ }
1564
+ ?>
1565
+ </script>
1566
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1567
  <style type="text/css">
1568
+ .wp-has-current-submenu:after{border:none !important;}
1569
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1570
  </style>
1571
+ <?php }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1572
 
1573
  if($currentScreen->id == 'tools_page_ag-custom-admin/plugin'){
1574
  ?>
1583
  <?php
1584
  }
1585
  ?>
1586
+ <script type="text/javascript">
1587
+ /* <![CDATA[ */
1588
+ jQuery(document).ready(function() {
1589
+ try
1590
+ {
 
 
 
1591
 
1592
+ <?php /*CHECK OTHER PLUGINS*/
1593
+ if($this->isPluginActive('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')){
1594
+ ?>
1595
+ jQuery('ul#adminmenu').css('display','none');
1596
+ jQuery('#footer-ozh-oam').css('display','none');
1597
+ jQuery('#ag_main_menu li').each(function(){
1598
+ if(jQuery(this).text() == "Admin Menu"){
1599
+ jQuery(this).hide();
1600
+ }
1601
+ });
1602
+ <?php
1603
+ }
1604
+ ?>
1605
 
1606
 
1607
+ //get saved onfigurations
1608
 
1609
  <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1610
  var buttons = '<?php echo $buttons; ?>';
1615
  createEditMenuPageNew(agca_admin_menu);
1616
  //createEditMenuPageV32(checkboxes, textboxes);
1617
 
1618
+ <?php
1619
+ //if admin, and option to hide settings for admin is set
1620
+ if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability()) or $this->isCusminActive()){
1621
+ ?>
1622
+ <?php } else{ ?>
1623
+ <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1624
+ additionalStyles = ' style="margin-bottom:-4px" ';
1625
+ jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1626
+ <?php } ?>
1627
+ <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
 
1628
 
1629
+ var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1630
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1631
 
1632
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1633
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1634
 
1635
+ <?php }else{ ?>
1636
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
1637
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1638
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1639
+ <?php } ?>
1640
 
1641
  <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1642
+ jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1643
+ jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1644
+ <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1645
+ roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1646
 
1647
 
1648
  <?php } ?>
1649
  <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1650
+ jQuery("body").addClass("auto-fold");
1651
  <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1652
+ jQuery("body").removeClass("auto-fold");
1653
  <?php } ?>
1654
 
1655
  <?php $this->print_admin_bar_scripts(); ?>
1656
 
1657
  <?php if(get_option('agca_screen_options_menu')==true){ ?>
1658
+ jQuery("#screen-options-link-wrap").css("display","none");
1659
  <?php } ?>
1660
  <?php if(get_option('agca_help_menu')==true){ ?>
1661
+ jQuery("#contextual-help-link-wrap").css("display","none");
1662
+ jQuery("#contextual-help-link").css("display","none");
1663
  <?php } ?>
1664
  <?php if(get_option('agca_privacy_options')==true){ ?>
1665
+ jQuery("#privacy-on-link").css("display","none");
1666
  <?php } ?>
1667
 
1668
  <?php if(get_option('agca_update_bar')==true){ ?>
1669
+ <?php
1670
+ if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1671
+ function c2c_no_update_nag() {
1672
+ remove_action( 'admin_notices', 'update_nag', 3 );
1673
+ }
1674
+ endif;
1675
+ add_action( 'admin_init', 'c2c_no_update_nag' );
1676
+ ?>
1677
+ jQuery("#update-nag").css("display","none");
1678
+ jQuery(".update-nag").css("display","none");
1679
  <?php } ?>
1680
 
1681
  <?php if(get_option('agca_footer')==true){ ?>
1682
+ jQuery("#footer,#wpfooter").css("display","none");
1683
  <?php } ?>
1684
 
1685
  <?php if(get_option('agca_footer_left')!=""){ ?>
1686
+ jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1687
  <?php } ?>
1688
  <?php if(get_option('agca_footer_left_hide')==true){ ?>
1689
+ jQuery("#footer-left").css("display","none");
1690
  <?php } ?>
1691
  <?php if(get_option('agca_footer_right')!=""){ ?>
1692
+ jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1693
  <?php } ?>
1694
  <?php if(get_option('agca_footer_right_hide')==true){ ?>
1695
+ jQuery("#footer-upgrade").css("display","none");
1696
  <?php } ?>
1697
 
1698
  <?php if(get_option('agca_language_bar')==true){ ?>
1699
+ jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1700
  <?php } ?>
1701
  <?php if(get_option('agca_dashboard_icon')==true){ ?>
1702
+ var className = jQuery("#icon-index").attr("class");
1703
+ if(className=='icon32'){
1704
+ jQuery("#icon-index").attr("id","icon-index-removed");
1705
+ }
1706
  <?php } ?>
1707
  <?php if(get_option('agca_dashboard_text')!=""){ ?>
1708
+ jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1709
  <?php } ?>
1710
  <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1711
  require_once(ABSPATH . 'wp-includes/formatting.php');
1712
  ?>
1713
+ jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1714
 
1715
+ jQuery("#agca_custom_dashboard_content").html('<br /><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(wpautop(get_option('agca_dashboard_text_paragraph')))); ?>');
1716
  <?php } ?>
1717
 
1718
  <?php /*Remove Dashboard widgets*/ ?>
1768
 
1769
  <?php /*ADMIN MENU*/ ?>
1770
 
1771
+ <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1772
+ jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1773
+ <?php } ?>
1774
+ <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1775
+ jQuery(".wp-menu-image").each(function(){
1776
+ jQuery(this).css("display","none");
1777
+ });
1778
+ jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1779
+ <?php } ?>
1780
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1781
+ jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1782
+
1783
+ <?php } ?>
1784
  <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1785
 
1786
  <?php /*If Turned on*/ ?>
1787
 
1788
+ <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1789
+ jQuery('#adminmenu > li').each(function(){
1790
+ if(!jQuery(this).hasClass('agca_button_only')){
1791
+ jQuery(this).addClass('noclass');
1792
+ }
1793
+ });
1794
+ <?php /*Only admin see button*/
1795
+ if (current_user_can($this->admin_capability())){ ?>
1796
+ jQuery('#adminmenu').append('<?php echo $this->agca_create_admin_button('AG Custom Admin',array('value'=>'tools.php?page=ag-custom-admin/plugin.php','target'=>'_self')); ?>');
1797
+ <?php } ?>
1798
+ <?php } ?>
1799
 
1800
 
1801
+ <?php /*EDIT MENU ITEMS*/?>
1802
+ <?php if(get_option('ag_edit_adminmenu_json')!=""){
1803
 
1804
+ $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1805
 
1806
+ $checkboxes = json_decode($arr[0]);
1807
+ $textboxes = json_decode($arr[1]);
1808
 
1809
+ $this->migrate_menu_customizations($checkboxes, $textboxes);
1810
 
1811
+ } ?>
1812
 
1813
+ <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1814
+ $this->customized_menu();
1815
+ } ?>
1816
 
1817
 
1818
 
1819
 
1820
+ /*Add user buttons*/
1821
+ jQuery('#adminmenu').append(buttons);
1822
 
1823
  <?php /*END If Turned on*/ ?>
1824
  <?php } else{ ?>
1825
+ jQuery("#adminmenu").removeClass("noclass");
1826
  <?php } ?>
1827
 
1828
  reloadRemoveButtonEvents();
1829
 
1830
  <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1831
+ //remove collapse menu button
1832
+ jQuery('#collapse-menu').remove();
1833
  <?php } ?>
1834
 
1835
  <?php //COLORIZER ?>
1836
  updateAllColors();
1837
  <?php //COLORIZER END ?>
1838
+ <?php } //end of apply for any user except admin ?>
1839
+ /*Add user buttons*/
1840
+ jQuery('#ag_add_adminmenu').append(buttonsJq);
1841
 
1842
 
1843
+ }catch(err){
1844
+ errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
1845
+ console.log(errors);
1846
+ }finally{
1847
+ jQuery('html').css('visibility','visible');
1848
+ }
1849
+ <?php
1850
+ if($this->saveAfterImport == true){
1851
+ ?>savePluginSettings();<?php
1852
  }
1853
  ?>
1854
 
1855
+ });
1856
 
1857
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
1858
+ $this->updateAllColors();
1859
+ }else{
1860
+ ?>function updateAllColors(){}; <?php
1861
  } ?>
1862
 
1863
 
1864
+ /* ]]> */
1865
+ </script>
1866
  <style type="text/css">
1867
  .underline_text{
1868
  text-decoration:underline;
1875
  border:none;
1876
  }
1877
  </style>
1878
+ <?php
1879
  }
1880
 
1881
  function print_login_head(){
1882
+ if($this->isCusminActive()){
1883
+ return false;
1884
+ }
1885
+
1886
  $this->context = "login";
1887
  $this->error_check();
1888
  $wpversion = $this->get_wp_version();
1889
 
1890
  ?>
1891
  <script type="text/javascript">
1892
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
1893
+ var agca_version = "<?php echo $this->agca_version; ?>";
1894
+ <?php //var wpversion = "echo $wpversion; ?>
1895
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1896
+ var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
1897
+ var isSettingsImport = false;
1898
+ var agca_context = "login";
1899
  </script>
1900
  <?php
1901
  $this->prepareAGCALoginTemplates();
1902
  $this->agca_get_includes();
1903
 
1904
+ ?>
1905
 
1906
  <script type="text/javascript">
1907
 
1908
 
1909
+ /* <![CDATA[ */
1910
  jQuery(document).ready(function() {
1911
  try{
1912
+ <?php if(get_option('agca_login_round_box')==true){ ?>
1913
+ jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1914
+ jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1915
+ jQuery("#login h1 a").css("margin-bottom",'10px');
1916
+ jQuery("#login h1 a").css("padding-bottom",'0');
1917
+ jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
1918
  <?php } ?>
1919
  <?php if(get_option('agca_login_banner')==true){ ?>
1920
+ jQuery("#backtoblog").css("display","none");
1921
  <?php } ?>
1922
  <?php if(get_option('agca_login_banner_text')==true){ ?>
1923
+ jQuery("#backtoblog a").html('<?php echo "← " . addslashes(get_option('agca_login_banner_text')); ?>');
1924
  <?php } ?>
1925
  <?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
1926
+ advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
1927
+ var $url = "url(" + advanced_url + ")";
1928
+ jQuery("#login h1 a").css("background",$url+' no-repeat');
1929
+ jQuery("#login h1 a").hide();
1930
+ image = jQuery("<img />").attr("src",advanced_url);
1931
+ jQuery(image).load(function() {
1932
+ var originalWidth = 326;
1933
+ var widthDiff = this.width - originalWidth;
1934
+ jQuery("#login h1 a").height(this.height);
1935
+ jQuery("#login h1 a").width(this.width);
1936
+ jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
1937
+
1938
+ var loginWidth = jQuery('#login').width();
1939
+ var originalLoginWidth = 320;
1940
+ var photoWidth = this.width;
1941
+
1942
+ if(loginWidth > photoWidth){
1943
+ jQuery("#login h1 a").css('margin','auto');
1944
+ }else{
1945
+ jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
1946
+ }
1947
 
1948
+ jQuery("#login h1 a").show();
1949
+ });
1950
  <?php } ?>
1951
  <?php if(get_option('agca_login_photo_href')==true){ ?>
1952
+ var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
1953
+ $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1954
 
1955
+ jQuery("#login h1 a").attr("href",$href);
1956
  <?php } ?>
1957
  <?php if(get_option('agca_login_photo_remove')==true){ ?>
1958
+ jQuery("#login h1 a").css("display","none");
1959
  <?php } ?>
1960
 
1961
+ jQuery("#login h1 a").attr("title","");
1962
 
1963
  <?php if(get_option('agca_login_register_remove')==true){ ?>
1964
+ if(jQuery('p#nav').size() > 0){
1965
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
1966
+ }
1967
+ jQuery('p#nav a').each(function(){
1968
+ if(jQuery(this).attr('href').indexOf('register') != -1){
1969
+ jQuery(this).remove();
1970
+ }
1971
+ });
1972
 
1973
  <?php } ?>
1974
  <?php if(get_option('agca_login_register_href')!=""){ ?>
1975
+ jQuery('p#nav a').each(function(){
1976
+ if(jQuery(this).attr('href').indexOf('register') != -1){
1977
+ jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
1978
+ }
1979
+ });
1980
 
1981
  <?php } ?>
1982
 
1983
  <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
1984
+ if(jQuery('p#nav').size() > 0){
1985
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
1986
+ }
1987
+ jQuery('p#nav a').each(function(){
1988
+ if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
1989
+ jQuery(this).remove();
1990
+ }
1991
+ });
1992
 
1993
  <?php } ?>
1994
 
1995
 
1996
  <?php //COLORIZER ?>
1997
  <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
1998
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1999
+ jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
2000
 
2001
 
2002
  <?php
2004
 
2005
  } ?>
2006
  <?php //COLORIZER END ?>
2007
+ }catch(err){
2008
+ console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
2009
+ }finally{
2010
+ jQuery('html').show();
2011
+ jQuery('html').css('visibility','visible');
2012
+ }
2013
  });
2014
+ /* ]]> */
2015
 
2016
  </script>
2017
+ <?php
2018
  }
2019
 
2020
  function agca_admin_page() {
2023
  $this->agca_error_check();
2024
  ?>
2025
  <?php //includes ?>
2026
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
2027
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2028
 
2029
+ <link rel="stylesheet" type="text/css" href="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
2030
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2031
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
2032
+ <script type="text/javascript">
2033
+ var templates_ep = "<?php echo $this->templates_ep; ?>";
2034
+ var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
2035
+ </script>
2036
+ <script type="text/javascript" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
2037
  <?php //includes ?>
2038
  <div class="wrap">
2039
  <h1 id="agca-title">AG Custom Admin Settings <span style="font-size:15px;">(v<?php echo $this->agca_version; ?>)</span></h1>
2041
  <div class="fb-like" data-href="https://www.facebook.com/AG-Custom-Admin-892218404232342/timeline" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div>
2042
  </div>
2043
  <div id="agca_error_placeholder"></div>
2044
+ <div id="agca_news">&nbsp;</div><br />
2045
  <form method="post" id="agca_form" action="options.php">
2046
  <?php wp_nonce_field('agca_form','_agca_token'); ?>
2047
  <?php settings_fields( 'agca-options-group' ); ?>
2048
+ <div id="agca-your-feedback">
2049
+ <strong>
2050
+ <span style="color:#005B69">Your feedback:</span>
2051
+ </strong>
2052
+ <a class="feedback positive" target="_blank" title="POSITIVE FEEDBACK: I like this plugin!" href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-positive-feedback/">
2053
+ <span class="dashicons dashicons-thumbs-up"></span>
2054
+ </a>
2055
+ <a class="feedback negative" target="_blank" title="NEGATIVE FEEDBACK: I don't like this plugin." href="http://wordpressadminpanel.com/agca-support/feedback/ag-custom-admin-negative-feedback/">
2056
+ <span class="dashicons dashicons-thumbs-down"></span>
2057
+ </a>
2058
+ </div>
2059
+ <br />
2060
+ <ul id="ag_main_menu" style="<?php echo $this->isCusminActive()?'display:none':''; ?>">
2061
+ <li class="selected"><a href="#general-settings" title="General Settings" >General</a></li>
2062
+ <li class="normal"><a href="#admin-bar-settings" title="Settings for admin bar" >Admin Bar</a></li>
2063
+ <li class="normal"><a href="#admin-footer-settings" title="Settings for admin footer" >Admin Footer</a></li>
2064
+ <li class="normal"><a href="#dashboad-page-settings" title="Settings for Dashboard page">Dashboard Page</a></li>
2065
+ <li class="normal"><a href="#login-page-settings" title="Settings for Login page">Login Page</a></li>
2066
+ <li class="normal" ><a href="#admin-menu-settings" title="Settings for main admin menu">Admin Menu</a></li>
2067
+ <li class="normal"><a href="#ag-colorizer-setttings" title="AG colorizer settings">Colorizer</a></li>
2068
+ <li class="normal"><a href="#ag-advanced" title="My custom scripts">Advanced</a></li>
2069
+ <li class="normal" style=""><a style="color:#DB6014;font-weight:bolder;" href="#ag-templates" title="AG Custom Admin Themes">Admin Themes</a></li>
2070
+
2071
+ <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" target="_blank" style="margin-left:8px" title="Like this plugin? You can support its future development by giving a donation by your wish " href="http://wordpressadminpanel.com/agca-support/support-for-future-development/"><img alt="Donate" src="<?php echo trailingslashit(plugins_url(basename(dirname(__FILE__)))); ?>images/btn_donate_LG.gif" /></a>
2072
+ </li>
2073
+ <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2074
+ </ul>
2075
+ <div id="agca_advertising">
2076
+ <ul>
2077
+ <li style="min-height:105px;display: block"></li>
2078
+ </ul>
2079
+ </div>
2080
+ <div class="agca-clear"></div>
2081
+ <div id="section-cusmin" style="display:none;">All AG Custom Admin plugin's settings, except admin themes, are disabled. Please use <a href="options-general.php?page=cusmin">Cusmin</a> plugin to manage these settings.</div>
2082
  <div id="section_general" style="display:none" class="ag_section">
2083
  <h2 class="section_title">General Settings</h2>
2084
  <p tabindex="0" class="agca-clear agca-tip"><i><strong>Tip: </strong>Move mouse cursor over the option label to see more information about an option</i></p>
2152
  </tr>
2153
  </table>
2154
  </div>
2155
+ <div id="section_admin_bar" style="display:none" class="ag_section">
2156
+ <h2 class="section_title">Admin Bar Settings</h2>
2157
+ <table class="form-table" width="500px">
2158
 
2159
+ <?php
2160
+ $this->print_checkbox(array(
2161
+ 'attributes'=>array(
2162
+ 'class'=>'ag_table_major_options',
2163
+ ),
2164
+ 'hide'=>true,
2165
+ 'title'=>'Hides admin bar completely from the admin panel',
2166
+ 'name'=>'agca_header',
2167
+ 'label'=>'<strong>Admin bar</strong>',
2168
+ 'input-attributes'=>'data-dependant="#agca_header_show_logout_content"',
2169
+ 'input-class'=>'has-dependant',
2170
+ ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2171
 
2172
+ $this->print_checkbox(array(
2173
+ 'attributes'=>array(
2174
+ 'class'=>'ag_table_major_options',
2175
+ 'style'=> ((get_option('agca_header')!='true')?'display:none':''),
2176
+ 'id'=>'agca_header_show_logout_content',
2177
+ ),
2178
+ 'title'=>'Check this if you want to show Log Out button in top right corner of the admin page',
2179
+ 'name'=>'agca_header_show_logout',
2180
+ 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2181
+ 'label'=>'<strong>(but show Log Out button)</strong>'
2182
+ ));
2183
+
2184
+ $this->print_checkbox(array(
2185
+ 'title'=>'Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.',
2186
+ 'name'=>'agca_admin_bar_frontend',
2187
+ 'hide'=>true,
2188
+ 'label'=>'Site pages: Admin bar customizations'
2189
+ ));
2190
+
2191
+ $this->print_checkbox(array(
2192
+ 'title'=>'Hides admin bar completely for authenticated users on site pages.',
2193
+ 'name'=>'agca_admin_bar_frontend_hide',
2194
+ 'hide'=>true,
2195
+ 'label'=>'Site pages: Admin bar'
2196
+ ));
2197
+
2198
+ $this->print_options_h3('Left Side');
2199
+
2200
+ $this->print_input(array(
2201
+ 'title'=>'Change default WordPress logo with custom image.',
2202
+ 'name'=>'agca_wp_logo_custom',
2203
+ 'label'=>'Admin bar logo',
2204
+ 'hint' =>'Image URL (maximum height is 28px)'
2205
+ ));
2206
+
2207
+ $this->print_input(array(
2208
+ 'title'=>'Custom link on admin bar logo.</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL</br><strong>%SWITCH%</strong> - to switch betweent admin and site area',
2209
+ 'name'=>'agca_wp_logo_custom_link',
2210
+ 'label'=>'Admin bar logo link',
2211
+ 'hint' =>'Link'
2212
+ ));
2213
+
2214
+ $this->print_input(array(
2215
+ '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>',
2216
+ 'name'=>'agca_custom_title',
2217
+ 'label'=>'Page title template',
2218
+ 'hint' =>'Please use <strong>%BLOG%</strong> and <strong>%PAGE%</strong> in your title template.'
2219
+ ));
2220
+
2221
+ $this->print_input(array(
2222
+ 'title'=>'Add custom image on the top of the admin content.',
2223
+ 'name'=>'agca_header_logo_custom',
2224
+ 'label'=>'Header image',
2225
+ 'hint' =>'Image URL'
2226
+ ));
2227
+
2228
+
2229
+ $this->print_checkbox(array(
2230
+ 'hide'=>true,
2231
+ 'title'=>'Hides small Wordpress logo from the admin bar',
2232
+ 'name'=>'agca_header_logo',
2233
+ 'label'=>'WordPress logo'
2234
+ ));
2235
+
2236
+ $this->print_checkbox(array(
2237
+ 'hide'=>true,
2238
+ 'title'=>'Hides WordPress context menu on WordPress logo icon from admin bar',
2239
+ 'name'=>'agca_remove_top_bar_dropdowns',
2240
+ 'label'=>'WordPress logo context menu'
2241
+ ));
2242
+
2243
+ $this->print_checkbox(array(
2244
+ 'hide'=>true,
2245
+ 'title'=>'Hides site name link from the admin bar',
2246
+ 'name'=>'agca_remove_site_link',
2247
+ 'label'=>'Site name'
2248
+ ));
2249
+
2250
+ $this->print_checkbox(array(
2251
+ 'hide'=>true,
2252
+ 'title'=>'Hides update notifications from admin bar',
2253
+ 'name'=>'agca_admin_bar_update_notifications',
2254
+ 'label'=>'Update notifications'
2255
+ ));
2256
+
2257
+ $this->print_checkbox(array(
2258
+ 'hide'=>true,
2259
+ 'title'=>'Hides comments block from admin bar',
2260
+ 'name'=>'agca_admin_bar_comments',
2261
+ 'label'=>'"Comments" block'
2262
+ ));
2263
+
2264
+ $this->print_checkbox(array(
2265
+ 'hide'=>true,
2266
+ 'attributes'=>array(
2267
+ 'style'=>'margin-top:20px;'
2268
+ ),
2269
+ 'title'=>'Hides "+ New" block and its context menu from admin bar',
2270
+ 'name'=>'agca_admin_bar_new_content',
2271
+ 'label'=>'"+ New" block',
2272
+ 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2273
+ 'input-class'=>'has-dependant dependant-opposite'
2274
+ ));
2275
+
2276
+ $this->print_checkbox(array(
2277
+ 'hide'=>true,
2278
+ 'attributes'=>array(
2279
+ 'class'=>'new_content_header_submenu'
2280
+ ),
2281
+ 'title'=>'Hides "Post" sub-menu from "+ New" block on admin bar',
2282
+ 'name'=>'agca_admin_bar_new_content_post',
2283
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Post sub-menu'
2284
+ ));
2285
+
2286
+ $this->print_checkbox(array(
2287
+ 'hide'=>true,
2288
+ 'attributes'=>array(
2289
+ 'class'=>'new_content_header_submenu'
2290
+ ),
2291
+ 'title'=>'Hides "Link" sub-menu from "+ New" block on admin bar',
2292
+ 'name'=>'agca_admin_bar_new_content_link',
2293
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Link sub-menu'
2294
+ ));
2295
+
2296
+ $this->print_checkbox(array(
2297
+ 'hide'=>true,
2298
+ 'attributes'=>array(
2299
+ 'class'=>'new_content_header_submenu'
2300
+ ),
2301
+ 'title'=>'Hides "Page" sub-menu from "+ New" block on admin bar',
2302
+ 'name'=>'agca_admin_bar_new_content_page',
2303
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Page sub-menu'
2304
+ ));
2305
+
2306
+ $this->print_checkbox(array(
2307
+ 'hide'=>true,
2308
+ 'attributes'=>array(
2309
+ 'class'=>'new_content_header_submenu'
2310
+ ),
2311
+ 'title'=>'Hides "User" sub-menu from "+ New" block on admin bar',
2312
+ 'name'=>'agca_admin_bar_new_content_user',
2313
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> User sub-menu'
2314
+ ));
2315
+
2316
+ $this->print_checkbox(array(
2317
+ 'hide'=>true,
2318
+ 'attributes'=>array(
2319
+ 'class'=>'new_content_header_submenu'
2320
+ ),
2321
+ 'title'=>'Hides "Media" sub-menu from "+ New" block on admin bar',
2322
+ 'name'=>'agca_admin_bar_new_content_media',
2323
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ New" -> Media sub-menu'
2324
+ ));
2325
+
2326
+ $this->print_checkbox(array(
2327
+ 'hide'=>true,
2328
+ 'title'=>'Hides "Admin themes" from admin bar',
2329
+ 'name'=>'agca_admin_bar_admin_themes',
2330
+ 'label'=>'"Admin themes"'
2331
+ ));
2332
+
2333
+ $this->print_textarea(array(
2334
+ 'title'=>'Adds custom text in admin top bar.',
2335
+ 'name'=>'agca_custom_site_heading',
2336
+ 'label'=>'Custom blog heading',
2337
+ 'hint'=>"<strong>Tip: </strong>You can use HTML tags like &lt;h1&gt; or &lt;a&gt;"
2338
+ ));
2339
 
2340
+
2341
+ $this->print_checkbox(array(
2342
+ 'hide'=>true,
2343
+ 'title'=>'Hides yellow bar with information about new WordPress release',
2344
+ 'name'=>'agca_update_bar',
2345
+ 'label'=>'Update WordPress notification'
2346
+ ));
2347
+
2348
+ $this->print_options_h3('Right Side');
2349
+
2350
+ $this->print_input(array(
2351
+ 'name'=>'agca_howdy',
2352
+ 'label'=>'Change Howdy text',
2353
+ ));
2354
+
2355
+ $this->print_input(array(
2356
+ 'title'=>'Put \'Exit\', for example',
2357
+ 'name'=>'agca_logout',
2358
+ 'label'=>'Change Log out text',
2359
+ ));
2360
+
2361
+ $this->print_checkbox(array(
2362
+ 'hide'=>true,
2363
+ 'name'=>'agca_remove_your_profile',
2364
+ 'label'=>'"Edit My Profile" option from dropdown menu'
2365
+ ));
2366
+
2367
+ $this->print_checkbox(array(
2368
+ 'title'=>'If selected, hides all elements in top right corner, except Log Out button',
2369
+ 'name'=>'agca_logout_only',
2370
+ 'label'=>'Log out only'
2371
+ ));
2372
+
2373
+ ?>
2374
+
2375
+ </table>
2376
+ </div>
2377
+
2378
+ <div id="section_admin_footer" style="display:none" class="ag_section">
2379
+ <h2 class="section_title">Admin Footer Settings</h2>
2380
+ <table class="form-table" width="500px">
2381
+ <?php
2382
+ $this->print_checkbox(array(
2383
+ 'hide'=>true,
2384
+ 'attributes'=>array(
2385
+ 'class'=>'ag_table_major_options'
2386
+ ),
2387
+ 'title'=>'Hides footer with all elements',
2388
+ 'name'=>'agca_footer',
2389
+ 'label'=>'<strong>Footer</strong>'
2390
+ ));
2391
+
2392
+ $this->print_options_h3('Footer Options');
2393
+
2394
+ $this->print_checkbox(array(
2395
+ 'hide'=>true,
2396
+ 'title'=>'Hides default text in footer',
2397
+ 'name'=>'agca_footer_left_hide',
2398
+ 'label'=>'Footer text'
2399
+ ));
2400
+
2401
+ $this->print_textarea(array(
2402
+ 'title'=>'Replaces text \'Thank you for creating with WordPress\' with custom text',
2403
+ 'name'=>'agca_footer_left',
2404
+ 'label'=>'Change footer text'
2405
+ ));
2406
+
2407
+ $this->print_checkbox(array(
2408
+ 'hide'=>true,
2409
+ 'title'=>'Hides text \'Get Version ...\' on right',
2410
+ 'name'=>'agca_footer_right_hide',
2411
+ 'label'=>'Version text'
2412
+ ));
2413
+
2414
+ $this->print_textarea(array(
2415
+ 'title'=>'Replaces text \'Get Version ...\' with custom text',
2416
+ 'name'=>'agca_footer_right',
2417
+ 'label'=>'Change version text'
2418
+ ));
2419
+
2420
+ ?>
2421
+
2422
+ </table>
2423
+ </div>
2424
+ <div id="section_dashboard_page" style="display:none" class="ag_section">
2425
+ <h2 class="section_title">Dashboard Page Settings</h2>
2426
+ <table class="form-table" width="500px">
2427
+ <?php
2428
+
2429
+ $this->print_options_h3('Dashboard Page Options');
2430
+
2431
+ $this->print_input(array(
2432
+ 'title'=>"Main heading ('Dashboard') on Dashboard page",
2433
+ 'name'=>'agca_dashboard_text',
2434
+ 'label'=>'Change Dashboard heading text',
2435
+ ));
2436
+
2437
+ ?>
2438
+ <tr valign="center">
2439
+ <th scope="row">
2440
+ <label title="Adds custom text (or HTML) between heading and widgets area on Dashboard page" for="agca_dashboard_text_paragraph">Add custom Dashboard content<br> <em>(text or HTML content)</em></label>
2441
+ </th>
2442
+ <td class="agca_editor">
2443
  <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2444
+ </td>
2445
+ </tr>
2446
+ <?php
2447
+
2448
+ $this->print_options_h3('Dashboard Widgets Options');
2449
+
2450
+ ?>
2451
+ <tr>
2452
+ <td colspan="2">
2453
+ <p tabindex="0" class="agca-tip"><i><strong>Note:</strong> These settings override settings in Screen options on Dashboard page.</i></p>
2454
+ </td>
2455
+ </tr>
2456
+ <?php
2457
+ $this->print_checkbox(array(
2458
+ 'hide'=>true,
2459
+ 'title'=>'Hides Welcome WordPress widget',
2460
+ 'name'=>'agca_dashboard_widget_welcome',
2461
+ 'label'=>'"Welcome" widget'
2462
+ ));
2463
 
2464
+ $this->print_checkbox(array(
2465
+ 'hide'=>true,
2466
+ 'title'=>'Hides Activity dashboard widget',
2467
+ 'name'=>'agca_dashboard_widget_activity',
2468
+ 'label'=>'"Activity" widget'
2469
+ ));
2470
+
2471
+ $this->print_checkbox(array(
2472
+ 'hide'=>true,
2473
+ 'title'=>'Hides Quick Draft dashboard widget',
2474
+ 'name'=>'agca_dashboard_widget_qp',
2475
+ 'label'=>'"Quick Draft" widget'
2476
+ ));
2477
+
2478
+ $this->print_checkbox(array(
2479
+ 'hide'=>true,
2480
+ 'title'=>'Hides At a Glance dashboard widget',
2481
+ 'name'=>'agca_dashboard_widget_rn',
2482
+ 'label'=>'"At a Glance" widget'
2483
+ ));
2484
+
2485
+ $this->print_checkbox(array(
2486
+ 'hide'=>true,
2487
+ 'name'=>'agca_dashboard_widget_primary',
2488
+ 'title'=>"This is 'WordPress News' or 'WordPress Development Blog' widget in older WordPress versions",
2489
+ 'label'=>'"WordPress News" widget'
2490
+ ));
2491
+
2492
+ $this->print_checkbox(array(
2493
+ 'hide'=>true,
2494
+ 'name'=>'agca_dashboard_widget_secondary',
2495
+ 'title'=>"This is 'Other WordPress News' widget by default",
2496
+ 'label'=>'Secondary widget area'
2497
+ ));
2498
+
2499
+ ?>
2500
+ </table>
2501
+ </div>
2502
+ <div id="section_login_page" style="display:none" class="ag_section">
2503
+ <h2 class="section_title">Login Page Settings</h2>
2504
+ <table class="form-table" width="500px">
2505
+ <?php
2506
+
2507
+ $this->print_options_h3('Login Page Options');
2508
+
2509
+ $this->print_checkbox(array(
2510
+ 'hide'=>true,
2511
+ 'name'=>'agca_login_banner',
2512
+ 'title'=>"Hide back to blog block",
2513
+ 'label'=>'Back to blog text'
2514
+ ));
2515
+
2516
+ $this->print_input(array(
2517
+ 'name'=>'agca_login_banner_text',
2518
+ 'title'=>"Changes '<- Back to ...' text in top bar on Login page",
2519
+ 'label'=>'Change back to blog text'
2520
+ ));
2521
+
2522
+ $this->print_input(array(
2523
+ 'title'=>'If this field is not empty, image from provided url will be visible on Login page',
2524
+ 'name'=>'agca_login_photo_url',
2525
+ 'label'=>'Change Login header image',
2526
+ 'hint'=>'Image URL'
2527
+ ));
2528
+
2529
+ $this->print_input(array(
2530
+ 'title'=>'Put here custom link to a web location, that will be triggered on image click',
2531
+ 'name'=>'agca_login_photo_href',
2532
+ 'label'=>'Change link on login image',
2533
+ 'hint'=>'For blog URL use %BLOG%'
2534
+ ));
2535
 
2536
+ $this->print_checkbox(array(
2537
+ 'hide'=>true,
2538
+ 'title'=>'Hides login image completely',
2539
+ 'name'=>'agca_login_photo_remove',
2540
+ 'label'=>'Login header image',
2541
+ ));
2542
+
2543
+ $this->print_checkbox(array(
2544
+ 'title'=>'Rounds box on login page',
2545
+ 'name'=>'agca_login_round_box',
2546
+ 'label'=>'Round box corners',
2547
+ 'input-class'=>'has-dependant',
2548
+ 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2549
+ ));
2550
+
2551
+ $this->print_input(array(
2552
+ 'attributes'=>array(
2553
+ 'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2554
+ 'id'=>'agca_login_round_box_size_block'
2555
+ ),
2556
+ 'title'=>'Size of rounded box curve',
2557
+ 'name'=>'agca_login_round_box_size',
2558
+ 'label'=>'Round box corners - size',
2559
+ 'input-class'=>'validateNumber',
2560
+ 'hint'=>'(Size in px)'
2561
+ ));
2562
+
2563
+ $this->print_checkbox(array(
2564
+ 'hide'=>true,
2565
+ 'title'=>'Hides register link on login page',
2566
+ 'name'=>'agca_login_register_remove',
2567
+ 'label'=>'Register link',
2568
+ 'input-class'=>'has-dependant dependant-opposite',
2569
+ 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2570
+ ));
2571
+
2572
+ $this->print_input(array(
2573
+ 'attributes'=>array(
2574
+ 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2575
+ 'id'=>'agca_login_register_href_block'
2576
+ ),
2577
+ 'title'=>'Change register link on login page to point to your custom registration page.',
2578
+ 'name'=>'agca_login_register_href',
2579
+ 'label'=>'Change register link',
2580
+ 'hint'=>'Link to new registration page'
2581
+ ));
2582
+
2583
+ $this->print_checkbox(array(
2584
+ 'hide'=>true,
2585
+ 'title'=>'Hides lost password link on login page',
2586
+ 'name'=>'agca_login_lostpassword_remove',
2587
+ 'label'=>'Lost password link',
2588
+ ));
2589
+ ?>
2590
+ </table>
2591
+ </div>
2592
+ <?php
2593
+ /*ADMIN MENU*/
2594
+ ?>
2595
+ <div id="section_admin_menu" style="display:none" class="ag_section">
2596
+ <h2 class="section_title">Admin Menu Settings</h2>
2597
+ <table class="form-table" width="500px">
2598
+ <tr valign="center" class="ag_table_major_options">
2599
+ <td><label for="agca_admin_menu_turnonoff"><strong>Apply admin menu customizations</strong></label></td>
2600
+ <td>
2601
+ <strong>
2602
+
2603
+ <input class="agca-radio" type="radio" id="agca_admin_menu_turnonoff_on" name="agca_admin_menu_turnonoff" title="Apply admin menu customizations" value="on" <?php if(get_option('agca_admin_menu_turnonoff') == 'on') echo 'checked="checked" '; ?> />
2604
+ <span class="agca-radio-text on">YES</span>
2605
+ &nbsp;&nbsp;&nbsp;&nbsp;
2606
+ <input class="agca-radio" type="radio" name="agca_admin_menu_turnonoff" title="Do not apply admin menu customizations" value="off" <?php if(get_option('agca_admin_menu_turnonoff') != 'on') echo 'checked="checked"'; ?> />
2607
+ <span class="agca-radio-text off">NO</span>
2608
+ </strong>
2609
+ </td>
2610
+ </tr>
2611
+ <tr valign="center" class="ag_table_major_options">
2612
+ <td><label for="agca_admin_menu_agca_button_only"><strong>Admin menu</strong></label></td>
2613
+ <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_agca_button_only" title="Hides admin menu completly (administrator can see 'AG custom admin' button)" value="true" <?php if (get_option('agca_admin_menu_agca_button_only')==true) echo 'checked="checked" '; ?> /></td>
2614
+ </tr>
2615
+ <?php
2616
+ $this->print_options_h3('Edit / Remove Menu Items');
2617
+ ?>
2618
+ <tr>
2619
+ <td colspan="2">
2620
+ <input type="button" class="agca_button" id="ag_edit_adminmenu_reset_button" title="Reset menu settings to default values" name="ag_edit_adminmenu_reset_button" value="Reset to default settings" /><br />
2621
+ <p tabindex="0"><em>(click on the top menu item to show its sub-menus)</em></p>
2622
+ <table id="ag_edit_adminmenu">
2623
+ <tr style="background-color:#999;">
2624
+ <td width="300px"><div style="float:left;color:#fff;"><h3>Item</h3></div><div style="float:right;color:#fff;"><h3>Visibility</h3></div></td><td width="300px" style="color:#fff;" ><h3>Change Text</h3>
2625
+ </td>
2626
+ </tr>
2627
+ </table>
2628
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json" name="ag_edit_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_edit_adminmenu_json')); ?>" />
2629
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2630
  </td>
2631
+ <td></td>
2632
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2633
  <?php
2634
+ $this->print_options_h3('Add New Menu Items');
2635
  ?>
2636
+ <tr>
2637
+ <td colspan="2">
2638
+ <table id="ag_add_adminmenu">
2639
+ <tr>
2640
+ <td colspan="2">
2641
+ name:<input type="text" size="47" title="New button visible name" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
2642
+ url:<input type="text" size="47" title="New button link" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
2643
+ open in:<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:95px">
2644
+ <option value="_self" selected>same tab</option>
2645
+ <option value="_blank" >new tab</option>
2646
+ </select>
2647
+ <input type="button" id="ag_add_adminmenu_button" class="agca_button" title="Add new item button" name="ag_add_adminmenu_button" value="Add new item" />
2648
+ </td><td></td>
2649
+ </tr>
2650
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2651
  <input type="hidden" size="47" id="ag_add_adminmenu_json" name="ag_add_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_add_adminmenu_json')); ?>" />
2652
+ </td>
2653
+ <td>
2654
+ </td>
2655
+ </tr>
2656
+ <?php
2657
+ $this->print_options_h3('Admin Menu Settings');
2658
+ ?>
2659
+ <tr valign="center">
2660
+ <th scope="row">
2661
+ <label title="Choose how admin menu should behave on mobile devices / small screens" for="agca_admin_menu_autofold">Admin menu auto folding</label>
2662
+ </th>
2663
+ <td>
2664
+ <select title="Choose how admin menu should behave on mobile devices / small screens" class="agca-selectbox" name="agca_admin_menu_autofold" >
2665
+ <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> >Default</option>
2666
+ <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> >Force admin menu auto-folding</option>
2667
+ <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> >Disable admin menu auto-folding</option>
2668
+ </select>
2669
+ </td>
2670
+ </tr>
2671
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2672
 
2673
+ $this->print_checkbox(array(
2674
+ 'hide'=>true,
2675
+ 'title'=>'Removes empty space between some top menu items',
2676
+ 'name'=>'agca_admin_menu_separators',
2677
+ 'label'=>'Menu items separators',
2678
+ ));
2679
+
2680
+ $this->print_checkbox(array(
2681
+ 'hide'=>true,
2682
+ 'title'=>'Removes icons from dmin menu buttons',
2683
+ 'name'=>'agca_admin_menu_icons',
2684
+ 'label'=>'Menu icons',
2685
+ ));
2686
+
2687
+ $this->print_checkbox(array(
2688
+ 'hide'=>true,
2689
+ 'title'=>'Removes small arrow that appears on the top button hover',
2690
+ 'name'=>'agca_admin_menu_arrow',
2691
+ 'label'=>'Sub-menu arrow',
2692
+ ));
2693
+
2694
+ $this->print_checkbox(array(
2695
+ 'hide'=>true,
2696
+ 'title'=>'Removes collapse button at the end of admin menu',
2697
+ 'name'=>'agca_admin_menu_collapse_button',
2698
+ 'label'=>'"Collapse menu" button',
2699
+ ));
2700
+
2701
+ $this->print_checkbox(array(
2702
+ 'title'=>'Rounds submenu pop-up box',
2703
+ 'name'=>'agca_admin_menu_submenu_round',
2704
+ 'label'=>'Round sub-menu pop-up box',
2705
+ 'input-attributes'=>'data-dependant="#agca_admin_menu_submenu_round_size"',
2706
+ 'input-class'=>'has-dependant',
2707
+ ));
2708
+
2709
+ $this->print_input(array(
2710
+ 'attributes'=>array(
2711
+ 'style'=> ((get_option('agca_admin_menu_submenu_round')!='true')?'display:none':''),
2712
+ 'id'=>'agca_admin_menu_submenu_round_size'
2713
+ ),
2714
+ 'title'=>'Size of rounded box curve',
2715
+ 'name'=>'agca_admin_menu_submenu_round_size',
2716
+ 'label'=>'Round sub-menu pop-up box - size',
2717
+ 'input-class'=>'validateNumber',
2718
+ 'hint'=>'(Size in px)'
2719
+ ));
2720
+
2721
+ $this->print_input(array(
2722
+ 'title'=>'Adds custom logo above the admin menu',
2723
+ 'name'=>'agca_admin_menu_brand',
2724
+ 'label'=>'Admin menu branding with logo',
2725
+ 'hint'=>'Image URL'
2726
+ ));
2727
+
2728
+ $this->print_input(array(
2729
+ 'title'=>'Change branding logo link</br></br>Use:</br><strong>%BLOG%</strong> - for blog URL',
2730
+ 'name'=>'agca_admin_menu_brand_link',
2731
+ 'label'=>'Branding logo link',
2732
+ 'hint'=>'Branding image URL'
2733
+ ));
2734
+ ?>
2735
+ </table>
2736
+ </div>
2737
+ <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2738
+ <h2 class="section_title">Colorizer Page</h2>
2739
+ <table class="form-table" width="500px">
2740
+ <tr valign="center" class="ag_table_major_options">
2741
+ <td><label for="agca_colorizer_turnonoff"><strong>Apply Colorizer settings</strong></label></td>
2742
+ <td><strong><input class="agca-radio" type="radio" name="agca_colorizer_turnonoff" title="Apply Colorizer customizations" value="on" <?php if(get_option('agca_colorizer_turnonoff') == 'on') echo 'checked="checked" '; ?> /><span class="agca-radio-text on">YES</span>&nbsp;&nbsp;&nbsp;&nbsp;<input class="agca-radio" type="radio" name="agca_colorizer_turnonoff" title="Do not apply Colorizer customizations" value="off" <?php if(get_option('agca_colorizer_turnonoff') != 'on') echo 'checked="checked"'; ?> /><span class="agca-radio-text off">NO</span></strong></td>
2743
+ </tr>
2744
+ <?php
2745
+ $this->print_options_h3('Global Color Options');
2746
+
2747
+ $this->print_color('color_background','Background:','Change admin page background color');
2748
+ $this->print_color('login_color_background','Login page background:','Change login page background color');
2749
+ $this->print_color('color_header','Admin bar:','Change admin bar (on top) color in admin panel');
2750
+
2751
+ $this->print_options_h3('Admin Menu Color Options');
2752
+
2753
+ $this->print_color('color_admin_menu_top_button_background','Button background:','Change button background color');
2754
+ $this->print_color('color_admin_menu_font','Button text:','Change button text color');
2755
+ $this->print_color('color_admin_menu_top_button_current_background','Selected button background:','Change button background color for current button');
2756
+ $this->print_color('color_admin_menu_top_button_hover_background','Hover button background:','Change button background color on mouseover');
2757
+ $this->print_color('color_admin_menu_submenu_background','Sub-menu button background:','Change submenu item background color');
2758
+ $this->print_color('color_admin_menu_submenu_background_hover','Sub-menu hover button background:','Change submenu item background color on mouseover');
2759
+ $this->print_color('color_admin_submenu_font','Sub-menu text:','Sub-menu text color');
2760
+ $this->print_color('color_admin_menu_behind_background','Wrapper background:','Change background color of element behind admin menu');
2761
+
2762
+ $this->print_options_h3('Font Color Options');
2763
+
2764
+ $this->print_color('color_font_content','Content text:','Change color in content text');
2765
+ $this->print_color('color_font_header','Admin bar text:','Change color of admin bar text');
2766
+ $this->print_color('color_font_footer','Footer text:','Change color in fotter text');
2767
+
2768
+ $this->print_options_h3('Widgets Color Options');
2769
+
2770
+ $this->print_color('color_widget_bar','Title bar background:','Change color in header text');
2771
+ $this->print_color('color_widget_background','Background:','Change widget background color');
2772
+
2773
+ ?>
2774
+ </table>
2775
+ <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
2776
+ <div id="picker"></div>
2777
+ </div>
2778
+ <div id="section_templates" style="display:none" class="ag_section">
2779
+ <h2 class="section_title"><span style="float:left">Admin Themes</span></h2>
2780
+ <table class="form-table" width="500px">
2781
+ <tr valign="center">
2782
+ <td>
2783
+ <div id="agca_templates"></div>
2784
+ </td>
2785
+ </tr>
2786
+ <tr>
2787
+ <td>
2788
+ <div id="advanced_template_options" style="display:none">
2789
+ <div class="agca-feedback-and-support">
2790
+ <ul>
2791
+ <li><a href="http://wordpressadminpanel.com/agca-support/contact/?type=theme" title="If you have any ideas for theme improvements, or you have new themes requests, please feel free to send us a message" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;Submit your admin themes ideas</a></li>
2792
+ <li><a style="background: #f08080;color:#fff;" href="javascript:agca_removeAllTemplates();" title="WARNING: All installed themes will be removed. To activate them again, you would need to install theme and activate using valid license keys. Free themes can be installed again."><span style="color:#fff" class="dashicons dashicons-trash"></span>&nbsp;&nbsp;Uninstall all installed themes</a></li>
2793
+ </ul>
2794
  </div>
2795
+ </div>
2796
+ </td>
2797
+ </tr>
2798
+ </table>
2799
+ </div>
2800
+ <div id="section_advanced" style="display:none" class="ag_section">
2801
+ <h2 class="section_title">Advanced</h2>
2802
+ <table class="form-table" width="500px">
2803
+ <tr valign="center">
2804
+ <td colspan="2">
2805
+ <p class="agca-tip"><i><strong>Note: </strong>These options will override existing customizations</i></p>
2806
+ </td><td></td>
2807
+ </tr>
2808
+ <tr valign="center">
2809
+ <th scope="row">
2810
+ <label title="Add custom CSS script to override existing styles" for="agca_script_css">Custom CSS script</em></label>
2811
+ </th>
2812
+ <td>
2813
+ <textarea style="width:100%;height:200px" title="Add custom CSS script to override existing styles" rows="5" id="agca_custom_css" name="agca_custom_css" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_css')); ?></textarea>
2814
+ </td>
2815
+ </tr>
2816
+ <tr valign="center">
2817
+ <th scope="row">
2818
+ <label title="Add additional custom JavaScript" for="agca_custom_js">Custom JavaScript</label>
2819
+ </th>
2820
+ <td>
2821
+ <textarea style="width:100%;height:200px" title="Add additional custom JavaScript" rows="5" name="agca_custom_js" id="agca_custom_js" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_js')); ?></textarea>
2822
+ </td>
2823
+ </tr>
2824
+ <tr valign="center">
2825
+ <th scope="row">
2826
+ <label title="Export / import settings" for="agca_export_import">Export / import settings</label>
2827
+ </th>
2828
+ <td id="import_file_area">
2829
+ <input class="agca_button" type="button" name="agca_export_settings" value="Export Settings" onclick="exportSettings();"/></br>
2830
+ <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
2831
+ <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
2832
+ <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
2833
+ <input class="agca_button" type="button" name="agca_import_settings" value="Import Settings" onclick="importSettings();"/>
2834
+ </td>
2835
+ </tr>
2836
+ </table>
2837
+ </div>
2838
  <p class="submit">
2839
+ <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()" />
2840
  </p>
2841
 
2842
  </form>
2843
  <form id="agca_templates_form" name="agca_templates_form" action="<?php echo $_SERVER['PHP_SELF'];?>?page=ag-custom-admin/plugin.php" method="post">
2844
+ <?php wp_nonce_field('agca_form','_agca_token'); ?>
2845
+ <input type="hidden" name="_agca_save_template" value="true" />
2846
+ <input type="hidden" id="templates_data" name="templates_data" value="" />
2847
+ <input type="hidden" id="templates_name" name="templates_name" value="" />
2848
  </form>
2849
+ </div>
2850
  <?php
2851
  }
2852
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wap
3
  Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
- Tested up to: 4.4.2
7
- Stable tag: 1.5.4.3
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
@@ -155,6 +155,12 @@ If you have the latest WordPress and plugin versions and you still experience so
155
 
156
  == Change Log ==
157
 
 
 
 
 
 
 
158
  = 1.5.4.3 =
159
  * Patched security issues.
160
 
@@ -473,6 +479,9 @@ If you have the latest WordPress and plugin versions and you still experience so
473
 
474
  == Upgrade Notice ==
475
 
 
 
 
476
  = 1.5.4.3 =
477
  * Patched security issues.
478
 
3
  Donate link: http://wordpressadminpanel.com/ag-custom-admin/
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
+ Tested up to: 4.5
7
+ Stable tag: 5.5
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
155
 
156
  == Change Log ==
157
 
158
+ = 5.5 =
159
+ * Resolved JavaScript error on AGCA page in WP 4.5 version
160
+ * Added compatibility support with Cusmin plugin
161
+ * Added compatibility support with WPS Hide Login plugin
162
+ * Changed plugin versioning
163
+
164
  = 1.5.4.3 =
165
  * Patched security issues.
166
 
479
 
480
  == Upgrade Notice ==
481
 
482
+ = 5.5 =
483
+ * Compatibility updates with WP 4.5 and some other plugins
484
+
485
  = 1.5.4.3 =
486
  * Patched security issues.
487
 
script/ag_script.js CHANGED
@@ -2,78 +2,78 @@ var afterFormClickCreateJson = true;
2
  var editingButtonNow = false;
3
  var agca_ajax_url = agca_global_plugin_url + "ajax.php";
4
  function booleanToChecked(bool){
5
- if(bool == 'true'){
6
  return 'checked="checked"';
7
- }else if(bool == 'checked'){
8
  return 'checked="checked"';
9
  }
10
  }
11
 
12
  function agcaLog(text){
13
- console.log(text);
14
  }
15
 
16
  function agcaDebug(text){
17
- if(agca_debug){
18
- console.log('- '+text);
19
- }
20
  }
21
 
22
  function agcaDebugObj(obj){
23
- if(agca_debug){
24
- console.log(obj);
25
- }
26
  }
27
 
28
  /*use only on agca page*/
29
  if(window.location.href.indexOf(encodeURIComponent('ag-custom-admin/plugin.php')) !== -1 || window.location.href.indexOf('ag-custom-admin/plugin.php') !== -1){
30
- jQuery(function(){
31
- var agcapage = localStorage.getItem('agca-page');
32
- if(!agcapage){
33
- localStorage.setItem('agca-page', window.location.hash);
34
- agcapage = localStorage.getItem('agca-page');
35
- }
36
- window.location.hash = window.location.hash || agcapage;
37
- localStorage.setItem('agca-page', window.location.hash);
38
-
39
- });
40
- window.onhashchange = function(){
41
- localStorage.setItem('agca-page', window.location.hash);
42
- if(jQuery('#ag_main_menu a.selected').attr('href') !== window.location.hash){
43
- if(window.location.hash !== ""){
44
- jQuery('#ag_main_menu a[href='+window.location.hash+']').trigger('click');
45
- }
46
- }
47
- };
48
  }
49
 
50
  function hideShowSubmenus(index){
51
  var finish = false;
52
  var found = false;
53
- jQuery('#ag_edit_adminmenu td').each(function(){
54
- if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
55
- // jQuery(this).find('.agcaMenuEditorPlusMinus').show();
56
- var caller = jQuery('#ag_edit_adminmenu td:eq(' + index + ')');
57
- jQuery(caller).find('.agcaMenuEditorPlusMinus .minus').toggle();
58
- jQuery(caller).find('.agcaMenuEditorPlusMinus .plus').toggle();
59
  if(jQuery(this).hasClass('ag_admin_menu_child')){
60
  jQuery(this).parent().toggleClass('noclass');
61
  found = true;
62
  }
63
- if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
64
- finish = true;
65
  }
66
  }
67
  });
68
  /*FOCUS*/
69
  if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
70
- jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
71
- };
72
  }
73
 
74
  /*
75
- Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
76
- */
77
  function prettyEditMenuPage(){
78
  jQuery('#ag_edit_adminmenu td').each(function(){
79
  if(jQuery(this).hasClass('ag_admin_menu_child')){
@@ -83,16 +83,16 @@ function prettyEditMenuPage(){
83
  jQuery('#ag_edit_adminmenu td').each(function(){
84
  if(jQuery(this).hasClass('ag_admin_menu_parent')){
85
  jQuery(this).parent().css('background-color','#d8eAd8');
86
- jQuery(this).bind('click',function(evt){
87
  if(evt.target.className == 'ag_admin_menu_parent'){
88
  hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
89
- }
90
  });
91
  };
92
  });
93
- jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
94
- jQuery(this).parent().click();
95
- //jQuery(this).parent().focus();
96
  });
97
  };
98
  function editMenuRow(url, originalName, newName, removed){
@@ -171,7 +171,7 @@ function applyAdminMenuCustomizations(){
171
  });
172
  }
173
 
174
- function showHideSection(text) {
175
  switch(text)
176
  {
177
  case 'General':
@@ -180,7 +180,7 @@ function showHideSection(text) {
180
  break;
181
  case 'Admin Bar':
182
  jQuery('#section_admin_bar').show();
183
- jQuery('#section_admin_bar .section_title').trigger('focus');
184
  break;
185
  case 'Admin Footer':
186
  jQuery('#section_admin_footer').show();
@@ -197,18 +197,18 @@ function showHideSection(text) {
197
  case 'Admin Menu':
198
  jQuery('#section_admin_menu').show();
199
  jQuery('#section_admin_menu .section_title').trigger('focus');
200
- break;
201
  case 'Colorizer':
202
  jQuery('#section_ag_colorizer_settings').show();
203
  jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
204
  break;
205
- case 'Admin Themes':
206
- if(!jQuery('#section_templates').hasClass("loaded")){
207
- jQuery('#section_templates').addClass('loaded');
208
- agca_client_init();
209
- }
210
  jQuery('#section_templates').show();
211
- jQuery('#section_templates .section_title').trigger('focus');
212
  break;
213
  case 'Advanced':
214
  jQuery('#section_advanced').show();
@@ -216,7 +216,7 @@ function showHideSection(text) {
216
  break;
217
  default:
218
  jQuery('#section_admin_bar').show();
219
- jQuery('#section_admin_bar .section_title').trigger('focus');
220
  }
221
  }
222
 
@@ -233,7 +233,7 @@ function reloadRemoveButtonEvents(){
233
  function createTargetCombo(target,clas){
234
 
235
  var combo = ""
236
-
237
  combo+= "&nbsp;open&nbsp;in:<select";
238
  if( clas != null){
239
  combo+=" class=\"editTarget\" ";
@@ -254,17 +254,17 @@ function createTargetCombo(target,clas){
254
  }
255
 
256
  function exportSettings(){
257
- jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
258
- jQuery('#agca_form #_agca_import_settings').val("false");
259
- jQuery('#agca_form #_agca_export_settings').val("true");
260
-
261
-
262
- jQuery('#ag_add_adminmenu_json').val('');
263
- jQuery('#ag_edit_adminmenu_json').val('');
264
- jQuery('#ag_edit_adminmenu_json_new').val('');
265
-
266
-
267
- jQuery('#agca_form').submit();
268
  }
269
 
270
  function importSettings(){
@@ -275,13 +275,13 @@ function importSettings(){
275
  if(jQuery('#settings_import_file').val() !=""){
276
  jQuery('#agca_form #_agca_import_settings').val("true");
277
  jQuery('#agca_form #_agca_export_settings').val("false");
278
- jQuery('#agca_form').attr('enctype','multipart/form-data');
279
  jQuery('#agca_form').submit();
280
  }else{
281
  alert("File for import is not selected!");
282
- }
283
  }
284
-
285
  }
286
 
287
  function savePluginSettings(){
@@ -289,149 +289,156 @@ function savePluginSettings(){
289
  jQuery('#agca_form').submit();
290
  }
291
 
292
- jQuery(document).ready(function(){
293
  jQuery('#ag_add_adminmenu').on("click", 'a.button_remove', function(){
294
  jQuery(this).parent().parent().remove();
295
- });
296
- jQuery('#ag_add_adminmenu').on('click', 'a.button_edit', function(){
297
- if(editingButtonNow == false){
298
  var name = jQuery(this).parent().find('button').text();
299
- var url = jQuery(this).parent().find('button').attr('title');
300
  var target = jQuery(this).parent().find('button').attr('target');
301
  //console.log(target);
302
  editingButtonNow = name;
303
  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")+ '<input type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit" value="Save changes" /></div>');
304
  reloadRemoveButtonEvents();
305
- }
306
  });/*Save editing changes*/
307
- jQuery('#ag_add_adminmenu').on("click", '#ag_add_adminmenu_button_edit', function(){
308
  //alert(jQuery(this).parent().html());
309
  var name = jQuery('#ag_add_adminmenu_name_edit').val();
310
  var url = jQuery('#ag_add_adminmenu_url_edit').val();
311
  var target = jQuery('select.editTarget').val();
312
  //var target = jQuery(this).parent().find('button').attr('target');
313
  name = name.replace(/["']{1}/gi,"");
314
- url = url.replace(/["']{1}/gi,"");
315
  jQuery('#temporary_button_edit').remove();
316
-
317
  var element = 0;
318
  jQuery('#ag_add_adminmenu :button').each(function(){
319
  //dont use first button for adding new buttons
320
- if(element > 0){
321
  if(jQuery(this).html() == editingButtonNow){
322
  jQuery(this).attr('title',url);
323
  jQuery(this).attr('target',target);
324
- jQuery(this).html(name);
325
  }
326
  }
327
  element++;
328
  });
329
  editingButtonNow = false;
330
  });
331
-
332
  setTimeout(function(){
333
  jQuery('#agca_advertising').show(),700
334
- });
335
- });
336
  /*ToolTip*/
337
- function agcaApplyTooltip(){
338
- if(jQuery(this).attr('title') != ""){
339
  jQuery(this).hover(function(e) {
340
  if(jQuery(this).hasClass('feedback')){
341
- jQuery(this).mousemove(function(e) {
342
- var tipY = e.pageY + 16;
343
- var tipX = e.pageX - 236;
344
- var type = '#f08080';
345
- if(jQuery(this).hasClass('positive')) {
346
- type = '#ACC491';
347
- }
348
- jQuery("#AGToolTipDiv").css({
349
- 'top': tipY,
350
- 'left': tipX,
351
- 'background': type,
352
- 'border': 'none',
353
- 'padding': '10px',
354
- 'color':'#fff',
355
- 'font-weight':'bold',
356
- 'border-radius': '5px'
 
357
  });
358
- });
359
  }else{
360
- jQuery(this).mousemove(function(e) {
361
- var tipY = e.pageY + 16;
362
- var tipX = e.pageX + 16;
363
- jQuery("#AGToolTipDiv").css({
364
- 'top': tipY,
365
- 'left': tipX,
366
- 'background': '#FFFFD4',
367
- 'border': '1px solid #FFFF00'
 
368
  });
369
- });
370
- }
371
- jQuery("#AGToolTipDiv")
372
- .html(jQuery(this).attr('title'))
373
- .stop(true,true)
374
- .fadeIn("fast");
375
- jQuery(this).removeAttr('title');
376
  }, function() {
377
  jQuery("#AGToolTipDiv")
378
- .stop(true,true)
379
- .fadeOut("fast");
380
  jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
381
  });
382
- }
383
- }
384
 
385
- jQuery(document).ready(function(){
386
  /*Add click handler on main buttons*/
387
  jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(e){
388
- if(jQuery(e.target).is('li')){
389
- var hash = jQuery(this).find('a:first').attr('href');
390
- document.location.hash = hash;
391
- };
392
- hideAllSections();
393
  var text = jQuery(this).text();
394
- jQuery(this).attr("class","selected");
395
  showHideSection(text);
396
-
397
  });
398
-
399
- /*Admin Menu Reset all setings button*/
400
- jQuery('#ag_edit_adminmenu_reset_button').click(function(){
401
  afterFormClickCreateJson = false;
402
  jQuery('#agca_form').submit();
403
- });
404
 
405
  /*Add new menu item button - creates new HTMl button elements*/
406
- jQuery('#ag_add_adminmenu_button').click(function(){
407
  var name = jQuery('#ag_add_adminmenu_name').val();
408
- var url = jQuery('#ag_add_adminmenu_url').val();
409
- var target = jQuery('#ag_add_adminmenu_target').val();
410
  name = name.replace(/["']{1}/gi,"");
411
- url = url.replace(/["']{1}/gi,"");
412
  jQuery('#ag_add_adminmenu_name').val("");
413
  jQuery('#ag_add_adminmenu_url').val("");
414
  jQuery('#ag_add_adminmenu_target').val("_self");
415
  jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>');
416
  reloadRemoveButtonEvents();
417
- });
418
-
419
  /*Add tooltip box*/
420
- jQuery("body").append("<div id='AGToolTipDiv'></div>");
421
-
422
  /*ToolTip*/
423
  jQuery("label[title],#agca_donate_button, a.feedback").each(agcaApplyTooltip);
424
-
425
  /*SECTION FOCUS*/
426
- jQuery('.section_title').focus(function(){
427
- });
428
-
429
-
430
- //check hashtag
431
- if(document.location.hash !== ""){
432
- jQuery('#ag_main_menu a[href='+document.location.hash+']').trigger('click');
433
- };
434
-
 
 
 
 
 
 
 
 
435
  });
436
 
437
  jQuery(function($){
@@ -514,79 +521,79 @@ function processData(){
514
  //console.log(jQuery(this).html()+jQuery(this).attr('title'));
515
  if(element > 0){
516
  if(element > 1){
517
- array += ", ";
518
  }
519
  array += "\"" + jQuery(this).html() + "\" : {";
520
  array += " \"value\" : ";
521
  array += "\"" + jQuery(this).attr('title') + "\"";
522
  array += ", \"target\" : ";
523
- array += "\"" + jQuery(this).attr('target') + "\"}";
524
  }
525
  element++;
526
  });
527
- array += "}";
528
  if(element == 1){
529
  array="";
530
  }
531
- jQuery('#ag_add_adminmenu_json').val(array);
532
-
533
-
534
-
535
  /*Serialize colors*/
536
  var array = "{";
537
  var firstElement = true;
538
  var topMarker = "";
539
- jQuery('input.color_picker').each(function(){
540
  if(firstElement != true){
541
- array += ", ";
542
- }
543
  array += "\"" + jQuery(this).attr('id') + "\" : ";
544
  array += "\"" + jQuery(this).val() + "\"";
545
- firstElement = false;
546
  });
547
- array += "}";
548
-
549
  if(!isSettingsImport){
550
- jQuery('#ag_colorizer_json').val(array);
551
- }
552
  }
553
 
554
  function agca_escapeHTMLChars(str){
555
- return str
556
- .replace(/&/g, '&amp;')
557
- .replace(/'/g, '&#39;')
558
- .replace(/"/g, '&quot;');
559
  }
560
 
561
  function agca_escapeChars(str){
562
- return str.replace(/[\/\\\"\']/g, "\\$&");
563
- //return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
564
  }
565
 
566
  /*C O L O R I Z E R*/
567
  function updateTargetColor(id, color){
568
  switch(id)
569
- {
570
- case 'color_background':
571
  jQuery('html, .wp-dialog').css({
572
  'background-color':color
573
- });
574
- break;
575
- case 'login_color_background':
576
  jQuery('body.login').css({
577
  'background-color':color
578
- });
579
- break;
580
-
581
- case 'color_header':
582
  jQuery('#wphead').css({
583
  'background':color
584
- });
585
-
586
  //wp > 3.3
587
  jQuery('#wpadminbar').css({'background':color});
588
  jQuery('#wpadminbar .ab-top-menu').css({'background':color});
589
-
590
  if(wpversion >= 3.2){
591
  jQuery('#wphead').css({
592
  'margin':'0',
@@ -600,67 +607,67 @@ function updateTargetColor(id, color){
600
  jQuery('#adminmenu a.menu-top').css({
601
  'background':color
602
  });
603
- jQuery('#adminmenu li.menu-top').css({
604
  'background':color
605
  });
606
  break;
607
  case 'color_admin_menu_top_button_current_background':
608
  jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
609
  'background':color
610
-
611
  });
612
  jQuery('#adminmenu li.menu-top.current a.menu-top').css({
613
  'background':color
614
  });
615
- jQuery('body.folded #adminmenu li.menu-top.wp-menu-open').css({
616
  'background':color
617
  });
618
  break;
619
  case 'color_admin_menu_top_button_hover_background':
620
  if(color == "")break;
621
- var selector = '#adminmenu a.menu-top';
622
- if(jQuery('body').hasClass('folded')){
623
- selector = '#adminmenu li.menu-top';
624
- }
625
- var originalBackground = jQuery(selector).css('background-color');
626
 
627
  //if first is selected, use second
628
- if((jQuery(selector+":eq(0)").hasClass('current') || jQuery(selector+":eq(0)").hasClass('wp-has-current-submenu'))){
629
- originalBackground = jQuery(selector+':eq(1)').css('background-color');
630
- }
631
- jQuery(selector).mouseover(function(){
632
- if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
633
- jQuery(this).css({'background':color});
634
- }
635
  }).mouseout(function(){
636
- if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
637
- jQuery(this).css('background',originalBackground);
638
- }
639
- });
640
-
641
- //for folded menu
642
-
643
-
644
  break;
645
  case 'color_admin_menu_submenu_background':
646
- // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
647
  jQuery('#adminmenu .wp-submenu.sub-open').remove();
648
  jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
649
  jQuery(this).css({
650
  'background':color
651
- });
652
  });
653
  jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'0',"padding-top":roundedSidberSize+"px","padding-bottom":roundedSidberSize+"px"});
654
  jQuery('#adminmenu .wp-has-current-submenu .wp-submenu').css("padding","0");
655
  //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
656
  jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
657
  jQuery('#adminmenu .wp-submenu ul').css('border','none');
658
- jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
659
-
660
- break;
661
- case 'color_admin_submenu_font':
662
- jQuery('#adminmenu .wp-submenu li a').css('color',color);
663
- break;
664
  case 'color_admin_menu_font':
665
  jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
666
  'color':color
@@ -672,14 +679,14 @@ function updateTargetColor(id, color){
672
  });
673
  break;
674
  case 'color_admin_menu_submenu_background_hover':
675
- var submenuSelector = '#adminmenu .wp-submenu a';
676
- var originalSubBackground = jQuery(submenuSelector).css('background-color');
677
- jQuery(submenuSelector).mouseover(function(){
678
  jQuery(this).css({
679
- 'background':color
680
- });
681
  }).mouseout(function(){
682
- jQuery(this).css('background',originalSubBackground);
683
  });
684
  //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
685
  break;
@@ -700,16 +707,16 @@ function updateTargetColor(id, color){
700
  break;
701
  case 'color_widget_bar':
702
  jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
703
- 'background' : color,
704
  'text-shadow' :'none'
705
  });
706
  break;
707
  case 'color_widget_background':
708
- jQuery(".widget, .postbox").css('background',color);
709
  //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
710
- break;
711
- default:
712
- }
713
  }
714
  function updateColor(id,color){
715
  jQuery("#"+id).css({
@@ -720,7 +727,7 @@ function updateColor(id,color){
720
  jQuery("#"+id).css('color','#ffffff');
721
  }else{
722
  jQuery("#"+id).css('color','#000000');
723
- }
724
  updateTargetColor(id,color);
725
  }
726
  /*First load apply colours from fields*/
@@ -728,167 +735,167 @@ function updateColor(id,color){
728
  /*C O L O R I Z E R E N D*/
729
 
730
  /*A J A X*/
731
- jQuery(document).ready(function(){
732
-
733
  //Ams
734
  if(typeof isAGCAPage !== 'undefined'){
735
  if(isAGCAPage == true){
736
- //alert('admin page');
737
  var url="http://wordpressadminpanel.com/ads/ep/ads/ads?jsoncallback=?";
738
- jQuery.getJSON(
739
- url,{
740
- wp_ver: wpversion,
741
- agca_ver: agca_version,
742
- format: "json"
743
- },
744
- function(json){
745
- jQuery.each(json,function(i,post){
746
- jQuery('#agca_advertising ul').append('<li><a target="_blank" href="http://wordpressadminpanel.com/ads/ep/ads/ad?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
747
- });
748
- jQuery('#agca_advertising').show();
749
-
750
- });
751
- }
752
- }
753
-
754
-
755
  //News
756
  jQuery(document).ready(function(){
757
- if(typeof isAGCAPage !== 'undefined'){
758
- if(isAGCAPage == true){
759
- var url="http://wordpressadminpanel.com/info/info?jsoncallback=?";
760
- jQuery.getJSON(
761
- url,{
762
- wp_ver: wpversion,
763
- agca_ver: agca_version,
764
- format: "json"
765
- },
766
- function(json){
767
- jQuery.each(json.posts,function(i,post){
768
- jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
769
- });
770
- jQuery('#agca_news p').each(function(){
771
- jQuery(this).hide();
772
- });
773
-
774
- });
775
-
776
- setInterval(function() {
777
- if(jQuery('#agca_news p.news_online').size() == 0){
778
- jQuery('#agca_news p:first').addClass('news_online');
779
- jQuery('#agca_news p:first').show();
780
- }else{
781
- var changed = false;
782
- var finish = false;
783
- jQuery('#agca_news p').each(function(){
784
- if(finish != true){
785
- if(changed == true){
786
- jQuery(this).addClass('news_online');
787
- jQuery(this).show();
788
- finish = true;
789
- }
790
- else if(jQuery(this).hasClass('news_online')){
791
- jQuery(this).hide();
792
- jQuery(this).removeClass('news_online');
793
- changed = true;
794
- };
795
- }
796
- });
797
- if(jQuery('#agca_news p.news_online').size() == 0){
798
- jQuery('#agca_news p:first').addClass('news_online');
799
- jQuery('#agca_news p:first').show();
800
  }
 
 
 
 
 
801
  }
802
- }, 5000);
803
- }
804
- }
805
-
806
- });
807
-
 
 
 
 
 
 
808
 
809
  });
810
  /*A J A X*/
811
 
812
  /*AGCA CHECKBOX RADIOBOX*/
813
- function agcaCheckBoxOnClick(obj){
814
- var isNowChecked = false;
815
- var $input = jQuery(obj).prev();
816
- if($input.is(':checked')){
817
- $input.removeAttr('checked');
818
- }else{
819
- isNowChecked = true;
820
- $input.attr('checked','checked');
821
- }
822
-
823
- if($input.hasClass('has-dependant')){
824
- var dependantSel = $input.data('dependant');
825
- var isOppositeToggle = $input.hasClass('dependant-opposite');
826
-
827
- if(isNowChecked && !isOppositeToggle || !isNowChecked && isOppositeToggle){
828
  jQuery(dependantSel).show("slide");
829
  }else{
830
  jQuery(dependantSel).hide("slideDown");
831
  }
832
- }
833
-
834
- //console.log(obj.prev());
835
- if($input.is(':checked')){
836
- jQuery(obj).addClass('agca-checkbox-box-checked');
837
- jQuery(obj).removeClass('agca-checkbox-box');
838
- }else{
839
- jQuery(obj).addClass('agca-checkbox-box');
840
- jQuery(obj).removeClass('agca-checkbox-box-checked');
841
- }
842
  }
843
- function agcaRadioBoxOnClick(obj){
844
- obj.prev().trigger('click');
845
- //console.log(obj.prev());
846
- obj.parent().find('.agca-radiobox').removeClass('checked');
847
- if(jQuery(obj).prev().is(':checked')){
848
- jQuery(obj).addClass('checked');
849
- }else{
850
- jQuery(obj).removeClass('checked');
851
- }
852
  }
853
  function agcaChangeCheckBoxStyles(){
854
- /*checkbox*/
855
- jQuery('.agca-checkbox-box-checked').remove();
856
- jQuery('.agca-checkbox-box').remove();
857
- jQuery('.agca-checkbox').each(function(){
858
- jQuery(this).hide();
859
- var cls = "agca-checkbox-box";
860
- if(jQuery(this).is(':checked')){
861
- cls = "agca-checkbox-box-checked";
862
- }
863
  if(jQuery(this).hasClass('visibility')){
864
  cls +=' visibility';
865
  }
866
- jQuery(this).after('<div onClick="agcaCheckBoxOnClick(jQuery(this));" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
867
- });
868
-
869
- /*radio*/
870
- jQuery('.agca-radiobox').remove();
871
- jQuery('.agca-radio').each(function(){
872
- jQuery(this).hide();
873
- var cls = "agca-radiobox";
874
- if(jQuery(this).is(':checked')){
875
- cls = "agca-radiobox checked";
876
- }
877
-
878
- jQuery(this).after('<div onClick="agcaRadioBoxOnClick(jQuery(this));" value="'+jQuery(this).attr('value')+'" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
879
- });
880
  }
881
 
882
- function isWPHigherOrEqualThan(targetVersion){
883
  //remove sufixes, beta RC etc
884
  if (wpversion.indexOf("-")!=-1){
885
  var parts = wpversion.split("-");
886
  wpversion = parts[0];
887
  }
888
- var currentVersion = parseFloat(wpversion);
889
- targetVersion = parseFloat(targetVersion);
890
-
891
- return (wpversion >= targetVersion);
892
  }
893
 
894
  function colorizerColorizeTextboxes(){
@@ -911,12 +918,12 @@ jQuery(document).ready(function() {
911
  // Allow only backspace and delete
912
  var limit = jQuery(this).attr('limit');
913
  var value = jQuery(this).val();
914
-
915
  if ( event.keyCode == 46 || event.keyCode == 8 ) {
916
  } else {
917
- if((typeof(limit) != undefined) && value.length >= limit){
918
- return false;
919
- }
920
  if (event.keyCode < 95) {
921
  if (event.keyCode < 48 || event.keyCode > 57 ) {
922
  event.preventDefault();
2
  var editingButtonNow = false;
3
  var agca_ajax_url = agca_global_plugin_url + "ajax.php";
4
  function booleanToChecked(bool){
5
+ if(bool == 'true'){
6
  return 'checked="checked"';
7
+ }else if(bool == 'checked'){
8
  return 'checked="checked"';
9
  }
10
  }
11
 
12
  function agcaLog(text){
13
+ console.log(text);
14
  }
15
 
16
  function agcaDebug(text){
17
+ if(agca_debug){
18
+ console.log('- '+text);
19
+ }
20
  }
21
 
22
  function agcaDebugObj(obj){
23
+ if(agca_debug){
24
+ console.log(obj);
25
+ }
26
  }
27
 
28
  /*use only on agca page*/
29
  if(window.location.href.indexOf(encodeURIComponent('ag-custom-admin/plugin.php')) !== -1 || window.location.href.indexOf('ag-custom-admin/plugin.php') !== -1){
30
+ jQuery(function(){
31
+ var agcapage = localStorage.getItem('agca-page');
32
+ if(!agcapage){
33
+ localStorage.setItem('agca-page', window.location.hash);
34
+ agcapage = localStorage.getItem('agca-page');
35
+ }
36
+ window.location.hash = window.location.hash || agcapage;
37
+ localStorage.setItem('agca-page', window.location.hash);
38
+
39
+ });
40
+ window.onhashchange = function(){
41
+ localStorage.setItem('agca-page', window.location.hash);
42
+ if(jQuery('#ag_main_menu a.selected').attr('href') !== window.location.hash){
43
+ if(window.location.hash !== ""){
44
+ // jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click');
45
+ }
46
+ }
47
+ };
48
  }
49
 
50
  function hideShowSubmenus(index){
51
  var finish = false;
52
  var found = false;
53
+ jQuery('#ag_edit_adminmenu td').each(function(){
54
+ if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
55
+ // jQuery(this).find('.agcaMenuEditorPlusMinus').show();
56
+ var caller = jQuery('#ag_edit_adminmenu td:eq(' + index + ')');
57
+ jQuery(caller).find('.agcaMenuEditorPlusMinus .minus').toggle();
58
+ jQuery(caller).find('.agcaMenuEditorPlusMinus .plus').toggle();
59
  if(jQuery(this).hasClass('ag_admin_menu_child')){
60
  jQuery(this).parent().toggleClass('noclass');
61
  found = true;
62
  }
63
+ if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
64
+ finish = true;
65
  }
66
  }
67
  });
68
  /*FOCUS*/
69
  if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
70
+ jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
71
+ };
72
  }
73
 
74
  /*
75
+ Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
76
+ */
77
  function prettyEditMenuPage(){
78
  jQuery('#ag_edit_adminmenu td').each(function(){
79
  if(jQuery(this).hasClass('ag_admin_menu_child')){
83
  jQuery('#ag_edit_adminmenu td').each(function(){
84
  if(jQuery(this).hasClass('ag_admin_menu_parent')){
85
  jQuery(this).parent().css('background-color','#d8eAd8');
86
+ jQuery(this).bind('click',function(evt){
87
  if(evt.target.className == 'ag_admin_menu_parent'){
88
  hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
89
+ }
90
  });
91
  };
92
  });
93
+ jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
94
+ jQuery(this).parent().click();
95
+ //jQuery(this).parent().focus();
96
  });
97
  };
98
  function editMenuRow(url, originalName, newName, removed){
171
  });
172
  }
173
 
174
+ function showHideSection(text) {
175
  switch(text)
176
  {
177
  case 'General':
180
  break;
181
  case 'Admin Bar':
182
  jQuery('#section_admin_bar').show();
183
+ jQuery('#section_admin_bar .section_title').trigger('focus');
184
  break;
185
  case 'Admin Footer':
186
  jQuery('#section_admin_footer').show();
197
  case 'Admin Menu':
198
  jQuery('#section_admin_menu').show();
199
  jQuery('#section_admin_menu .section_title').trigger('focus');
200
+ break;
201
  case 'Colorizer':
202
  jQuery('#section_ag_colorizer_settings').show();
203
  jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
204
  break;
205
+ case 'Admin Themes':
206
+ if(!jQuery('#section_templates').hasClass("loaded")){
207
+ jQuery('#section_templates').addClass('loaded');
208
+ agca_client_init();
209
+ }
210
  jQuery('#section_templates').show();
211
+ jQuery('#section_templates .section_title').trigger('focus');
212
  break;
213
  case 'Advanced':
214
  jQuery('#section_advanced').show();
216
  break;
217
  default:
218
  jQuery('#section_admin_bar').show();
219
+ jQuery('#section_admin_bar .section_title').trigger('focus');
220
  }
221
  }
222
 
233
  function createTargetCombo(target,clas){
234
 
235
  var combo = ""
236
+
237
  combo+= "&nbsp;open&nbsp;in:<select";
238
  if( clas != null){
239
  combo+=" class=\"editTarget\" ";
254
  }
255
 
256
  function exportSettings(){
257
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
258
+ jQuery('#agca_form #_agca_import_settings').val("false");
259
+ jQuery('#agca_form #_agca_export_settings').val("true");
260
+
261
+
262
+ jQuery('#ag_add_adminmenu_json').val('');
263
+ jQuery('#ag_edit_adminmenu_json').val('');
264
+ jQuery('#ag_edit_adminmenu_json_new').val('');
265
+
266
+
267
+ jQuery('#agca_form').submit();
268
  }
269
 
270
  function importSettings(){
275
  if(jQuery('#settings_import_file').val() !=""){
276
  jQuery('#agca_form #_agca_import_settings').val("true");
277
  jQuery('#agca_form #_agca_export_settings').val("false");
278
+ jQuery('#agca_form').attr('enctype','multipart/form-data');
279
  jQuery('#agca_form').submit();
280
  }else{
281
  alert("File for import is not selected!");
282
+ }
283
  }
284
+
285
  }
286
 
287
  function savePluginSettings(){
289
  jQuery('#agca_form').submit();
290
  }
291
 
292
+ jQuery(document).ready(function(){
293
  jQuery('#ag_add_adminmenu').on("click", 'a.button_remove', function(){
294
  jQuery(this).parent().parent().remove();
295
+ });
296
+ jQuery('#ag_add_adminmenu').on('click', 'a.button_edit', function(){
297
+ if(editingButtonNow == false){
298
  var name = jQuery(this).parent().find('button').text();
299
+ var url = jQuery(this).parent().find('button').attr('title');
300
  var target = jQuery(this).parent().find('button').attr('target');
301
  //console.log(target);
302
  editingButtonNow = name;
303
  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")+ '<input type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit" value="Save changes" /></div>');
304
  reloadRemoveButtonEvents();
305
+ }
306
  });/*Save editing changes*/
307
+ jQuery('#ag_add_adminmenu').on("click", '#ag_add_adminmenu_button_edit', function(){
308
  //alert(jQuery(this).parent().html());
309
  var name = jQuery('#ag_add_adminmenu_name_edit').val();
310
  var url = jQuery('#ag_add_adminmenu_url_edit').val();
311
  var target = jQuery('select.editTarget').val();
312
  //var target = jQuery(this).parent().find('button').attr('target');
313
  name = name.replace(/["']{1}/gi,"");
314
+ url = url.replace(/["']{1}/gi,"");
315
  jQuery('#temporary_button_edit').remove();
316
+
317
  var element = 0;
318
  jQuery('#ag_add_adminmenu :button').each(function(){
319
  //dont use first button for adding new buttons
320
+ if(element > 0){
321
  if(jQuery(this).html() == editingButtonNow){
322
  jQuery(this).attr('title',url);
323
  jQuery(this).attr('target',target);
324
+ jQuery(this).html(name);
325
  }
326
  }
327
  element++;
328
  });
329
  editingButtonNow = false;
330
  });
331
+
332
  setTimeout(function(){
333
  jQuery('#agca_advertising').show(),700
334
+ });
335
+ });
336
  /*ToolTip*/
337
+ function agcaApplyTooltip(){
338
+ if(jQuery(this).attr('title') != ""){
339
  jQuery(this).hover(function(e) {
340
  if(jQuery(this).hasClass('feedback')){
341
+ jQuery(this).mousemove(function(e) {
342
+ var tipY = e.pageY + 16;
343
+ var tipX = e.pageX - 236;
344
+ var type = '#f08080';
345
+ if(jQuery(this).hasClass('positive')) {
346
+ type = '#ACC491';
347
+ }
348
+ jQuery("#AGToolTipDiv").css({
349
+ 'top': tipY,
350
+ 'left': tipX,
351
+ 'background': type,
352
+ 'border': 'none',
353
+ 'padding': '10px',
354
+ 'color':'#fff',
355
+ 'font-weight':'bold',
356
+ 'border-radius': '5px'
357
+ });
358
  });
 
359
  }else{
360
+ jQuery(this).mousemove(function(e) {
361
+ var tipY = e.pageY + 16;
362
+ var tipX = e.pageX + 16;
363
+ jQuery("#AGToolTipDiv").css({
364
+ 'top': tipY,
365
+ 'left': tipX,
366
+ 'background': '#FFFFD4',
367
+ 'border': '1px solid #FFFF00'
368
+ });
369
  });
370
+ }
371
+ jQuery("#AGToolTipDiv")
372
+ .html(jQuery(this).attr('title'))
373
+ .stop(true,true)
374
+ .fadeIn("fast");
375
+ jQuery(this).removeAttr('title');
 
376
  }, function() {
377
  jQuery("#AGToolTipDiv")
378
+ .stop(true,true)
379
+ .fadeOut("fast");
380
  jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
381
  });
382
+ }
383
+ }
384
 
385
+ jQuery(document).ready(function(){
386
  /*Add click handler on main buttons*/
387
  jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(e){
388
+ if(jQuery(e.target).is('li')){
389
+ var hash = jQuery(this).find('a:first').attr('href');
390
+ document.location.hash = hash;
391
+ };
392
+ hideAllSections();
393
  var text = jQuery(this).text();
394
+ jQuery(this).attr("class","selected");
395
  showHideSection(text);
 
396
  });
397
+
398
+ /*Admin Menu Reset all setings button*/
399
+ jQuery('#ag_edit_adminmenu_reset_button').click(function(){
400
  afterFormClickCreateJson = false;
401
  jQuery('#agca_form').submit();
402
+ });
403
 
404
  /*Add new menu item button - creates new HTMl button elements*/
405
+ jQuery('#ag_add_adminmenu_button').click(function(){
406
  var name = jQuery('#ag_add_adminmenu_name').val();
407
+ var url = jQuery('#ag_add_adminmenu_url').val();
408
+ var target = jQuery('#ag_add_adminmenu_target').val();
409
  name = name.replace(/["']{1}/gi,"");
410
+ url = url.replace(/["']{1}/gi,"");
411
  jQuery('#ag_add_adminmenu_name').val("");
412
  jQuery('#ag_add_adminmenu_url').val("");
413
  jQuery('#ag_add_adminmenu_target').val("_self");
414
  jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>');
415
  reloadRemoveButtonEvents();
416
+ });
417
+
418
  /*Add tooltip box*/
419
+ jQuery("body").append("<div id='AGToolTipDiv'></div>");
420
+
421
  /*ToolTip*/
422
  jQuery("label[title],#agca_donate_button, a.feedback").each(agcaApplyTooltip);
423
+
424
  /*SECTION FOCUS*/
425
+ jQuery('.section_title').focus(function(){
426
+ });
427
+
428
+
429
+ //check hashtag
430
+ if(document.location.hash !== ""){
431
+ jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click')
432
+ };
433
+
434
+ if(typeof isCusminActive !== 'undefined' && isCusminActive){
435
+ hideAllSections();
436
+ jQuery('#section_templates, #section-cusmin').show();
437
+ if(typeof agca_client_init === 'function'){
438
+ agca_client_init();
439
+ }
440
+ }
441
+
442
  });
443
 
444
  jQuery(function($){
521
  //console.log(jQuery(this).html()+jQuery(this).attr('title'));
522
  if(element > 0){
523
  if(element > 1){
524
+ array += ", ";
525
  }
526
  array += "\"" + jQuery(this).html() + "\" : {";
527
  array += " \"value\" : ";
528
  array += "\"" + jQuery(this).attr('title') + "\"";
529
  array += ", \"target\" : ";
530
+ array += "\"" + jQuery(this).attr('target') + "\"}";
531
  }
532
  element++;
533
  });
534
+ array += "}";
535
  if(element == 1){
536
  array="";
537
  }
538
+ jQuery('#ag_add_adminmenu_json').val(array);
539
+
540
+
541
+
542
  /*Serialize colors*/
543
  var array = "{";
544
  var firstElement = true;
545
  var topMarker = "";
546
+ jQuery('input.color_picker').each(function(){
547
  if(firstElement != true){
548
+ array += ", ";
549
+ }
550
  array += "\"" + jQuery(this).attr('id') + "\" : ";
551
  array += "\"" + jQuery(this).val() + "\"";
552
+ firstElement = false;
553
  });
554
+ array += "}";
555
+
556
  if(!isSettingsImport){
557
+ jQuery('#ag_colorizer_json').val(array);
558
+ }
559
  }
560
 
561
  function agca_escapeHTMLChars(str){
562
+ return str
563
+ .replace(/&/g, '&amp;')
564
+ .replace(/'/g, '&#39;')
565
+ .replace(/"/g, '&quot;');
566
  }
567
 
568
  function agca_escapeChars(str){
569
+ return str.replace(/[\/\\\"\']/g, "\\$&");
570
+ //return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
571
  }
572
 
573
  /*C O L O R I Z E R*/
574
  function updateTargetColor(id, color){
575
  switch(id)
576
+ {
577
+ case 'color_background':
578
  jQuery('html, .wp-dialog').css({
579
  'background-color':color
580
+ });
581
+ break;
582
+ case 'login_color_background':
583
  jQuery('body.login').css({
584
  'background-color':color
585
+ });
586
+ break;
587
+
588
+ case 'color_header':
589
  jQuery('#wphead').css({
590
  'background':color
591
+ });
592
+
593
  //wp > 3.3
594
  jQuery('#wpadminbar').css({'background':color});
595
  jQuery('#wpadminbar .ab-top-menu').css({'background':color});
596
+
597
  if(wpversion >= 3.2){
598
  jQuery('#wphead').css({
599
  'margin':'0',
607
  jQuery('#adminmenu a.menu-top').css({
608
  'background':color
609
  });
610
+ jQuery('#adminmenu li.menu-top').css({
611
  'background':color
612
  });
613
  break;
614
  case 'color_admin_menu_top_button_current_background':
615
  jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
616
  'background':color
617
+
618
  });
619
  jQuery('#adminmenu li.menu-top.current a.menu-top').css({
620
  'background':color
621
  });
622
+ jQuery('body.folded #adminmenu li.menu-top.wp-menu-open').css({
623
  'background':color
624
  });
625
  break;
626
  case 'color_admin_menu_top_button_hover_background':
627
  if(color == "")break;
628
+ var selector = '#adminmenu a.menu-top';
629
+ if(jQuery('body').hasClass('folded')){
630
+ selector = '#adminmenu li.menu-top';
631
+ }
632
+ var originalBackground = jQuery(selector).css('background-color');
633
 
634
  //if first is selected, use second
635
+ if((jQuery(selector+":eq(0)").hasClass('current') || jQuery(selector+":eq(0)").hasClass('wp-has-current-submenu'))){
636
+ originalBackground = jQuery(selector+':eq(1)').css('background-color');
637
+ }
638
+ jQuery(selector).mouseover(function(){
639
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
640
+ jQuery(this).css({'background':color});
641
+ }
642
  }).mouseout(function(){
643
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
644
+ jQuery(this).css('background',originalBackground);
645
+ }
646
+ });
647
+
648
+ //for folded menu
649
+
650
+
651
  break;
652
  case 'color_admin_menu_submenu_background':
653
+ // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
654
  jQuery('#adminmenu .wp-submenu.sub-open').remove();
655
  jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
656
  jQuery(this).css({
657
  'background':color
658
+ });
659
  });
660
  jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'0',"padding-top":roundedSidberSize+"px","padding-bottom":roundedSidberSize+"px"});
661
  jQuery('#adminmenu .wp-has-current-submenu .wp-submenu').css("padding","0");
662
  //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
663
  jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
664
  jQuery('#adminmenu .wp-submenu ul').css('border','none');
665
+ jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
666
+
667
+ break;
668
+ case 'color_admin_submenu_font':
669
+ jQuery('#adminmenu .wp-submenu li a').css('color',color);
670
+ break;
671
  case 'color_admin_menu_font':
672
  jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
673
  'color':color
679
  });
680
  break;
681
  case 'color_admin_menu_submenu_background_hover':
682
+ var submenuSelector = '#adminmenu .wp-submenu a';
683
+ var originalSubBackground = jQuery(submenuSelector).css('background-color');
684
+ jQuery(submenuSelector).mouseover(function(){
685
  jQuery(this).css({
686
+ 'background':color
687
+ });
688
  }).mouseout(function(){
689
+ jQuery(this).css('background',originalSubBackground);
690
  });
691
  //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
692
  break;
707
  break;
708
  case 'color_widget_bar':
709
  jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
710
+ 'background' : color,
711
  'text-shadow' :'none'
712
  });
713
  break;
714
  case 'color_widget_background':
715
+ jQuery(".widget, .postbox").css('background',color);
716
  //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
717
+ break;
718
+ default:
719
+ }
720
  }
721
  function updateColor(id,color){
722
  jQuery("#"+id).css({
727
  jQuery("#"+id).css('color','#ffffff');
728
  }else{
729
  jQuery("#"+id).css('color','#000000');
730
+ }
731
  updateTargetColor(id,color);
732
  }
733
  /*First load apply colours from fields*/
735
  /*C O L O R I Z E R E N D*/
736
 
737
  /*A J A X*/
738
+ jQuery(document).ready(function(){
739
+
740
  //Ams
741
  if(typeof isAGCAPage !== 'undefined'){
742
  if(isAGCAPage == true){
743
+ //alert('admin page');
744
  var url="http://wordpressadminpanel.com/ads/ep/ads/ads?jsoncallback=?";
745
+ jQuery.getJSON(
746
+ url,{
747
+ wp_ver: wpversion,
748
+ agca_ver: agca_version,
749
+ format: "json"
750
+ },
751
+ function(json){
752
+ jQuery.each(json,function(i,post){
753
+ jQuery('#agca_advertising ul').append('<li><a target="_blank" href="http://wordpressadminpanel.com/ads/ep/ads/ad?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
754
+ });
755
+ jQuery('#agca_advertising').show();
756
+
757
+ });
758
+ }
759
+ }
760
+
761
+
762
  //News
763
  jQuery(document).ready(function(){
764
+ if(typeof isAGCAPage !== 'undefined'){
765
+ if(isAGCAPage == true){
766
+ var url="http://wordpressadminpanel.com/info/info?jsoncallback=?";
767
+ jQuery.getJSON(
768
+ url,{
769
+ wp_ver: wpversion,
770
+ agca_ver: agca_version,
771
+ format: "json"
772
+ },
773
+ function(json){
774
+ jQuery.each(json.posts,function(i,post){
775
+ jQuery('#agca_news').append('<p><strong>Info: </strong>'+post.news+'</p>');
776
+ });
777
+ jQuery('#agca_news p').each(function(){
778
+ jQuery(this).hide();
779
+ });
780
+
781
+ });
782
+
783
+ setInterval(function() {
784
+ if(jQuery('#agca_news p.news_online').size() == 0){
785
+ jQuery('#agca_news p:first').addClass('news_online');
786
+ jQuery('#agca_news p:first').show();
787
+ }else{
788
+ var changed = false;
789
+ var finish = false;
790
+ jQuery('#agca_news p').each(function(){
791
+ if(finish != true){
792
+ if(changed == true){
793
+ jQuery(this).addClass('news_online');
794
+ jQuery(this).show();
795
+ finish = true;
 
 
 
 
 
 
 
 
 
 
 
796
  }
797
+ else if(jQuery(this).hasClass('news_online')){
798
+ jQuery(this).hide();
799
+ jQuery(this).removeClass('news_online');
800
+ changed = true;
801
+ };
802
  }
803
+ });
804
+ if(jQuery('#agca_news p.news_online').size() == 0){
805
+ jQuery('#agca_news p:first').addClass('news_online');
806
+ jQuery('#agca_news p:first').show();
807
+ }
808
+ }
809
+ }, 5000);
810
+ }
811
+ }
812
+
813
+ });
814
+
815
 
816
  });
817
  /*A J A X*/
818
 
819
  /*AGCA CHECKBOX RADIOBOX*/
820
+ function agcaCheckBoxOnClick(obj){
821
+ var isNowChecked = false;
822
+ var $input = jQuery(obj).prev();
823
+ if($input.is(':checked')){
824
+ $input.removeAttr('checked');
825
+ }else{
826
+ isNowChecked = true;
827
+ $input.attr('checked','checked');
828
+ }
829
+
830
+ if($input.hasClass('has-dependant')){
831
+ var dependantSel = $input.data('dependant');
832
+ var isOppositeToggle = $input.hasClass('dependant-opposite');
833
+
834
+ if(isNowChecked && !isOppositeToggle || !isNowChecked && isOppositeToggle){
835
  jQuery(dependantSel).show("slide");
836
  }else{
837
  jQuery(dependantSel).hide("slideDown");
838
  }
839
+ }
840
+
841
+ //console.log(obj.prev());
842
+ if($input.is(':checked')){
843
+ jQuery(obj).addClass('agca-checkbox-box-checked');
844
+ jQuery(obj).removeClass('agca-checkbox-box');
845
+ }else{
846
+ jQuery(obj).addClass('agca-checkbox-box');
847
+ jQuery(obj).removeClass('agca-checkbox-box-checked');
848
+ }
849
  }
850
+ function agcaRadioBoxOnClick(obj){
851
+ obj.prev().trigger('click');
852
+ //console.log(obj.prev());
853
+ obj.parent().find('.agca-radiobox').removeClass('checked');
854
+ if(jQuery(obj).prev().is(':checked')){
855
+ jQuery(obj).addClass('checked');
856
+ }else{
857
+ jQuery(obj).removeClass('checked');
858
+ }
859
  }
860
  function agcaChangeCheckBoxStyles(){
861
+ /*checkbox*/
862
+ jQuery('.agca-checkbox-box-checked').remove();
863
+ jQuery('.agca-checkbox-box').remove();
864
+ jQuery('.agca-checkbox').each(function(){
865
+ jQuery(this).hide();
866
+ var cls = "agca-checkbox-box";
867
+ if(jQuery(this).is(':checked')){
868
+ cls = "agca-checkbox-box-checked";
869
+ }
870
  if(jQuery(this).hasClass('visibility')){
871
  cls +=' visibility';
872
  }
873
+ jQuery(this).after('<div onClick="agcaCheckBoxOnClick(jQuery(this));" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
874
+ });
875
+
876
+ /*radio*/
877
+ jQuery('.agca-radiobox').remove();
878
+ jQuery('.agca-radio').each(function(){
879
+ jQuery(this).hide();
880
+ var cls = "agca-radiobox";
881
+ if(jQuery(this).is(':checked')){
882
+ cls = "agca-radiobox checked";
883
+ }
884
+
885
+ jQuery(this).after('<div onClick="agcaRadioBoxOnClick(jQuery(this));" value="'+jQuery(this).attr('value')+'" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
886
+ });
887
  }
888
 
889
+ function isWPHigherOrEqualThan(targetVersion){
890
  //remove sufixes, beta RC etc
891
  if (wpversion.indexOf("-")!=-1){
892
  var parts = wpversion.split("-");
893
  wpversion = parts[0];
894
  }
895
+ var currentVersion = parseFloat(wpversion);
896
+ targetVersion = parseFloat(targetVersion);
897
+
898
+ return (wpversion >= targetVersion);
899
  }
900
 
901
  function colorizerColorizeTextboxes(){
918
  // Allow only backspace and delete
919
  var limit = jQuery(this).attr('limit');
920
  var value = jQuery(this).val();
921
+
922
  if ( event.keyCode == 46 || event.keyCode == 8 ) {
923
  } else {
924
+ if((typeof(limit) != undefined) && value.length >= limit){
925
+ return false;
926
+ }
927
  if (event.keyCode < 95) {
928
  if (event.keyCode < 48 || event.keyCode > 57 ) {
929
  event.preventDefault();
script/agca_tmpl.js CHANGED
@@ -1,12 +1,12 @@
1
  var isAGCAPage = true;
2
- var template_name = "";
3
  var templates_installed = [];
4
  var xhr =null;
5
  var agcaLoadingTimeOut = null;
6
 
7
- function agca_getTemplateCallback(data){
8
  agcaDebug('FN:agca_getTemplateCallback()');
9
- agcaDebug(JSON.stringify(data));
10
  if(data.success == 0){
11
  //alert(data.data);
12
  agcaInfoMessage("Error",data.data);
@@ -14,130 +14,130 @@ function agca_getTemplateCallback(data){
14
  }else{
15
  jQuery("#templates_name").val(template_name);
16
  var parts = data.data.split("||||");
17
- jQuery("#templates_data").val(parts[1]);
18
  //console.log(jQuery("#templates_data").val());
19
- jQuery("body").append(parts[0]);
20
-
21
  //load settings
22
- agca_loadTemplateSettingsInitial(template_name);
23
- }
24
- }
25
 
26
- function agca_getTemplateByLicenseKeyCallback(data){
27
  agcaDebug('FN:agca_getTemplateByLicenseKeyCallback()');
28
- agcaDebug(JSON.stringify(data));
29
- if(data.success == 0){
30
- agcaInfoMessage("Error",data.data);
31
  }else{
32
  if(data.data.length < 100){
33
  template_selected = data.data;
34
  var key = agcaTemplatesSessionGetLicenseKey(template_selected);
35
- agcaProgress('Loading theme... Please wait...');
36
  agca_getTemplate(template_selected,key);
37
  }else{
38
  agcaDebug("Uknown theme name" + data.data);
39
  }
40
-
41
- }
42
  }
43
 
44
  function agca_getTemplatesCallback(data){
45
- agcaDebug('FN:agca_getTemplatesCallback()');
46
  if(data.data == "CDbException"){
47
  data.data = "Service is temporary to busy. Please reload the page or try again later.";
48
  agcaDebugObj(data);
49
  }else if(data.data == "PHP Error"){
50
  data.data = "Error occurred on the server.";
51
  agcaDebugObj(data);
52
- }
53
- jQuery('#agca_templates').html(data.data);
54
- jQuery('#advanced_template_options').show();
55
  jQuery("#agca_installed_templates .template img").each(agcaApplyTooltip);
56
  jQuery("#agca_loaded_templates .template img").each(agcaApplyTooltip);
57
  jQuery('#advanced_template_options a').each(agcaApplyTooltip);
58
- }
59
  function agca_client_init(){
60
  agcaDebug('FN:agca_client_init()');
61
  agca_getLocalTemplates();
62
  checkIfTemplatesAreLoaded(1);
63
- jQuery('#agca_templates').html('<p class="initialLoader" style="font-size:18px;color:gray;font-style:italic">Loading themes...</p>');
64
  }
65
 
66
- function agca_setupXHR(){
67
  agcaDebug('FN:agca_setupXHR()');
68
- if(xhr != null) return false;
69
  xhr = new easyXDM.Rpc({
70
- remote:templates_ep
71
- //onReady: function () { alert('ready'); }
72
  }, {
73
  remote: {
74
- request: {
75
  }
76
  },
77
- handle: function(data, send){
78
- if(data.success){
79
  var callbackFname = data.url.split('callback=')[1];
80
  var fn = window[callbackFname];
81
  if(fn != undefined){
82
  fn(data);
83
- }
84
  }else{ console.log('errr');
85
- console.log(data.url);
86
- var url = data.url;
87
  if(url !== undefined && url != ""){
88
  var cb = url.split('callback=')[1];
89
  if(cb != ""){
90
  var fn = window[cb];
91
  if(fn != undefined){
92
  fn(data);
93
- }
94
  }
95
  }else{
96
  printInitialAGCAError("Please update your browser in order to view AG Custom Admin themes.");
97
  }
98
- }
99
- }
100
  });
101
  }
102
 
103
  function agca_getTemplates(){
104
  agcaDebug('FN:agca_getTemplates()');
105
  //agca_uploadRemoteImage('http://www.neowing.co.jp/idol_site2/image/FDGD-21/fdgd-21-top.jpg');
106
- agca_setupXHR();
107
- if(typeof agca_active_template_version === 'undefined'){
108
- agca_active_template_version = "";
109
- }
110
-
111
  xhr.request({
112
- url: templates_ep + "service/client" + "&callback=agca_getTemplatesCallback",
113
- method: "POST",
114
- callBack: agca_getTemplatesCallback,
115
- data: {isPost:true, wpv:wpversion, agcav:agca_version,selected:template_selected,installed:agca_installed_templates,template_version:agca_active_template_version}
116
- });
117
  }
118
 
119
  function agca_getConfiguration(){
120
  agcaDebug('FN:agca_getConfiguration()');
121
  /*xhr.request({
122
- url: templates_ep + "/configuration" + "?callback=agca_getConfigurationCallback",
123
- method: "POST",
124
- callBack: agca_getConfigurationCallback,
125
- data: {isPost:true}
126
- });*/
127
- jQuery.getJSON(templates_ep + "?callback=?",
128
- function(data){
129
- console.log("EP:"+data.ep);
130
- templates_ep = data.ep;
131
- if(data.error !=""){
132
- printInitialAGCAError(data.error);
133
- }else{
134
- agca_getTemplates();
135
- }
136
  }
137
- ).error(function(jqXHR, textStatus, errorThrown) {
 
138
  agca_error({url:templates_ep,data:textStatus + " " + jqXHR.responseText});
139
  /*console.log("error " + textStatus);
140
- console.log("incoming Text " + jqXHR.responseText);*/
141
  });
142
  }
143
 
@@ -148,36 +148,36 @@ function printInitialAGCAError(err){
148
  }
149
 
150
  function agca_getTemplate(template, key){
151
- agcaDebug('FN:agca_getTemplate()');
152
- template_name = template;
153
  if(!agcaTemplatesSessionIsLicenseSet(template)){
154
  agcaTemplatesSessionAdd(template, key);
155
- }
156
  xhr.request({
157
- url: templates_ep + "service/gettemplate"+"&tmpl="+template+"&key="+key+"&callback=agca_getTemplateCallback",
158
- method: "POST",
159
- callBack: agca_getTemplateCallback,
160
- data: {isPost:true, wpv:wpversion, agcav:agca_version}
161
- });
162
  }
163
 
164
  function agca_getTemplateByLicenseKey(key){
165
- agcaDebug('FN:agca_getTemplateByLicenseKey('+key+')');
166
  //template_name = template;
167
  xhr.request({
168
- url: templates_ep + "service/gettemplatebylk"+"&tmpl=&key="+key+"&callback=agca_getTemplateByLicenseKeyCallback",
169
- method: "POST",
170
- callBack: agca_getTemplateByLicenseKeyCallback,
171
- data: {isPost:true, wpv:wpversion, agcav:agca_version}
172
- });
173
  }
174
 
175
  function agca_loadTemplateSettingsInitial(template){
176
- agcaDebug('FN:agca_loadTemplateSettingsInitial()');
177
  agca_loadTemplateSettingsCore(template, true);
178
  }
179
 
180
- function agca_loadTemplateSettings(template){
181
  agcaDebug('FN:agca_loadTemplateSettings()');
182
  agca_loadTemplateSettingsCore(template, false);
183
  }
@@ -186,46 +186,46 @@ function agca_loadTemplateSettingsCore(template, isInitial){
186
  agcaDebug('FN:agca_loadTemplateSettingsCore()');
187
  template_name = template;
188
  template_selected = template;
189
-
190
  var licenseKey = "";
191
  if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]['license'] != null){
192
  licenseKey = agcaTemplatesSession[template]['license'];
193
  }
194
-
195
  var calb = agca_getTemplateSettingsCallback;
196
  var calbName = "agca_getTemplateSettingsCallback";
197
-
198
  if(isInitial){
199
  agcaProgress("Loading theme settings...");
200
  calb = agca_getTemplateSettingsInitialCallback;
201
  calbName = "agca_getTemplateSettingsInitialCallback";
202
  }
203
  xhr.request({
204
- url: templates_ep + "service/gettemplatesettings"+"&tmpl="+template+"&key="+licenseKey+"&callback="+calbName,
205
- method: "POST",
206
- callBack: calb,
207
- data: {isPost:true, wpv:wpversion, agcav:agca_version}
208
- });
209
- //alert('saving template settings for template:' + template_name);
210
  }
211
 
212
- function agca_getTemplateSettingsInitialCallback(data){
213
  agcaDebug('FN:agca_getTemplateSettingsInitialCallback()');
214
- agcaDebug(JSON.stringify(data));
215
  if(data.success == 0){
216
  agcaInfoMessage("Error",data.data);
217
  //TODO - what if template is loaded, but settings are not?
218
  console.log('ERR:theme settings are not loaded');
219
- }else{
220
  var settings = "";
221
  var filteredSettings = {};
222
  try{
223
  settings = JSON.parse(data.data);
224
- if(settings.length == 0){
225
- }else{
226
  for(var ind in settings){
227
- var type = settings[ind].type;
228
- var text = "";
229
  var defaultValue = "";
230
  var newItem = {};
231
  newItem.code = settings[ind].name;
@@ -234,31 +234,31 @@ function agca_getTemplateSettingsInitialCallback(data){
234
  newItem.default_value = settings[ind].default_value;
235
  filteredSettings[ind] = newItem;
236
  }
237
- agcaDebug("Selected theme:" + template_selected);
238
- console.log(filteredSettings);
239
-
240
  }
241
  }catch(e){
242
  console.log('Error while loading settings');
243
  console.log(e);
244
- }
245
  agca_saveTemplateSettingsInitial(template_selected, filteredSettings);
246
  }
247
  }
248
  /*template settings - load them to UI popup window*/
249
  function agca_getTemplateSettingsCallback(data){
250
- agcaDebug('FN:agca_getTemplateSettingsCallback()');
251
  //console.log(data.data);
252
-
253
- if(data.success == 0){
254
  agcaTemplatesSessionRemove(template_selected);
255
  //alert(data.data);
256
  jQuery('#agca_template_settings .agca_loader').html(data.data);
257
- }else{
258
-
259
  var settings = "";
260
  try{
261
- if(data.data.substring(0, "Exception:".length) === "Exception:"){
262
  var errr= data.data.substr(10);
263
  jQuery('#agca_template_settings .agca_loader').html(errr);
264
  return false;
@@ -269,34 +269,34 @@ function agca_getTemplateSettingsCallback(data){
269
  }else{
270
  jQuery('#agca_template_settings .agca_loader').hide();
271
  jQuery('#agca_save_template_settings').show();
272
-
273
  var currentSettings = (agca_template_settings != null && agca_template_settings != undefined)?agca_template_settings:{};
274
-
275
  //TODO: Change to use object name code object[code], instead of number object[i]
276
  for(var ind in settings){
277
- var type = settings[ind].type;
278
  var text = "";
279
  //console.log(settings[ind]);
280
- var currentValue = "";
281
-
282
  //get previously saved value
283
  for(var ind2 in currentSettings){
284
  if(currentSettings[ind2]!= null && currentSettings[ind2].code == settings[ind].name){
285
  currentValue = currentSettings[ind2].value;
286
  }
287
  }
288
-
289
  //if current value is still not defined, use default value
290
  if(currentValue == ""){
291
  currentValue = settings[ind].default_value;
292
  }
293
  /*text*/
294
  if(type==1){
295
- text = "<p>"+settings[ind].title+"</p><input type=\"text\" name=\"agcats_"+settings[ind].name+"\" value=\""+currentValue+"\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" class=\"setting\" stype=\"1\" /></br>";
296
  }else if(type==2){
297
- text = "<p>"+settings[ind].title+"</p><textarea name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"2\" >"+currentValue+"</textarea></br>";
298
  }else if(type==3){
299
- text = "<p>"+settings[ind].title+"</p><select name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"3\" >";
300
  var options = settings[ind].default_value.split(',');
301
  for(var indopt in options){
302
  var sel = "";
@@ -304,19 +304,19 @@ function agca_getTemplateSettingsCallback(data){
304
  sel = " selected=\"selected\" ";
305
  }
306
  text+="<option value="+options[indopt]+" "+sel+">"+options[indopt]+"</option>";
307
- }
308
  text+="</select>";
309
  }else if(type==4){
310
- text = "<p>"+settings[ind].title+"</p><div class=\"agca_form_0100_div\"><input value=\""+currentValue+"\" type=\"text\" name=\"agcats_"+settings[ind].name+"\" class=\"setting agca_form_0100\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"4\" /><input type=\"button\" name=\"agca_form_decr\" class=\"agca_form_decr\" value=\"-\"/><input type=\"button\" name=\"agca_form_incr\" class=\"agca_form_incr\" value=\"+\"/>&nbsp;(0-100)</div></br>";
311
- }else if(type==6){
312
  if(currentValue == true){
313
  currentValue =" checked=\"checked\" ";
314
  }else{
315
  currentValue="";
316
  }
317
- text = "<p>"+settings[ind].title+"</p><input type=\"checkbox\" name=\"agcats_"+settings[ind].name+"\" class=\"setting\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" stype=\"6\" "+currentValue+" /></br>";
318
  }else if(type==7){
319
- text = "<p>"+settings[ind].title+"</p><div name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"7\" style=\"padding-left: 10px;color:white;\">";
320
  var options = settings[ind].default_value.split(',');
321
  for(var indopt in options){
322
  var sel = "";
@@ -324,11 +324,11 @@ function agca_getTemplateSettingsCallback(data){
324
  sel = " checked ";
325
  }
326
  text+="<input name=\"agcats_"+settings[ind].name+"_val\" style=\"margin-right:6px;\" type=\"radio\" value="+options[indopt]+" "+sel+" name=\"sd\"/>"+options[indopt]+"</br>";
327
- }
328
  text+="</div>";
329
  }
330
  jQuery('#agca_template_settings').append(text);
331
-
332
  //TODO: do similar to options above, clean a code up a litle bit, add them dinamicaly all attributes instead of inline adding
333
  jQuery('.agca_form_0100_div .agca_form_decr').click(function(){
334
  var val =jQuery(this).parent().find('.agca_form_0100').val();
@@ -349,74 +349,74 @@ function agca_getTemplateSettingsCallback(data){
349
  jQuery(this).parent().find('.agca_form_0100').val(val);
350
  });
351
  jQuery('.agca_form_0100').keyup(function(){
352
-
353
  var val =jQuery(this).val();
354
  val = parseInt(val.replace(/\D/g,''));//leave only numbers
355
  if(val < 0 || isNaN(val))val =0;
356
  if(val > 100)val=100;
357
-
358
  jQuery(this).val(val);
359
-
360
  });
361
- }
362
  }
363
  }catch(e){
364
  console.log(e);
365
- }
366
  }
367
  //alert('callb');
368
  }
369
 
370
- function agca_saveTemplateSettingsInitial(template, settings){
371
  agcaDebug('FN:agca_saveTemplateSettingsInitial()');
372
- var originalText = jQuery("#templates_data").val();
373
  jQuery("#templates_data").val(originalText+"|||"+JSON.stringify(settings));
374
- agca_removeTemplateImages(template, agca_startUploadingRemoteImages);
375
  }
376
 
377
  function agca_saveTemplateSettingsFromForm(template){
378
  agcaDebug('FN:agca_saveTemplateSettingsFromForm()');
379
  template_name = template;
380
-
381
  //get settings from the form
382
  var settings = {};
383
-
384
  jQuery('#agca_template_settings .setting').each(function(ind){
385
  var setting_typ = jQuery(this).attr('stype');
386
  var setting_val = jQuery(this).val();
387
  var setting_cod = jQuery(this).attr('code');
388
  var setting_def = jQuery(this).attr('default_value');
389
-
390
  if(jQuery(this).attr('type')=="checkbox"){
391
  setting_val = jQuery(this).is(':checked');
392
  }
393
-
394
  //radio
395
- if(setting_typ == "7"){
396
- setting_val = jQuery('input[name="agcats_'+setting_cod+'_val"]:checked').val();
397
  }
398
-
399
  settings[ind] = {
400
  type: setting_typ,
401
- value: setting_val,
402
  code: setting_cod,
403
  default_value: setting_def
404
  };
405
-
406
  });
407
-
408
  jQuery('#agca_template_settings').html("<p>Applying theme settings...</p>");
409
- agca_saveTemplateSettingsCore(template, settings, function(data){
410
- window.location = 'tools.php?page=ag-custom-admin/plugin.php';
411
  });
412
  }
413
 
414
 
415
  function agca_saveTemplateSettingsCore(template, settings, callback){
416
  agcaDebug('FN:agca_saveTemplateSettingsCore()');
417
- var url = window.location;
418
  agca_POST(url,{"_agca_template_settings": JSON.stringify(settings),"_agca_current_template":template},
419
- callback,
420
  function(){
421
  console.log('AGCA Error: agca_saveTemplateSettingsCore()');
422
  }
@@ -424,51 +424,51 @@ function agca_saveTemplateSettingsCore(template, settings, callback){
424
  }
425
 
426
  /*function agca_saveTemplateSettingsCore(template, settings){
427
- var settings = {};
428
- var url = window.location;
429
- jQuery.post(url,{"_agca_template_settings":settings,"_agca_current_template":template},
430
- function(data){
431
- window.location = 'tools.php?page=ag-custom-admin/plugin.php';
432
- //console.log('reload');
433
- })
434
- .fail(
435
- function(){
436
- console.log('AGCA Error: agca_saveTemplateSettingsCore()');
437
- });
438
- }*/
439
 
440
  function agca_activateTemplate(template){
441
  /*if(template_selected == ""){
442
- alert('There are no active templates to deactivate.');
443
- return false;
444
- };*/
445
  if(template == ""){
446
  agcaProgress('Deactivating theme... Please wait...');
447
  }else{
448
  agcaProgress('Activating theme... Please wait...');
449
  }
450
-
451
  agcaDebug('FN:agca_activateTemplate('+template+')');
452
  jQuery('input[name=agca_colorizer_turnonoff]').val("off");
453
-
454
  //ajax submit form
455
  var frm = jQuery('#agca_form');
456
  var data = frm.serialize();
457
  jQuery.ajax({
458
- type: frm.attr('method'),
459
- url: frm.attr('action'),
460
- data: data,
461
- success: function (data) {
462
- var url = window.location;
463
- agca_POST(url, {"_agca_activate_template":template},
464
- function(data){
465
- window.location = 'tools.php?page=ag-custom-admin/plugin.php';
466
- },
467
- function(){
468
- console.log('AGCA Error: agca_activateTemplate()');
469
- });
470
- }
471
- });
472
  }
473
 
474
  function agca_removeAllTemplates(){
@@ -478,10 +478,10 @@ function agca_removeAllTemplates(){
478
 
479
  function agca_removeAllTemplatesConfirmed(){
480
  agcaDebug('FN:agca_removeAllTemplatesConfirmed()');
481
- agcaProgress('Removing all themes... Please wait...');
482
  window.setTimeout(function(){
483
- window.location = 'tools.php?page=ag-custom-admin/plugin.php&agca_action=remove_templates';
484
- },2000);
485
  }
486
 
487
  function handleLocalyStoredImages(){
@@ -489,20 +489,20 @@ function handleLocalyStoredImages(){
489
  agcaDebug(jQuery("#templates_data").val());
490
  var originalText = jQuery("#templates_data").val();
491
  var serializedImages = "";
492
- for(var tag in agca_local_images){
493
  if(tag != ""){
494
  if(serializedImages !=""){
495
  serializedImages+=",";
496
  }
497
  serializedImages+=agca_local_images[tag];
498
- originalText = originalText.replace(new RegExp(tag, 'g'), agca_local_images[tag]);
499
- }
500
- }
501
  jQuery("#templates_data").val(originalText+"|||"+serializedImages);
502
  //console.log(jQuery("#templates_data").val());
503
-
504
  //SAVE FINALY
505
- jQuery("#agca_templates_form").submit();
506
  }
507
 
508
  function agca_updateInstallProgress(){
@@ -510,52 +510,52 @@ function agca_updateInstallProgress(){
510
  agca_local_images_count++;
511
  var current = agca_remote_images_count - agca_local_images_count;
512
  var proc= (agca_local_images_count / (parseInt(agca_remote_images_count)-1)).toFixed(2) * 100;
513
-
514
  agcaProgress('Installing ('+proc+'%) ...');
515
  }
516
  function agca_removeTemplateImages(template_name, callBack){
517
  agcaDebug('FN:agca_removeTemplateImages()');
518
  var url = window.location;
519
  agca_POST(url,{"_agca_remove_template_images":template_name},
520
- function(data){
521
- console.log(data);
522
  if(callBack != null){
523
  callBack();
524
  }
525
- },
526
- function(e){
527
- console.log('AGCA Error: agca_removeTemplateImages()');
528
- console.log(e);
529
- if(callBack != null){
530
- callBack();
531
- }
532
- });
533
  }
534
- function agca_startUploadingRemoteImages(){
535
  agcaDebug('FN:agca_startUploadingRemoteImages()');
536
-
537
  //agcaDebug('templates data');
538
  //agcaDebug(jQuery("#templates_data").val());
539
  //upload remote images on callback
540
  if(typeof agca_remote_images != 'undefined'){
541
  agca_uploadRemoteImages();
542
- }else{
543
  jQuery("#templates_data").val(jQuery("#templates_data").val()+"|||");
544
-
545
  //SAVE FINALY PAYED
546
- jQuery("#agca_templates_form").submit();
547
- }
548
  }
549
 
550
- function agca_uploadRemoteImages(){
551
- agcaDebug('FN:agca_uploadRemoteImages()');
552
  var found = false;
553
  for(var tag in agca_remote_images){
554
  found = true;
555
  agca_updateInstallProgress();
556
- agca_uploadRemoteImage(agca_remote_images[tag], tag);
557
  break;
558
- }
559
  if(!found){
560
  //jQuery('.agca_content #activating').text('Installation successful. Reloading...');
561
  agcaProgress('Installation successful. Reloading...');
@@ -565,42 +565,42 @@ function agca_uploadRemoteImages(){
565
 
566
  function agca_uploadRemoteImage(remoteUrl, tag){
567
  agcaDebug('FN:agca_uploadRemoteImage('+remoteUrl+', '+tag+')');
568
- var url = window.location;
569
  agca_POST(url,{"_agca_upload_image":remoteUrl},
570
- function(data){
571
- console.log(data);
572
- agca_local_images[tag] = data;
573
- delete agca_remote_images[tag];
574
- agca_uploadRemoteImages();
575
- //window.location = 'tools.php?page=ag-custom-admin/plugin.php';
576
- },
577
- function(){
578
- console.log('AGCA Error: agca_activateTemplate()');
579
- });
580
  }
581
 
582
  function agca_getLocalTemplates(){
583
  agcaDebug("FN:agca_getLocalTemplates()");
584
  var url = window.location;
585
  agca_POST(url,{"_agca_get_templates":true},
586
- function(data){
587
- try{
588
- templates_installed = JSON.parse(data);
589
- }catch(e){
590
- templates_installed = [];
591
- };
592
- //agca_getTemplates();
593
- agca_getConfiguration();
594
- },
595
- function(){
596
- console.log('AGCA Error: agca_getLocalTemplates()');
597
- });
598
- }
599
  function agca_error(data){
600
  agcaDebug("FN:agca_error()");
601
  clearTimeout(agcaLoadingTimeOut);
602
  if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
603
- jQuery('#agca_templates p:first').text('Unable to load themes. Please submit this error to AGCA support. Thank you!');
604
  }
605
  alert('AG CUSTOM ADMIN TEMPLATE - ERROR\n\nError occured while loading configuration:\n'+data.url+'\n\n'+data.data);
606
  }
@@ -610,37 +610,37 @@ function checkIfTemplatesAreLoaded(pass){
610
  agcaDebug('FN:checkIfTemplatesAreLoaded('+pass+')');
611
  if(pass == 1){
612
  agcaLoadingTimeOut = window.setTimeout(function(){
613
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
614
- jQuery('#agca_templates p:first').text('Loading, please wait...');
615
- checkIfTemplatesAreLoaded(2);
616
- }
617
  },6000);
618
-
619
  }else if(pass == 2){
620
  agcaLoadingTimeOut = window.setTimeout(function(){
621
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
622
- jQuery('#agca_templates p:first').text('Ready in a few moments...');
623
- checkIfTemplatesAreLoaded(3);
624
- }
625
  },6000);
626
-
627
  }
628
  else if(pass == 3){
629
  agcaLoadingTimeOut = window.setTimeout(function(){
630
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
631
- jQuery('#agca_templates p:first').text('This takes a bit longer than usual, please wait...');
632
- checkIfTemplatesAreLoaded(4);
633
- }
634
  },7000);
635
- }
636
  else if(pass == 4){
637
  agcaLoadingTimeOut = window.setTimeout(function(){
638
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
639
- jQuery('#agca_templates p:first').html('Sorry, unable to load themes right now. Please try again later.');
640
- agcaDebug('ERR:Unable to load themes');
641
- }
642
  },10000);
643
- }
644
  }
645
 
646
  function agcaTemplatesSessionIsLicenseSet(template){
@@ -662,8 +662,9 @@ function agcaTemplatesSessionGetLicenseKey(template){
662
  function agcaTemplatesSessionAdd(template, license, callback){
663
  agcaDebug("FN:agcaTemplatesSessionAdd(" + template + ", " + license + ", callback)");
664
  if(callback == null){
665
- callback = function(){};
666
- }
 
667
  agcaTemplatesSession[template] = {};
668
  agcaTemplatesSession[template]["license"] = license;
669
  agca_POST(window.location, {
@@ -677,7 +678,7 @@ function agcaTemplatesSessionRemove(template, callback){
677
  agcaDebug("FN:agcaTemplatesSessionRemove(" + template + ", callback)");
678
  if(callback == null){
679
  callback = function(){};
680
- }
681
  agcaTemplatesSession[template]["license"] = null;
682
  agca_POST(window.location,{
683
  "_agca_templates_session_remove_license" : "true",
@@ -704,27 +705,27 @@ function agca_POST(url, data, onSuccess, onError){
704
 
705
 
706
  /*FAQ: Invalid template license key: reopen browser and add key again,
707
- Wrong or expired license key. You can still use your template, but updates are not available any more.(1): reopen broeser
708
- */
709
-
710
- /*countdown*/
711
  function agcaCountDownTimer(now, expire, id)
712
  {
713
- var _second = 1;
714
- var _minute = _second * 60;
715
- var _hour = _minute * 60;
716
- var _day = _hour * 24;
717
- var _year = _day * 365;
718
-
719
- var nowParts = now.split('-');
720
- var expireParts = expire.split('-');
721
- var timer;
722
- var diff = expire - now;
723
-
724
- function showRemaining(df) {
725
  diff = diff-1;
726
  //console.log(diff);
727
-
728
  var days = Math.floor((diff % _year) / _day);
729
  var hours = Math.floor((diff % _day) / _hour);
730
  var minutes = Math.floor((diff % _hour) / _minute);
@@ -739,5 +740,5 @@ var diff = expire - now;
739
  }
740
  timer = setInterval(function(){
741
  showRemaining(diff);
742
- }, 1000);
743
  }
1
  var isAGCAPage = true;
2
+ var template_name = "";
3
  var templates_installed = [];
4
  var xhr =null;
5
  var agcaLoadingTimeOut = null;
6
 
7
+ function agca_getTemplateCallback(data){
8
  agcaDebug('FN:agca_getTemplateCallback()');
9
+ agcaDebug(JSON.stringify(data));
10
  if(data.success == 0){
11
  //alert(data.data);
12
  agcaInfoMessage("Error",data.data);
14
  }else{
15
  jQuery("#templates_name").val(template_name);
16
  var parts = data.data.split("||||");
17
+ jQuery("#templates_data").val(parts[1]);
18
  //console.log(jQuery("#templates_data").val());
19
+ jQuery("body").append(parts[0]);
20
+
21
  //load settings
22
+ agca_loadTemplateSettingsInitial(template_name);
23
+ }
24
+ }
25
 
26
+ function agca_getTemplateByLicenseKeyCallback(data){
27
  agcaDebug('FN:agca_getTemplateByLicenseKeyCallback()');
28
+ agcaDebug(JSON.stringify(data));
29
+ if(data.success == 0){
30
+ agcaInfoMessage("Error",data.data);
31
  }else{
32
  if(data.data.length < 100){
33
  template_selected = data.data;
34
  var key = agcaTemplatesSessionGetLicenseKey(template_selected);
35
+ agcaProgress('Loading theme... Please wait...');
36
  agca_getTemplate(template_selected,key);
37
  }else{
38
  agcaDebug("Uknown theme name" + data.data);
39
  }
40
+
41
+ }
42
  }
43
 
44
  function agca_getTemplatesCallback(data){
45
+ agcaDebug('FN:agca_getTemplatesCallback()');
46
  if(data.data == "CDbException"){
47
  data.data = "Service is temporary to busy. Please reload the page or try again later.";
48
  agcaDebugObj(data);
49
  }else if(data.data == "PHP Error"){
50
  data.data = "Error occurred on the server.";
51
  agcaDebugObj(data);
52
+ }
53
+ jQuery('#agca_templates').html(data.data);
54
+ jQuery('#advanced_template_options').show();
55
  jQuery("#agca_installed_templates .template img").each(agcaApplyTooltip);
56
  jQuery("#agca_loaded_templates .template img").each(agcaApplyTooltip);
57
  jQuery('#advanced_template_options a').each(agcaApplyTooltip);
58
+ }
59
  function agca_client_init(){
60
  agcaDebug('FN:agca_client_init()');
61
  agca_getLocalTemplates();
62
  checkIfTemplatesAreLoaded(1);
63
+ jQuery('#agca_templates').html('<p class="initialLoader" style="font-size:18px;color:gray;font-style:italic">Loading themes...</p>');
64
  }
65
 
66
+ function agca_setupXHR(){
67
  agcaDebug('FN:agca_setupXHR()');
68
+ if(xhr != null) return false;
69
  xhr = new easyXDM.Rpc({
70
+ remote:templates_ep
71
+ //onReady: function () { alert('ready'); }
72
  }, {
73
  remote: {
74
+ request: {
75
  }
76
  },
77
+ handle: function(data, send){
78
+ if(data.success){
79
  var callbackFname = data.url.split('callback=')[1];
80
  var fn = window[callbackFname];
81
  if(fn != undefined){
82
  fn(data);
83
+ }
84
  }else{ console.log('errr');
85
+ console.log(data.url);
86
+ var url = data.url;
87
  if(url !== undefined && url != ""){
88
  var cb = url.split('callback=')[1];
89
  if(cb != ""){
90
  var fn = window[cb];
91
  if(fn != undefined){
92
  fn(data);
93
+ }
94
  }
95
  }else{
96
  printInitialAGCAError("Please update your browser in order to view AG Custom Admin themes.");
97
  }
98
+ }
99
+ }
100
  });
101
  }
102
 
103
  function agca_getTemplates(){
104
  agcaDebug('FN:agca_getTemplates()');
105
  //agca_uploadRemoteImage('http://www.neowing.co.jp/idol_site2/image/FDGD-21/fdgd-21-top.jpg');
106
+ agca_setupXHR();
107
+ if(typeof agca_active_template_version === 'undefined'){
108
+ agca_active_template_version = "";
109
+ }
110
+
111
  xhr.request({
112
+ url: templates_ep + "service/client" + "&callback=agca_getTemplatesCallback",
113
+ method: "POST",
114
+ callBack: agca_getTemplatesCallback,
115
+ data: {isPost:true, wpv:wpversion, agcav:agca_version,selected:template_selected,installed:agca_installed_templates,template_version:agca_active_template_version}
116
+ });
117
  }
118
 
119
  function agca_getConfiguration(){
120
  agcaDebug('FN:agca_getConfiguration()');
121
  /*xhr.request({
122
+ url: templates_ep + "/configuration" + "?callback=agca_getConfigurationCallback",
123
+ method: "POST",
124
+ callBack: agca_getConfigurationCallback,
125
+ data: {isPost:true}
126
+ });*/
127
+ jQuery.getJSON(templates_ep + "?callback=?",
128
+ function(data){
129
+ console.log("EP:"+data.ep);
130
+ templates_ep = data.ep;
131
+ if(data.error !=""){
132
+ printInitialAGCAError(data.error);
133
+ }else{
134
+ agca_getTemplates();
 
135
  }
136
+ }
137
+ ).error(function(jqXHR, textStatus, errorThrown) {
138
  agca_error({url:templates_ep,data:textStatus + " " + jqXHR.responseText});
139
  /*console.log("error " + textStatus);
140
+ console.log("incoming Text " + jqXHR.responseText);*/
141
  });
142
  }
143
 
148
  }
149
 
150
  function agca_getTemplate(template, key){
151
+ agcaDebug('FN:agca_getTemplate()');
152
+ template_name = template;
153
  if(!agcaTemplatesSessionIsLicenseSet(template)){
154
  agcaTemplatesSessionAdd(template, key);
155
+ }
156
  xhr.request({
157
+ url: templates_ep + "service/gettemplate"+"&tmpl="+template+"&key="+key+"&callback=agca_getTemplateCallback",
158
+ method: "POST",
159
+ callBack: agca_getTemplateCallback,
160
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
161
+ });
162
  }
163
 
164
  function agca_getTemplateByLicenseKey(key){
165
+ agcaDebug('FN:agca_getTemplateByLicenseKey('+key+')');
166
  //template_name = template;
167
  xhr.request({
168
+ url: templates_ep + "service/gettemplatebylk"+"&tmpl=&key="+key+"&callback=agca_getTemplateByLicenseKeyCallback",
169
+ method: "POST",
170
+ callBack: agca_getTemplateByLicenseKeyCallback,
171
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
172
+ });
173
  }
174
 
175
  function agca_loadTemplateSettingsInitial(template){
176
+ agcaDebug('FN:agca_loadTemplateSettingsInitial()');
177
  agca_loadTemplateSettingsCore(template, true);
178
  }
179
 
180
+ function agca_loadTemplateSettings(template){
181
  agcaDebug('FN:agca_loadTemplateSettings()');
182
  agca_loadTemplateSettingsCore(template, false);
183
  }
186
  agcaDebug('FN:agca_loadTemplateSettingsCore()');
187
  template_name = template;
188
  template_selected = template;
189
+
190
  var licenseKey = "";
191
  if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]['license'] != null){
192
  licenseKey = agcaTemplatesSession[template]['license'];
193
  }
194
+
195
  var calb = agca_getTemplateSettingsCallback;
196
  var calbName = "agca_getTemplateSettingsCallback";
197
+
198
  if(isInitial){
199
  agcaProgress("Loading theme settings...");
200
  calb = agca_getTemplateSettingsInitialCallback;
201
  calbName = "agca_getTemplateSettingsInitialCallback";
202
  }
203
  xhr.request({
204
+ url: templates_ep + "service/gettemplatesettings"+"&tmpl="+template+"&key="+licenseKey+"&callback="+calbName,
205
+ method: "POST",
206
+ callBack: calb,
207
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
208
+ });
209
+ //alert('saving template settings for template:' + template_name);
210
  }
211
 
212
+ function agca_getTemplateSettingsInitialCallback(data){
213
  agcaDebug('FN:agca_getTemplateSettingsInitialCallback()');
214
+ agcaDebug(JSON.stringify(data));
215
  if(data.success == 0){
216
  agcaInfoMessage("Error",data.data);
217
  //TODO - what if template is loaded, but settings are not?
218
  console.log('ERR:theme settings are not loaded');
219
+ }else{
220
  var settings = "";
221
  var filteredSettings = {};
222
  try{
223
  settings = JSON.parse(data.data);
224
+ if(settings.length == 0){
225
+ }else{
226
  for(var ind in settings){
227
+ var type = settings[ind].type;
228
+ var text = "";
229
  var defaultValue = "";
230
  var newItem = {};
231
  newItem.code = settings[ind].name;
234
  newItem.default_value = settings[ind].default_value;
235
  filteredSettings[ind] = newItem;
236
  }
237
+ agcaDebug("Selected theme:" + template_selected);
238
+ console.log(filteredSettings);
239
+
240
  }
241
  }catch(e){
242
  console.log('Error while loading settings');
243
  console.log(e);
244
+ }
245
  agca_saveTemplateSettingsInitial(template_selected, filteredSettings);
246
  }
247
  }
248
  /*template settings - load them to UI popup window*/
249
  function agca_getTemplateSettingsCallback(data){
250
+ agcaDebug('FN:agca_getTemplateSettingsCallback()');
251
  //console.log(data.data);
252
+
253
+ if(data.success == 0){
254
  agcaTemplatesSessionRemove(template_selected);
255
  //alert(data.data);
256
  jQuery('#agca_template_settings .agca_loader').html(data.data);
257
+ }else{
258
+
259
  var settings = "";
260
  try{
261
+ if(data.data.substring(0, "Exception:".length) === "Exception:"){
262
  var errr= data.data.substr(10);
263
  jQuery('#agca_template_settings .agca_loader').html(errr);
264
  return false;
269
  }else{
270
  jQuery('#agca_template_settings .agca_loader').hide();
271
  jQuery('#agca_save_template_settings').show();
272
+
273
  var currentSettings = (agca_template_settings != null && agca_template_settings != undefined)?agca_template_settings:{};
274
+
275
  //TODO: Change to use object name code object[code], instead of number object[i]
276
  for(var ind in settings){
277
+ var type = settings[ind].type;
278
  var text = "";
279
  //console.log(settings[ind]);
280
+ var currentValue = "";
281
+
282
  //get previously saved value
283
  for(var ind2 in currentSettings){
284
  if(currentSettings[ind2]!= null && currentSettings[ind2].code == settings[ind].name){
285
  currentValue = currentSettings[ind2].value;
286
  }
287
  }
288
+
289
  //if current value is still not defined, use default value
290
  if(currentValue == ""){
291
  currentValue = settings[ind].default_value;
292
  }
293
  /*text*/
294
  if(type==1){
295
+ text = "<p>"+settings[ind].title+"</p><input type=\"text\" name=\"agcats_"+settings[ind].name+"\" value=\""+currentValue+"\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" class=\"setting\" stype=\"1\" /></br>";
296
  }else if(type==2){
297
+ text = "<p>"+settings[ind].title+"</p><textarea name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"2\" >"+currentValue+"</textarea></br>";
298
  }else if(type==3){
299
+ text = "<p>"+settings[ind].title+"</p><select name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"3\" >";
300
  var options = settings[ind].default_value.split(',');
301
  for(var indopt in options){
302
  var sel = "";
304
  sel = " selected=\"selected\" ";
305
  }
306
  text+="<option value="+options[indopt]+" "+sel+">"+options[indopt]+"</option>";
307
+ }
308
  text+="</select>";
309
  }else if(type==4){
310
+ text = "<p>"+settings[ind].title+"</p><div class=\"agca_form_0100_div\"><input value=\""+currentValue+"\" type=\"text\" name=\"agcats_"+settings[ind].name+"\" class=\"setting agca_form_0100\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"4\" /><input type=\"button\" name=\"agca_form_decr\" class=\"agca_form_decr\" value=\"-\"/><input type=\"button\" name=\"agca_form_incr\" class=\"agca_form_incr\" value=\"+\"/>&nbsp;(0-100)</div></br>";
311
+ }else if(type==6){
312
  if(currentValue == true){
313
  currentValue =" checked=\"checked\" ";
314
  }else{
315
  currentValue="";
316
  }
317
+ text = "<p>"+settings[ind].title+"</p><input type=\"checkbox\" name=\"agcats_"+settings[ind].name+"\" class=\"setting\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" stype=\"6\" "+currentValue+" /></br>";
318
  }else if(type==7){
319
+ text = "<p>"+settings[ind].title+"</p><div name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"7\" style=\"padding-left: 10px;color:white;\">";
320
  var options = settings[ind].default_value.split(',');
321
  for(var indopt in options){
322
  var sel = "";
324
  sel = " checked ";
325
  }
326
  text+="<input name=\"agcats_"+settings[ind].name+"_val\" style=\"margin-right:6px;\" type=\"radio\" value="+options[indopt]+" "+sel+" name=\"sd\"/>"+options[indopt]+"</br>";
327
+ }
328
  text+="</div>";
329
  }
330
  jQuery('#agca_template_settings').append(text);
331
+
332
  //TODO: do similar to options above, clean a code up a litle bit, add them dinamicaly all attributes instead of inline adding
333
  jQuery('.agca_form_0100_div .agca_form_decr').click(function(){
334
  var val =jQuery(this).parent().find('.agca_form_0100').val();
349
  jQuery(this).parent().find('.agca_form_0100').val(val);
350
  });
351
  jQuery('.agca_form_0100').keyup(function(){
352
+
353
  var val =jQuery(this).val();
354
  val = parseInt(val.replace(/\D/g,''));//leave only numbers
355
  if(val < 0 || isNaN(val))val =0;
356
  if(val > 100)val=100;
357
+
358
  jQuery(this).val(val);
359
+
360
  });
361
+ }
362
  }
363
  }catch(e){
364
  console.log(e);
365
+ }
366
  }
367
  //alert('callb');
368
  }
369
 
370
+ function agca_saveTemplateSettingsInitial(template, settings){
371
  agcaDebug('FN:agca_saveTemplateSettingsInitial()');
372
+ var originalText = jQuery("#templates_data").val();
373
  jQuery("#templates_data").val(originalText+"|||"+JSON.stringify(settings));
374
+ agca_removeTemplateImages(template, agca_startUploadingRemoteImages);
375
  }
376
 
377
  function agca_saveTemplateSettingsFromForm(template){
378
  agcaDebug('FN:agca_saveTemplateSettingsFromForm()');
379
  template_name = template;
380
+
381
  //get settings from the form
382
  var settings = {};
383
+
384
  jQuery('#agca_template_settings .setting').each(function(ind){
385
  var setting_typ = jQuery(this).attr('stype');
386
  var setting_val = jQuery(this).val();
387
  var setting_cod = jQuery(this).attr('code');
388
  var setting_def = jQuery(this).attr('default_value');
389
+
390
  if(jQuery(this).attr('type')=="checkbox"){
391
  setting_val = jQuery(this).is(':checked');
392
  }
393
+
394
  //radio
395
+ if(setting_typ == "7"){
396
+ setting_val = jQuery('input[name="agcats_'+setting_cod+'_val"]:checked').val();
397
  }
398
+
399
  settings[ind] = {
400
  type: setting_typ,
401
+ value: setting_val,
402
  code: setting_cod,
403
  default_value: setting_def
404
  };
405
+
406
  });
407
+
408
  jQuery('#agca_template_settings').html("<p>Applying theme settings...</p>");
409
+ agca_saveTemplateSettingsCore(template, settings, function(data){
410
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
411
  });
412
  }
413
 
414
 
415
  function agca_saveTemplateSettingsCore(template, settings, callback){
416
  agcaDebug('FN:agca_saveTemplateSettingsCore()');
417
+ var url = window.location;
418
  agca_POST(url,{"_agca_template_settings": JSON.stringify(settings),"_agca_current_template":template},
419
+ callback,
420
  function(){
421
  console.log('AGCA Error: agca_saveTemplateSettingsCore()');
422
  }
424
  }
425
 
426
  /*function agca_saveTemplateSettingsCore(template, settings){
427
+ var settings = {};
428
+ var url = window.location;
429
+ jQuery.post(url,{"_agca_template_settings":settings,"_agca_current_template":template},
430
+ function(data){
431
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
432
+ //console.log('reload');
433
+ })
434
+ .fail(
435
+ function(){
436
+ console.log('AGCA Error: agca_saveTemplateSettingsCore()');
437
+ });
438
+ }*/
439
 
440
  function agca_activateTemplate(template){
441
  /*if(template_selected == ""){
442
+ alert('There are no active templates to deactivate.');
443
+ return false;
444
+ };*/
445
  if(template == ""){
446
  agcaProgress('Deactivating theme... Please wait...');
447
  }else{
448
  agcaProgress('Activating theme... Please wait...');
449
  }
450
+
451
  agcaDebug('FN:agca_activateTemplate('+template+')');
452
  jQuery('input[name=agca_colorizer_turnonoff]').val("off");
453
+
454
  //ajax submit form
455
  var frm = jQuery('#agca_form');
456
  var data = frm.serialize();
457
  jQuery.ajax({
458
+ type: frm.attr('method'),
459
+ url: frm.attr('action'),
460
+ data: data,
461
+ success: function (data) {
462
+ var url = window.location;
463
+ agca_POST(url, {"_agca_activate_template":template},
464
+ function(data){
465
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
466
+ },
467
+ function(){
468
+ console.log('AGCA Error: agca_activateTemplate()');
469
+ });
470
+ }
471
+ });
472
  }
473
 
474
  function agca_removeAllTemplates(){
478
 
479
  function agca_removeAllTemplatesConfirmed(){
480
  agcaDebug('FN:agca_removeAllTemplatesConfirmed()');
481
+ agcaProgress('Removing all themes... Please wait...');
482
  window.setTimeout(function(){
483
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php&agca_action=remove_templates';
484
+ },2000);
485
  }
486
 
487
  function handleLocalyStoredImages(){
489
  agcaDebug(jQuery("#templates_data").val());
490
  var originalText = jQuery("#templates_data").val();
491
  var serializedImages = "";
492
+ for(var tag in agca_local_images){
493
  if(tag != ""){
494
  if(serializedImages !=""){
495
  serializedImages+=",";
496
  }
497
  serializedImages+=agca_local_images[tag];
498
+ originalText = originalText.replace(new RegExp(tag, 'g'), agca_local_images[tag]);
499
+ }
500
+ }
501
  jQuery("#templates_data").val(originalText+"|||"+serializedImages);
502
  //console.log(jQuery("#templates_data").val());
503
+
504
  //SAVE FINALY
505
+ jQuery("#agca_templates_form").submit();
506
  }
507
 
508
  function agca_updateInstallProgress(){
510
  agca_local_images_count++;
511
  var current = agca_remote_images_count - agca_local_images_count;
512
  var proc= (agca_local_images_count / (parseInt(agca_remote_images_count)-1)).toFixed(2) * 100;
513
+
514
  agcaProgress('Installing ('+proc+'%) ...');
515
  }
516
  function agca_removeTemplateImages(template_name, callBack){
517
  agcaDebug('FN:agca_removeTemplateImages()');
518
  var url = window.location;
519
  agca_POST(url,{"_agca_remove_template_images":template_name},
520
+ function(data){
521
+ console.log(data);
522
  if(callBack != null){
523
  callBack();
524
  }
525
+ },
526
+ function(e){
527
+ console.log('AGCA Error: agca_removeTemplateImages()');
528
+ console.log(e);
529
+ if(callBack != null){
530
+ callBack();
531
+ }
532
+ });
533
  }
534
+ function agca_startUploadingRemoteImages(){
535
  agcaDebug('FN:agca_startUploadingRemoteImages()');
536
+
537
  //agcaDebug('templates data');
538
  //agcaDebug(jQuery("#templates_data").val());
539
  //upload remote images on callback
540
  if(typeof agca_remote_images != 'undefined'){
541
  agca_uploadRemoteImages();
542
+ }else{
543
  jQuery("#templates_data").val(jQuery("#templates_data").val()+"|||");
544
+
545
  //SAVE FINALY PAYED
546
+ jQuery("#agca_templates_form").submit();
547
+ }
548
  }
549
 
550
+ function agca_uploadRemoteImages(){
551
+ agcaDebug('FN:agca_uploadRemoteImages()');
552
  var found = false;
553
  for(var tag in agca_remote_images){
554
  found = true;
555
  agca_updateInstallProgress();
556
+ agca_uploadRemoteImage(agca_remote_images[tag], tag);
557
  break;
558
+ }
559
  if(!found){
560
  //jQuery('.agca_content #activating').text('Installation successful. Reloading...');
561
  agcaProgress('Installation successful. Reloading...');
565
 
566
  function agca_uploadRemoteImage(remoteUrl, tag){
567
  agcaDebug('FN:agca_uploadRemoteImage('+remoteUrl+', '+tag+')');
568
+ var url = window.location;
569
  agca_POST(url,{"_agca_upload_image":remoteUrl},
570
+ function(data){
571
+ console.log(data);
572
+ agca_local_images[tag] = data;
573
+ delete agca_remote_images[tag];
574
+ agca_uploadRemoteImages();
575
+ //window.location = 'tools.php?page=ag-custom-admin/plugin.php';
576
+ },
577
+ function(){
578
+ console.log('AGCA Error: agca_activateTemplate()');
579
+ });
580
  }
581
 
582
  function agca_getLocalTemplates(){
583
  agcaDebug("FN:agca_getLocalTemplates()");
584
  var url = window.location;
585
  agca_POST(url,{"_agca_get_templates":true},
586
+ function(data){
587
+ try{
588
+ templates_installed = JSON.parse(data);
589
+ }catch(e){
590
+ templates_installed = [];
591
+ };
592
+ //agca_getTemplates();
593
+ agca_getConfiguration();
594
+ },
595
+ function(){
596
+ console.log('AGCA Error: agca_getLocalTemplates()');
597
+ });
598
+ }
599
  function agca_error(data){
600
  agcaDebug("FN:agca_error()");
601
  clearTimeout(agcaLoadingTimeOut);
602
  if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
603
+ jQuery('#agca_templates p:first').text('Unable to load themes. Please submit this error to AGCA support. Thank you!');
604
  }
605
  alert('AG CUSTOM ADMIN TEMPLATE - ERROR\n\nError occured while loading configuration:\n'+data.url+'\n\n'+data.data);
606
  }
610
  agcaDebug('FN:checkIfTemplatesAreLoaded('+pass+')');
611
  if(pass == 1){
612
  agcaLoadingTimeOut = window.setTimeout(function(){
613
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
614
+ jQuery('#agca_templates p:first').text('Loading, please wait...');
615
+ checkIfTemplatesAreLoaded(2);
616
+ }
617
  },6000);
618
+
619
  }else if(pass == 2){
620
  agcaLoadingTimeOut = window.setTimeout(function(){
621
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
622
+ jQuery('#agca_templates p:first').text('Ready in a few moments...');
623
+ checkIfTemplatesAreLoaded(3);
624
+ }
625
  },6000);
626
+
627
  }
628
  else if(pass == 3){
629
  agcaLoadingTimeOut = window.setTimeout(function(){
630
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
631
+ jQuery('#agca_templates p:first').text('This takes a bit longer than usual, please wait...');
632
+ checkIfTemplatesAreLoaded(4);
633
+ }
634
  },7000);
635
+ }
636
  else if(pass == 4){
637
  agcaLoadingTimeOut = window.setTimeout(function(){
638
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
639
+ jQuery('#agca_templates p:first').html('Sorry, unable to load themes right now. Please try again later.');
640
+ agcaDebug('ERR:Unable to load themes');
641
+ }
642
  },10000);
643
+ }
644
  }
645
 
646
  function agcaTemplatesSessionIsLicenseSet(template){
662
  function agcaTemplatesSessionAdd(template, license, callback){
663
  agcaDebug("FN:agcaTemplatesSessionAdd(" + template + ", " + license + ", callback)");
664
  if(callback == null){
665
+ callback = function(data){
666
+ };
667
+ }
668
  agcaTemplatesSession[template] = {};
669
  agcaTemplatesSession[template]["license"] = license;
670
  agca_POST(window.location, {
678
  agcaDebug("FN:agcaTemplatesSessionRemove(" + template + ", callback)");
679
  if(callback == null){
680
  callback = function(){};
681
+ }
682
  agcaTemplatesSession[template]["license"] = null;
683
  agca_POST(window.location,{
684
  "_agca_templates_session_remove_license" : "true",
705
 
706
 
707
  /*FAQ: Invalid template license key: reopen browser and add key again,
708
+ Wrong or expired license key. You can still use your template, but updates are not available any more.(1): reopen broeser
709
+ */
710
+
711
+ /*countdown*/
712
  function agcaCountDownTimer(now, expire, id)
713
  {
714
+ var _second = 1;
715
+ var _minute = _second * 60;
716
+ var _hour = _minute * 60;
717
+ var _day = _hour * 24;
718
+ var _year = _day * 365;
719
+
720
+ var nowParts = now.split('-');
721
+ var expireParts = expire.split('-');
722
+ var timer;
723
+ var diff = expire - now;
724
+
725
+ function showRemaining(df) {
726
  diff = diff-1;
727
  //console.log(diff);
728
+
729
  var days = Math.floor((diff % _year) / _day);
730
  var hours = Math.floor((diff % _day) / _hour);
731
  var minutes = Math.floor((diff % _hour) / _minute);
740
  }
741
  timer = setInterval(function(){
742
  showRemaining(diff);
743
+ }, 1000);
744
  }
style/ag_style.css CHANGED
@@ -10,373 +10,455 @@
10
  -blue
11
  #005B69
12
  */
13
- .agca-clear{
14
- clear:both;
15
  }
16
- .agca-tip{
17
- padding-left:20px;
 
18
  }
19
- h1#agca-title{
20
- color: #005B69;
21
- font-weight: bold;
22
- font-size: 30px;
 
23
  }
24
- table .agca-tip{
25
- padding-left: 10px;
 
26
  }
 
27
  #ag_main_menu {
28
- display: block;
29
- height: 34px;
30
- border-bottom: 3px solid #ACC491;
31
- margin-top: 2px;
32
- }
33
- .ag_section{
34
- background: #fff;
35
- }
36
- .ag_section h2{
37
- color:#005B69;
38
- }
39
- #ag_main_menu li{
40
- display:block;
41
- background-color:#DEF7C3;
42
- float:left;
43
- color:#0B6138;
44
- padding:15px;
45
- padding-top:8px;
46
- padding-bottom:8px;
47
- font-weight:bold;
48
- border-bottom:3px solid #ACC491;
49
- }
50
- #ag_main_menu li.selected{
51
- background-color:#F9F9F9;
52
- cursor:default;
53
- }
54
- #ag_main_menu li.normal:hover{
55
- background-color:#eef9d5;
56
- cursor:pointer;
57
- }
58
- #ag_main_menu a:focus{
59
- outline: none;
60
- border:0;
61
- }
62
- #ag_main_menu li a{
63
- text-decoration:none;
64
- color: #888888;
65
- outline: none;
66
- border:0;
67
- }
68
- .ag_table_heading{
69
- background:none;
70
- display:block;
71
- height:25px;
72
- padding:5px;
73
- padding-top:0px;
74
- padding-bottom:1px;
75
- margin-top:50px;
76
- margin-left:-10px;
77
- margin-right:-10px;
78
- }
79
- .ag_table_heading h3{
80
- color: #fff;
81
- background: gray;
82
- margin-left: -15px;
83
- padding: 3px 9px;
84
- border: none;
85
- border-radius: 6px;
86
- }
87
- .ag_table_major_options{
88
- background-color:#f8f8f8;
89
- width: 500px;
90
- margin-bottom: 2px;
91
- }
92
- #agca_form .form-table .ag_table_major_options td{
93
- padding-left:20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
 
96
  div#AGToolTipDiv {
97
- position: absolute;
98
- top: 100px;
99
- left: 200px;
100
- height: auto;
101
- border: 1px solid #FFFF00;
102
- background-color: #FFFFD4;
103
- display: none;
104
- padding: 3px;
105
- padding-top: 7px;
106
- padding-bottom: 5px;
107
- }
108
- td.ag_admin_menu_parent{
109
- font-size:16px;
110
- font-weight:bold;
111
- }
112
- td.ag_admin_menu_parent:hover{
113
- background-color:#ddd;
114
- }
115
- #ag_edit_adminmenu h3{
116
- color: #ffffff;
117
- }
118
- #ag_edit_adminmenu tr{
119
- margin:0;
120
- padding:0;
121
- background-color:#E8FAE8;
122
  }
 
 
 
 
 
 
 
123
  #ag_edit_adminmenu td.ag_admin_menu_child {
124
- margin:0;
125
- padding:15px;
126
- padding-top:0;
127
- padding-bottom:0;
128
- }
129
- #ag_edit_adminmenu th h2{
130
- color:#fff;
131
- }
132
- #ag_edit_adminmenu a{
133
- text-decoration:none;
134
- color:#444;
135
- }
136
- #ag_edit_adminmenu input[name=ag_edit_adminmenu_item_top_2]:hover{
137
- background-color: grey !important;
138
- }
139
- .noclass{
140
- display:none;
141
- }
142
- #agca_footer_support_info{
143
- font-size:12px;
144
- font-weight:bold;
145
- background:#acc491;
146
- color:#ffffff;
147
- border:none;
148
- padding:20px;
149
- }
150
- #agca_footer_support_info a{
151
- color:#005b69;
152
- text-decoration:none;
153
- font-size:18px;
154
- }
155
- #agca_news{
156
- height:50px;
157
- margin-top:-35px;
158
- color:#005B69;
159
- }
160
- #agca_news a{
161
- color:#005B69;
162
- }
163
- #agca_advertising{
164
- display:block;
165
- width:900px;
 
 
 
 
 
 
 
 
 
166
  height: 100px;
167
- /*background-color: #cccccc;*/
168
  padding: 0;
169
  margin: 0;
170
  }
171
- #agca_advertising ul{
 
172
  padding: 0;
173
  margin: 0;
174
- padding-right:5px;
175
  }
176
- #agca_advertising > ul > li{
177
- float:left;
 
178
  margin-right: 6px;
179
  cursor: pointer;
180
  }
181
- #agca_form{
182
- min-width: 835px;/*used for agca menu lineup*/
 
183
  }
184
- #agca_form .section_title{
185
- font-weight:bold;
186
- background: #def7c3;
 
187
  border-bottom-right-radius: 15px;
188
  color: #acc491;
189
  float: left;
190
  font-size: 40px;
191
  padding: 20px 11px;
192
- position: relative;
193
  text-decoration: none;
194
  text-shadow: none;
195
  width: 50%;
196
- display:block;
197
- margin-top:0;
198
  }
199
- #agca_form h2.section_title{
200
-
 
201
  }
202
- #agca_form h2.section_title{
 
203
  font-family: Helvetica, Arial, sans-serif;
204
  font-weight: bold;
205
  font-size: 45px;
206
  line-height: 1em;
207
  }
 
208
  #agca_form h2.section_title {
209
  /* Shadows are visible under slightly transparent text color */
210
  color: rgba(189, 193, 172, 0.71);
211
  text-shadow: 1px 4px 6px #def7c3, 0 0 0 #000, 1px 4px 6px #def7c3;
212
  }
 
213
  /* Don't show shadows when selecting text */
214
- #agca_form h2.section_title::-moz-selection { background: #5af; color: #fff; text-shadow: none; }
215
- #agca_form h2.section_title::selection { background: #5af; color: #fff; text-shadow: none; }
 
 
 
216
 
 
 
 
 
 
217
 
218
- #agca_form #templates_head_buttons input[type=button]{
219
- background:#174F69;
220
- color:white;
221
- font-weight:bold;
222
  }
223
- #agca_form #templates_head_buttons input[type=button]:hover{
224
- background:white;
225
- color:#174F69;
 
226
  }
227
 
228
- .ag-custom-button{
229
-
230
- /* margin-bottom:-4px !important;*/
231
  }
232
- #sidebar_adminmenu_logo{
 
233
  margin-bottom: -33px;
234
  min-height: 28px;
235
  cursor: pointer;
236
  }
237
 
238
- .agcaMenuEditorPlusMinus .plus{
239
- padding-right: 4px;
240
- display: inline;
241
  }
242
- .agcaMenuEditorPlusMinus .minus{
 
243
  padding-right: 4px;
244
  display: none;
245
  }
246
- .agcaMenuEditorPlusMinus .dashicons:before{
247
- font-size: 25px;
248
- line-height: 22px;
249
- display: inline-block;
 
250
  }
251
 
252
- .agcaMenuEditorPlusMinus{
253
- float: left;
254
- margin-right: 18px;
255
  cursor: default;
256
- width:10px;
257
  }
 
258
  /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
259
  padding: 3px 10px;
260
  background-color:#ffffff;
261
  } */
262
- #agca_form .agca_button.clear span:before{
263
- color: #f08080;
264
- cursor:pointer;
265
- font-size: 30px;
266
  }
267
- #agca_form .agca_button.clear span:hover:before{
268
- color: red;
 
269
  }
270
- #agca_form input[type=button],button{
271
- background-color: #ACC491;
 
272
  border: 1px solid #ACC491;
273
- border-radius: 3px;
274
  color: #FFFFFF;
275
  padding: 5px 10px;
276
  }
277
- #agca_form input[type=button]:hover{
278
- background-color:#DEF7C3;
279
- border: 1px solid #DEF7C3;
280
- color:#444;
281
- cursor:pointer;
 
282
  }
283
- #agca_form input[type=text]{
284
- height:28px;
285
- width:400px;
 
286
  }
287
- #agca_form input.color_picker{
288
- width:77px;
 
289
  }
290
- #agca_form input[type=text]:hover{
 
291
  background-color: #efffef;
292
  }
293
- #agca_form textarea{
294
- width:400px;
 
295
  }
296
- #agca_form textarea.wp-editor-area{
297
- width:100%;
 
298
  }
299
- #agca_form textarea:hover{
300
- background-color: #efffef;
 
301
  }
302
- #agca_form #ag_edit_adminmenu input[type=text]:hover{
 
303
  background-color: #444444;
304
- color:#ffffff;
305
  }
306
- #agca_form #ag_add_adminmenu input[type=text]{
307
- width:300px;
 
308
  }
 
309
  #agca_form #ag_add_adminmenu .button_edit span,
310
- #agca_form #ag_add_adminmenu .button_remove span{
311
- font-size: 25px;
312
- color: #7A8A67;
313
  }
314
- #agca_form #ag_add_adminmenu .button_remove span{
315
- color: red;
 
316
  }
317
- #agca_form input#save_plugin_settings{
318
- background: none repeat scroll 0 0 #acc491;
 
319
  font-weight: bold;
320
  height: 39px;
321
  padding: 4px;
322
  width: 130px;
323
- border:1px solid #acc491 !important;
324
- text-shadow: none !important;
325
- box-shadow: none !important;
326
- font-size:16px;
327
  }
328
- #agca_form input#save_plugin_settings:hover{
329
- background-color:#DEF7C3 !important;
330
- color:#005B69 !important;
 
331
  }
332
- #agca_form input#save_plugin_settings[type="button"]:hover{
333
- background-color:#ffffff;
334
- color:#ffffff;
 
335
  }
336
 
337
  /*editor style fix*/
338
- #agca_form .agca_editor input[type="button"], button{
339
- color: black;
340
  }
341
 
342
- #agca_form .agca_editor textarea{
343
- width: 100%;
344
  }
345
- .agca_editor{
346
- width:600px;
 
347
  }
348
 
349
  /*templates*/
350
- #agca_templates .error{
351
- padding:8px;
352
- font-size: 14px;
353
  }
354
 
355
- .agca_template{
356
- display:block;
357
- float:left;
358
- border:3px solid #aaa;
359
- margin:10px;
360
- margin-top:15px;
361
- cursor:pointer;
362
  }
363
- .agca_template:hover{
364
- border:3px solid green;
 
365
  }
366
- .agca_template h3{
367
- text-align: center;
368
- color:green;
 
369
  }
370
- .agca_template h3 span{
371
- color:#555;
372
- font-size:16px;
 
373
  }
374
- .agca_template img{
375
- width:250px;
 
376
  }
377
 
378
- .agca_logout_button{
379
- background: none repeat scroll 0 0 #dddddd;
380
  float: right;
381
  font-size: 15px;
382
  font-weight: bold;
@@ -385,206 +467,247 @@ td.ag_admin_menu_parent:hover{
385
  text-decoration: none;
386
  border-radius: 0 0 3px 3px;
387
  border: 1px solid #BBBBBB;
388
- border-top: none;
389
  margin-left: 6px;
390
  margin-right: 20px;
391
  padding: 6px 10px;
392
  }
393
- #ag_add_adminmenu button{
394
- border: medium none;
 
395
  border-radius: 4px;
396
  color: #FFFFFF;
397
  padding: 6px 9px;
398
- min-width: 150px;
399
  }
400
- .wp-admin.folded #sidebar_adminmenu_logo{
401
- display:none;
 
402
  }
403
- .agca-selectbox{
404
- width:405px;
405
- padding:4px !important;
406
- height:28px !important;
 
407
  }
408
- .agca-selectbox:hover{
409
- background-color:#efffef;
 
410
  }
411
 
412
- #agca_form .agca-checkbox-box{
413
- cursor:pointer;
414
- display: block;
415
- width: 28px;
416
  height: 28px;
417
- position:relative;
418
- float:left;
419
- }
420
- #agca_form .agca-checkbox-box:before{
421
- content: "\f159";
422
- font-size: 35px;
423
- line-height: 35px;
424
- color: #ACC491;
425
- font-family: Dashicons;
426
- }
427
- #agca_form .agca-checkbox-box.visibility:before{
428
- content: "\f177";
429
- }
430
- #agca_form .agca-checkbox-box-checked{
431
- cursor:pointer;
432
- display: block;
433
- width: 28px;
 
 
 
434
  height: 28px;
435
- position:relative;
436
- float:left;
437
  }
438
- #agca_form .agca-checkbox-box-checked:before{
439
- content: "\f502";
440
- font-size: 35px;
441
- line-height: 35px;
442
- color: #659957;
443
- font-family: Dashicons;
 
444
  }
445
- #agca_form .agca-checkbox-box-checked.visibility:before{
446
- content: "\f530";
447
- color: #f08080;
 
448
  }
 
449
  #agca_form .agca-checkbox-box-checked:hover:before,
450
- #agca_form .agca-checkbox-box:hover:before{
451
- color: #999;
452
  }
453
 
454
- #agca_form label{
455
- font-size:15px;
456
- color:#777777;
457
  }
458
- #agca_form .form-table th{
459
- width:350px;
460
- padding-left: 20px;
 
461
  }
462
- .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box{
463
- margin-top:-15px;
 
464
  }
465
- #agca_form input[type=radio]{
466
- display:block;
467
- float:left;
 
468
  }
469
- #agca_form .agca-radiobox{
470
- cursor:pointer;
471
- display: block;
472
- width: 28px;
 
473
  height: 28px;
474
- position:relative;
475
- float:left;
476
  }
477
- #agca_form .agca-radio-text{
478
- display: block;
 
479
  float: left;
480
  font-size: 17px;
481
  font-weight: bold;
482
- margin: 4px 25px 4px 4px;
483
- cursor:pointer;
484
  }
485
- #agca_form .agca-radio-text.on{
486
- color: #ACC491;
 
487
  }
488
- #agca_form .agca-radio-text.off{
489
- color: #f08080;
 
490
  }
491
- #agca_form .agca-radiobox:before{
492
- font-family: Dashicons;
493
- content: "\f159";
494
- font-size: 30px;
495
- line-height:30px;
 
496
  }
497
- #agca_form .agca-radiobox.checked:before{
498
- content: "\f502";
 
499
  }
500
- #agca_form .agca-radiobox.checked[value=off]:before{
501
- content: "\f153";
 
502
  }
503
- #agca_form .agca-radiobox[value=on]:before{
504
- color: #ACC491;
 
505
  }
506
- #agca_form .agca-radiobox[value=off]:before{
507
- color: #f08080;
 
508
  }
509
 
510
- #agca_form #section_templates{
511
  background: rgba(255, 255, 255, 0.95)
512
  }
513
- #wp-admin-bar-agca-admin-themes a{
514
- color: #def7c3 !important;
 
515
  }
 
516
  #wp-admin-bar-agca-admin-themes .ab-icon:before {
517
  font-family: "dashicons";
518
  content: "\f100";
519
- margin-top: 2px;
520
- display: block;
521
- color: #eef9d5 !important;
522
  }
523
- .agca-feedback-and-support a{
524
- border: medium none;
525
- border-radius: 4px;
526
- color: #FFFFFF;
527
- padding: 6px 9px;
528
- min-width: 240px;
529
- background: rgb(216, 234, 216);
530
- display: inline-block;
531
- text-decoration: none;
532
- color: gray;
 
533
  }
534
- .agca-feedback-and-support a:hover{
535
- background-color:#ACC491;
536
- color:#fff;
 
537
  }
538
- #agca-your-feedback{
539
- float:right;
540
- width:160px;
541
- margin-top: -25px;
 
542
  }
543
- #agca-your-feedback .dashicons{
544
- font-size: 24px;
545
- padding: 0 3px;
546
- line-height: 18px;
 
547
  }
548
- #agca-your-feedback a{
549
- text-decoration: none;
 
550
  }
551
- #agca-your-feedback a{
552
- text-decoration: none;
 
553
  }
554
- #agca-your-feedback .feedback.negative{
555
- color: #f08080;
 
556
  }
557
- #agca-your-feedback .feedback.negative:hover{
558
- color: red;
 
559
  }
560
- #agca-your-feedback .feedback.positive{
561
- color: #ACC491;
 
562
  }
563
- #agca-your-feedback .feedback.positive:hover{
564
- color: green;
 
565
  }
566
- #agca_donate_button{
567
- margin-left: 5px;
568
- margin-top: 3px;
569
- display: inline-block;
 
570
  }
571
- #section_ag_colorizer_settings .color input{
572
- border-radius: 5px;
 
573
  }
574
- #section_ag_colorizer_settings .color .agca_button{
575
- cursor:pointer;
 
576
  }
577
- #section_ag_colorizer_settings .color .agca_button span{
578
- font-size: 35px;
579
- padding: 0 6px;
580
- color: #ACC491;
 
581
  }
582
- #section_ag_colorizer_settings .color .agca_button span:hover{
583
- color: #659957;
 
584
  }
585
- #section_ag_colorizer_settings .color .agca_button span.clear{
586
- color: #f08080;
 
587
  }
588
- #section_ag_colorizer_settings .color .agca_button span.clear:hover{
589
- color: red;
 
590
  }
10
  -blue
11
  #005B69
12
  */
13
+ .agca-clear {
14
+ clear: both;
15
  }
16
+
17
+ .agca-tip {
18
+ padding-left: 20px;
19
  }
20
+
21
+ h1#agca-title {
22
+ color: #005B69;
23
+ font-weight: bold;
24
+ font-size: 30px;
25
  }
26
+
27
+ table .agca-tip {
28
+ padding-left: 10px;
29
  }
30
+
31
  #ag_main_menu {
32
+ display: block;
33
+ height: 34px;
34
+ border-bottom: 3px solid #ACC491;
35
+ margin-top: 2px;
36
+ }
37
+
38
+ .ag_section {
39
+ background: #fff;
40
+ }
41
+
42
+ .ag_section h2 {
43
+ color: #005B69;
44
+ }
45
+
46
+ #agca_form #section-cusmin {
47
+ font-size: 15px;
48
+ padding: 10px;
49
+ border: 2px solid #999;
50
+ background: #fff;
51
+ margin-bottom: 5px;
52
+ border-radius: 6px;
53
+ font-weight: bold;
54
+ color: #999;
55
+ }
56
+
57
+ #ag_main_menu li {
58
+ display: block;
59
+ background-color: #DEF7C3;
60
+ float: left;
61
+ color: #0B6138;
62
+ padding: 15px;
63
+ padding-top: 8px;
64
+ padding-bottom: 8px;
65
+ font-weight: bold;
66
+ border-bottom: 3px solid #ACC491;
67
+ }
68
+
69
+ #ag_main_menu li.selected {
70
+ background-color: #F9F9F9;
71
+ cursor: default;
72
+ }
73
+
74
+ #ag_main_menu li.normal:hover {
75
+ background-color: #eef9d5;
76
+ cursor: pointer;
77
+ }
78
+
79
+ #ag_main_menu a:focus {
80
+ outline: none;
81
+ border: 0;
82
+ }
83
+
84
+ #ag_main_menu li a {
85
+ text-decoration: none;
86
+ color: #888888;
87
+ outline: none;
88
+ border: 0;
89
+ }
90
+
91
+ .ag_table_heading {
92
+ background: none;
93
+ display: block;
94
+ height: 25px;
95
+ padding: 5px;
96
+ padding-top: 0px;
97
+ padding-bottom: 1px;
98
+ margin-top: 50px;
99
+ margin-left: -10px;
100
+ margin-right: -10px;
101
+ }
102
+
103
+ .ag_table_heading h3 {
104
+ color: #fff;
105
+ background: gray;
106
+ margin-left: -15px;
107
+ padding: 3px 9px;
108
+ border: none;
109
+ border-radius: 6px;
110
+ }
111
+
112
+ .ag_table_major_options {
113
+ background-color: #f8f8f8;
114
+ width: 500px;
115
+ margin-bottom: 2px;
116
+ }
117
+
118
+ #agca_form .form-table .ag_table_major_options td {
119
+ padding-left: 20px;
120
  }
121
 
122
  div#AGToolTipDiv {
123
+ position: absolute;
124
+ top: 100px;
125
+ left: 200px;
126
+ height: auto;
127
+ border: 1px solid #FFFF00;
128
+ background-color: #FFFFD4;
129
+ display: none;
130
+ padding: 3px;
131
+ padding-top: 7px;
132
+ padding-bottom: 5px;
133
+ }
134
+
135
+ td.ag_admin_menu_parent {
136
+ font-size: 16px;
137
+ font-weight: bold;
138
+ }
139
+
140
+ td.ag_admin_menu_parent:hover {
141
+ background-color: #ddd;
142
+ }
143
+
144
+ #ag_edit_adminmenu h3 {
145
+ color: #ffffff;
 
 
146
  }
147
+
148
+ #ag_edit_adminmenu tr {
149
+ margin: 0;
150
+ padding: 0;
151
+ background-color: #E8FAE8;
152
+ }
153
+
154
  #ag_edit_adminmenu td.ag_admin_menu_child {
155
+ margin: 0;
156
+ padding: 15px;
157
+ padding-top: 0;
158
+ padding-bottom: 0;
159
+ }
160
+
161
+ #ag_edit_adminmenu th h2 {
162
+ color: #fff;
163
+ }
164
+
165
+ #ag_edit_adminmenu a {
166
+ text-decoration: none;
167
+ color: #444;
168
+ }
169
+
170
+ #ag_edit_adminmenu input[name=ag_edit_adminmenu_item_top_2]:hover {
171
+ background-color: grey !important;
172
+ }
173
+
174
+ .noclass {
175
+ display: none;
176
+ }
177
+
178
+ #agca_footer_support_info {
179
+ font-size: 12px;
180
+ font-weight: bold;
181
+ background: #acc491;
182
+ color: #ffffff;
183
+ border: none;
184
+ padding: 20px;
185
+ }
186
+
187
+ #agca_footer_support_info a {
188
+ color: #005b69;
189
+ text-decoration: none;
190
+ font-size: 18px;
191
+ }
192
+
193
+ #agca_news {
194
+ height: 50px;
195
+ margin-top: -35px;
196
+ color: #005B69;
197
+ }
198
+
199
+ #agca_news a {
200
+ color: #005B69;
201
+ }
202
+
203
+ #agca_advertising {
204
+ display: block;
205
+ width: 900px;
206
  height: 100px;
207
+ /*background-color: #cccccc;*/
208
  padding: 0;
209
  margin: 0;
210
  }
211
+
212
+ #agca_advertising ul {
213
  padding: 0;
214
  margin: 0;
215
+ padding-right: 5px;
216
  }
217
+
218
+ #agca_advertising > ul > li {
219
+ float: left;
220
  margin-right: 6px;
221
  cursor: pointer;
222
  }
223
+
224
+ #agca_form {
225
+ min-width: 835px; /*used for agca menu lineup*/
226
  }
227
+
228
+ #agca_form .section_title {
229
+ font-weight: bold;
230
+ background: #def7c3;
231
  border-bottom-right-radius: 15px;
232
  color: #acc491;
233
  float: left;
234
  font-size: 40px;
235
  padding: 20px 11px;
236
+ position: relative;
237
  text-decoration: none;
238
  text-shadow: none;
239
  width: 50%;
240
+ display: block;
241
+ margin-top: 0;
242
  }
243
+
244
+ #agca_form h2.section_title {
245
+
246
  }
247
+
248
+ #agca_form h2.section_title {
249
  font-family: Helvetica, Arial, sans-serif;
250
  font-weight: bold;
251
  font-size: 45px;
252
  line-height: 1em;
253
  }
254
+
255
  #agca_form h2.section_title {
256
  /* Shadows are visible under slightly transparent text color */
257
  color: rgba(189, 193, 172, 0.71);
258
  text-shadow: 1px 4px 6px #def7c3, 0 0 0 #000, 1px 4px 6px #def7c3;
259
  }
260
+
261
  /* Don't show shadows when selecting text */
262
+ #agca_form h2.section_title::-moz-selection {
263
+ background: #5af;
264
+ color: #fff;
265
+ text-shadow: none;
266
+ }
267
 
268
+ #agca_form h2.section_title::selection {
269
+ background: #5af;
270
+ color: #fff;
271
+ text-shadow: none;
272
+ }
273
 
274
+ #agca_form #templates_head_buttons input[type=button] {
275
+ background: #174F69;
276
+ color: white;
277
+ font-weight: bold;
278
  }
279
+
280
+ #agca_form #templates_head_buttons input[type=button]:hover {
281
+ background: white;
282
+ color: #174F69;
283
  }
284
 
285
+ .ag-custom-button {
286
+
287
+ /* margin-bottom:-4px !important;*/
288
  }
289
+
290
+ #sidebar_adminmenu_logo {
291
  margin-bottom: -33px;
292
  min-height: 28px;
293
  cursor: pointer;
294
  }
295
 
296
+ .agcaMenuEditorPlusMinus .plus {
297
+ padding-right: 4px;
298
+ display: inline;
299
  }
300
+
301
+ .agcaMenuEditorPlusMinus .minus {
302
  padding-right: 4px;
303
  display: none;
304
  }
305
+
306
+ .agcaMenuEditorPlusMinus .dashicons:before {
307
+ font-size: 25px;
308
+ line-height: 22px;
309
+ display: inline-block;
310
  }
311
 
312
+ .agcaMenuEditorPlusMinus {
313
+ float: left;
314
+ margin-right: 18px;
315
  cursor: default;
316
+ width: 10px;
317
  }
318
+
319
  /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
320
  padding: 3px 10px;
321
  background-color:#ffffff;
322
  } */
323
+ #agca_form .agca_button.clear span:before {
324
+ color: #f08080;
325
+ cursor: pointer;
326
+ font-size: 30px;
327
  }
328
+
329
+ #agca_form .agca_button.clear span:hover:before {
330
+ color: red;
331
  }
332
+
333
+ #agca_form input[type=button], button {
334
+ background-color: #ACC491;
335
  border: 1px solid #ACC491;
336
+ border-radius: 3px;
337
  color: #FFFFFF;
338
  padding: 5px 10px;
339
  }
340
+
341
+ #agca_form input[type=button]:hover {
342
+ background-color: #DEF7C3;
343
+ border: 1px solid #DEF7C3;
344
+ color: #444;
345
+ cursor: pointer;
346
  }
347
+
348
+ #agca_form input[type=text] {
349
+ height: 28px;
350
+ width: 400px;
351
  }
352
+
353
+ #agca_form input.color_picker {
354
+ width: 77px;
355
  }
356
+
357
+ #agca_form input[type=text]:hover {
358
  background-color: #efffef;
359
  }
360
+
361
+ #agca_form textarea {
362
+ width: 400px;
363
  }
364
+
365
+ #agca_form textarea.wp-editor-area {
366
+ width: 100%;
367
  }
368
+
369
+ #agca_form textarea:hover {
370
+ background-color: #efffef;
371
  }
372
+
373
+ #agca_form #ag_edit_adminmenu input[type=text]:hover {
374
  background-color: #444444;
375
+ color: #ffffff;
376
  }
377
+
378
+ #agca_form #ag_add_adminmenu input[type=text] {
379
+ width: 300px;
380
  }
381
+
382
  #agca_form #ag_add_adminmenu .button_edit span,
383
+ #agca_form #ag_add_adminmenu .button_remove span {
384
+ font-size: 25px;
385
+ color: #7A8A67;
386
  }
387
+
388
+ #agca_form #ag_add_adminmenu .button_remove span {
389
+ color: red;
390
  }
391
+
392
+ #agca_form input#save_plugin_settings {
393
+ background: none repeat scroll 0 0 #acc491;
394
  font-weight: bold;
395
  height: 39px;
396
  padding: 4px;
397
  width: 130px;
398
+ border: 1px solid #acc491 !important;
399
+ text-shadow: none !important;
400
+ box-shadow: none !important;
401
+ font-size: 16px;
402
  }
403
+
404
+ #agca_form input#save_plugin_settings:hover {
405
+ background-color: #DEF7C3 !important;
406
+ color: #005B69 !important;
407
  }
408
+
409
+ #agca_form input#save_plugin_settings[type="button"]:hover {
410
+ background-color: #ffffff;
411
+ color: #ffffff;
412
  }
413
 
414
  /*editor style fix*/
415
+ #agca_form .agca_editor input[type="button"], button {
416
+ color: black;
417
  }
418
 
419
+ #agca_form .agca_editor textarea {
420
+ width: 100%;
421
  }
422
+
423
+ .agca_editor {
424
+ width: 600px;
425
  }
426
 
427
  /*templates*/
428
+ #agca_templates .error {
429
+ padding: 8px;
430
+ font-size: 14px;
431
  }
432
 
433
+ .agca_template {
434
+ display: block;
435
+ float: left;
436
+ border: 3px solid #aaa;
437
+ margin: 10px;
438
+ margin-top: 15px;
439
+ cursor: pointer;
440
  }
441
+
442
+ .agca_template:hover {
443
+ border: 3px solid green;
444
  }
445
+
446
+ .agca_template h3 {
447
+ text-align: center;
448
+ color: green;
449
  }
450
+
451
+ .agca_template h3 span {
452
+ color: #555;
453
+ font-size: 16px;
454
  }
455
+
456
+ .agca_template img {
457
+ width: 250px;
458
  }
459
 
460
+ .agca_logout_button {
461
+ background: none repeat scroll 0 0 #dddddd;
462
  float: right;
463
  font-size: 15px;
464
  font-weight: bold;
467
  text-decoration: none;
468
  border-radius: 0 0 3px 3px;
469
  border: 1px solid #BBBBBB;
470
+ border-top: none;
471
  margin-left: 6px;
472
  margin-right: 20px;
473
  padding: 6px 10px;
474
  }
475
+
476
+ #ag_add_adminmenu button {
477
+ border: medium none;
478
  border-radius: 4px;
479
  color: #FFFFFF;
480
  padding: 6px 9px;
481
+ min-width: 150px;
482
  }
483
+
484
+ .wp-admin.folded #sidebar_adminmenu_logo {
485
+ display: none;
486
  }
487
+
488
+ .agca-selectbox {
489
+ width: 405px;
490
+ padding: 4px !important;
491
+ height: 28px !important;
492
  }
493
+
494
+ .agca-selectbox:hover {
495
+ background-color: #efffef;
496
  }
497
 
498
+ #agca_form .agca-checkbox-box {
499
+ cursor: pointer;
500
+ display: block;
501
+ width: 28px;
502
  height: 28px;
503
+ position: relative;
504
+ float: left;
505
+ }
506
+
507
+ #agca_form .agca-checkbox-box:before {
508
+ content: "\f159";
509
+ font-size: 35px;
510
+ line-height: 35px;
511
+ color: #ACC491;
512
+ font-family: Dashicons;
513
+ }
514
+
515
+ #agca_form .agca-checkbox-box.visibility:before {
516
+ content: "\f177";
517
+ }
518
+
519
+ #agca_form .agca-checkbox-box-checked {
520
+ cursor: pointer;
521
+ display: block;
522
+ width: 28px;
523
  height: 28px;
524
+ position: relative;
525
+ float: left;
526
  }
527
+
528
+ #agca_form .agca-checkbox-box-checked:before {
529
+ content: "\f502";
530
+ font-size: 35px;
531
+ line-height: 35px;
532
+ color: #659957;
533
+ font-family: Dashicons;
534
  }
535
+
536
+ #agca_form .agca-checkbox-box-checked.visibility:before {
537
+ content: "\f530";
538
+ color: #f08080;
539
  }
540
+
541
  #agca_form .agca-checkbox-box-checked:hover:before,
542
+ #agca_form .agca-checkbox-box:hover:before {
543
+ color: #999;
544
  }
545
 
546
+ #agca_form label {
547
+ font-size: 15px;
548
+ color: #777777;
549
  }
550
+
551
+ #agca_form .form-table th {
552
+ width: 350px;
553
+ padding-left: 20px;
554
  }
555
+
556
+ .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box {
557
+ margin-top: -15px;
558
  }
559
+
560
+ #agca_form input[type=radio] {
561
+ display: block;
562
+ float: left;
563
  }
564
+
565
+ #agca_form .agca-radiobox {
566
+ cursor: pointer;
567
+ display: block;
568
+ width: 28px;
569
  height: 28px;
570
+ position: relative;
571
+ float: left;
572
  }
573
+
574
+ #agca_form .agca-radio-text {
575
+ display: block;
576
  float: left;
577
  font-size: 17px;
578
  font-weight: bold;
579
+ margin: 4px 25px 4px 4px;
580
+ cursor: pointer;
581
  }
582
+
583
+ #agca_form .agca-radio-text.on {
584
+ color: #ACC491;
585
  }
586
+
587
+ #agca_form .agca-radio-text.off {
588
+ color: #f08080;
589
  }
590
+
591
+ #agca_form .agca-radiobox:before {
592
+ font-family: Dashicons;
593
+ content: "\f159";
594
+ font-size: 30px;
595
+ line-height: 30px;
596
  }
597
+
598
+ #agca_form .agca-radiobox.checked:before {
599
+ content: "\f502";
600
  }
601
+
602
+ #agca_form .agca-radiobox.checked[value=off]:before {
603
+ content: "\f153";
604
  }
605
+
606
+ #agca_form .agca-radiobox[value=on]:before {
607
+ color: #ACC491;
608
  }
609
+
610
+ #agca_form .agca-radiobox[value=off]:before {
611
+ color: #f08080;
612
  }
613
 
614
+ #agca_form #section_templates {
615
  background: rgba(255, 255, 255, 0.95)
616
  }
617
+
618
+ #wp-admin-bar-agca-admin-themes a {
619
+ color: #def7c3 !important;
620
  }
621
+
622
  #wp-admin-bar-agca-admin-themes .ab-icon:before {
623
  font-family: "dashicons";
624
  content: "\f100";
625
+ margin-top: 2px;
626
+ display: block;
627
+ color: #eef9d5 !important;
628
  }
629
+
630
+ .agca-feedback-and-support a {
631
+ border: medium none;
632
+ border-radius: 4px;
633
+ color: #FFFFFF;
634
+ padding: 6px 9px;
635
+ min-width: 240px;
636
+ background: rgb(216, 234, 216);
637
+ display: inline-block;
638
+ text-decoration: none;
639
+ color: gray;
640
  }
641
+
642
+ .agca-feedback-and-support a:hover {
643
+ background-color: #ACC491;
644
+ color: #fff;
645
  }
646
+
647
+ #agca-your-feedback {
648
+ float: right;
649
+ width: 160px;
650
+ margin-top: -25px;
651
  }
652
+
653
+ #agca-your-feedback .dashicons {
654
+ font-size: 24px;
655
+ padding: 0 3px;
656
+ line-height: 18px;
657
  }
658
+
659
+ #agca-your-feedback a {
660
+ text-decoration: none;
661
  }
662
+
663
+ #agca-your-feedback a {
664
+ text-decoration: none;
665
  }
666
+
667
+ #agca-your-feedback .feedback.negative {
668
+ color: #f08080;
669
  }
670
+
671
+ #agca-your-feedback .feedback.negative:hover {
672
+ color: red;
673
  }
674
+
675
+ #agca-your-feedback .feedback.positive {
676
+ color: #ACC491;
677
  }
678
+
679
+ #agca-your-feedback .feedback.positive:hover {
680
+ color: green;
681
  }
682
+
683
+ #agca_donate_button {
684
+ margin-left: 5px;
685
+ margin-top: 3px;
686
+ display: inline-block;
687
  }
688
+
689
+ #section_ag_colorizer_settings .color input {
690
+ border-radius: 5px;
691
  }
692
+
693
+ #section_ag_colorizer_settings .color .agca_button {
694
+ cursor: pointer;
695
  }
696
+
697
+ #section_ag_colorizer_settings .color .agca_button span {
698
+ font-size: 35px;
699
+ padding: 0 6px;
700
+ color: #ACC491;
701
  }
702
+
703
+ #section_ag_colorizer_settings .color .agca_button span:hover {
704
+ color: #659957;
705
  }
706
+
707
+ #section_ag_colorizer_settings .color .agca_button span.clear {
708
+ color: #f08080;
709
  }
710
+
711
+ #section_ag_colorizer_settings .color .agca_button span.clear:hover {
712
+ color: red;
713
  }