AddToAny Share Buttons - Version 1.2.7.7

Version Description

  • Perfect compatibility with WordPress 3.8
  • Update email icon
  • Add confirm dialog to universal sharing toggle
  • Rename files and backend improvements for admin
Download this release

Release Info

Developer micropat
Plugin Icon 128x128 AddToAny Share Buttons
Version 1.2.7.7
Comparing to
See all releases

Code changes from version 1.2.7.6 to 1.2.7.7

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: micropat
3
  Tags: sharing, share, sharethis, bookmarking, social, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, sidebar, widget, email, e-mail, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, messenger, stumbleupon, technorati, lockerz, addthis, sexybookmarks, sociable, sharedaddy, shareaholic, icon, icons, vector, SVG, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 3.8
6
- Stable tag: 1.2.7.6
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
@@ -236,6 +236,12 @@ Upload the plugin directory (including all files and directories within) to the
236
 
237
  == Changelog ==
238
 
 
 
 
 
 
 
239
  = 1.2.7.6 =
240
  * Add option to disable universal sharing button
241
  * Disables the universal sharing button in automatic placement and ADDTOANY_SHARE_SAVE_KIT
3
  Tags: sharing, share, sharethis, bookmarking, social, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, sidebar, widget, email, e-mail, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook like, like, myspace, twitter, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, messenger, stumbleupon, technorati, lockerz, addthis, sexybookmarks, sociable, sharedaddy, shareaholic, icon, icons, vector, SVG, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 3.8
6
+ Stable tag: 1.2.7.7
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
236
 
237
  == Changelog ==
238
 
239
+ = 1.2.7.7 =
240
+ * Perfect compatibility with WordPress 3.8
241
+ * Update email icon
242
+ * Add confirm dialog to universal sharing toggle
243
+ * Rename files and backend improvements for admin
244
+
245
  = 1.2.7.6 =
246
  * Add option to disable universal sharing button
247
  * Disables the universal sharing button in automatic placement and ADDTOANY_SHARE_SAVE_KIT
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: 1.2.7.6
7
  Author: micropat
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -87,7 +87,7 @@ function A2A_SHARE_SAVE_link_vars($linkname = FALSE, $linkurl = FALSE) {
87
  return compact( 'linkname', 'linkname_enc', 'linkurl', 'linkurl_enc' );
88
  }
89
 
90
- include_once($A2A_SHARE_SAVE_plugin_dir . '/services.php');
91
 
92
  // Combine ADDTOANY_SHARE_SAVE_ICONS and ADDTOANY_SHARE_SAVE_BUTTON
93
  function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
@@ -802,838 +802,12 @@ function A2A_SHARE_SAVE_unschedule_cache() {
802
  OPTIONS
803
  ******************************/
804
 
805
- // Post Options
806
- function A2A_SHARE_SAVE_add_meta_box() {
807
- // get_post_types() only included in WP 2.9/3.0
808
- $post_types = ( function_exists( 'get_post_types' ) ) ? get_post_types( array( 'public' => true ) ) : array( 'post', 'page' ) ;
809
-
810
- $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) );
811
- foreach( $post_types as $post_type ) {
812
- add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' );
813
- }
814
- }
815
-
816
- function A2A_SHARE_SAVE_meta_box_content( $post ) {
817
- do_action( 'start_A2A_SHARE_SAVE_meta_box_content', $post );
818
-
819
- $disabled = get_post_meta( $post->ID, 'sharing_disabled', true ); ?>
820
-
821
- <p>
822
- <label for="enable_post_addtoany_sharing">
823
- <input type="checkbox" name="enable_post_addtoany_sharing" id="enable_post_addtoany_sharing" value="1" <?php checked( empty( $disabled ) ); ?>>
824
- <?php _e( 'Show sharing buttons.' , 'add-to-any'); ?>
825
- </label>
826
- <input type="hidden" name="addtoany_sharing_status_hidden" value="1" />
827
- </p>
828
-
829
- <?php
830
- do_action( 'end_A2A_SHARE_SAVE_meta_box_content', $post );
831
- }
832
-
833
- function A2A_SHARE_SAVE_meta_box_save( $post_id ) {
834
- // If this is an autosave, this form has not been submitted, so we don't want to do anything.
835
- if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
836
- return $post_id;
837
-
838
- // Save sharing_disabled if "Show sharing buttons" checkbox is unchecked
839
- if ( isset( $_POST['post_type'] ) ) {
840
- if ( current_user_can( 'edit_post', $post_id ) ) {
841
- if ( isset( $_POST['addtoany_sharing_status_hidden'] ) ) {
842
- if ( !isset( $_POST['enable_post_addtoany_sharing'] ) ) {
843
- update_post_meta( $post_id, 'sharing_disabled', 1 );
844
- } else {
845
- delete_post_meta( $post_id, 'sharing_disabled' );
846
- }
847
- }
848
- }
849
- }
850
-
851
- return $post_id;
852
- }
853
-
854
- add_action( 'admin_init', 'A2A_SHARE_SAVE_add_meta_box' );
855
- add_action( 'save_post', 'A2A_SHARE_SAVE_meta_box_save' );
856
-
857
-
858
- function A2A_SHARE_SAVE_migrate_options() {
859
-
860
- $options = array(
861
- 'inline_css' => '1', // Modernly used for "Use CSS Stylesheet?"
862
- 'cache' => '-1',
863
- 'display_in_posts_on_front_page' => '1',
864
- 'display_in_posts_on_archive_pages' => '1',
865
- 'display_in_posts' => '1',
866
- 'display_in_pages' => '1',
867
- 'display_in_feed' => '1',
868
- 'show_title' => '-1',
869
- 'onclick' => '-1',
870
- 'button' => 'A2A_SVG_32',
871
- 'button_custom' => '',
872
- 'additional_js_variables' => '',
873
- 'button_text' => 'Share',
874
- 'display_in_excerpts' => '1',
875
- 'active_services' => Array(),
876
- );
877
-
878
- $namespace = 'A2A_SHARE_SAVE_';
879
-
880
- foreach ($options as $option_name => $option_value) {
881
- $old_option_name = $namespace . $option_name;
882
- $old_option_value = get_option($old_option_name);
883
-
884
- if($old_option_value === FALSE) {
885
- // Default value
886
- $options[$option_name] = $option_value;
887
- } else {
888
- // Old value
889
- $options[$option_name] = $old_option_value;
890
- }
891
-
892
- delete_option($old_option_name);
893
- }
894
-
895
- update_option('addtoany_options', $options);
896
-
897
- $deprecated_options = array(
898
- 'button_opens_new_window',
899
- 'hide_embeds',
900
- );
901
-
902
- foreach ($deprecated_options as $option_name) {
903
- delete_option($namespace . $option_name);
904
- }
905
-
906
  }
907
 
908
- function A2A_SHARE_SAVE_options_page() {
909
-
910
- global $A2A_SHARE_SAVE_plugin_url_path,
911
- $A2A_SHARE_SAVE_services;
912
-
913
- // Require admin privs
914
- if ( ! current_user_can('manage_options') )
915
- return false;
916
-
917
- $new_options = array();
918
-
919
- $namespace = 'A2A_SHARE_SAVE_';
920
-
921
- // Make available services extensible via plugins, themes (functions.php), etc.
922
- $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services);
923
-
924
- if (isset($_POST['Submit'])) {
925
-
926
- // Nonce verification
927
- check_admin_referer('add-to-any-update-options');
928
-
929
- $new_options['position'] = ($_POST['A2A_SHARE_SAVE_position']) ? @$_POST['A2A_SHARE_SAVE_position'] : 'bottom';
930
- $new_options['display_in_posts_on_front_page'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts_on_front_page']=='1') ? '1':'-1';
931
- $new_options['display_in_posts_on_archive_pages'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts_on_archive_pages']=='1') ? '1':'-1';
932
- $new_options['display_in_excerpts'] = (@$_POST['A2A_SHARE_SAVE_display_in_excerpts']=='1') ? '1':'-1';
933
- $new_options['display_in_posts'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts']=='1') ? '1':'-1';
934
- $new_options['display_in_pages'] = (@$_POST['A2A_SHARE_SAVE_display_in_pages']=='1') ? '1':'-1';
935
- $new_options['display_in_feed'] = (@$_POST['A2A_SHARE_SAVE_display_in_feed']=='1') ? '1':'-1';
936
- $new_options['show_title'] = (@$_POST['A2A_SHARE_SAVE_show_title']=='1') ? '1':'-1';
937
- $new_options['onclick'] = (@$_POST['A2A_SHARE_SAVE_onclick']=='1') ? '1':'-1';
938
- $new_options['icon_size'] = @$_POST['A2A_SHARE_SAVE_icon_size'];
939
- $new_options['button'] = @$_POST['A2A_SHARE_SAVE_button'];
940
- $new_options['button_custom'] = @$_POST['A2A_SHARE_SAVE_button_custom'];
941
- $new_options['additional_js_variables'] = trim(@$_POST['A2A_SHARE_SAVE_additional_js_variables']);
942
- $new_options['inline_css'] = (@$_POST['A2A_SHARE_SAVE_inline_css']=='1') ? '1':'-1';
943
- $new_options['cache'] = (@$_POST['A2A_SHARE_SAVE_cache']=='1') ? '1':'-1';
944
-
945
- // Schedule cache refresh?
946
- if (@$_POST['A2A_SHARE_SAVE_cache']=='1') {
947
- A2A_SHARE_SAVE_schedule_cache();
948
- A2A_SHARE_SAVE_refresh_cache();
949
- } else {
950
- A2A_SHARE_SAVE_unschedule_cache();
951
- }
952
-
953
- // Store desired text if 16 x 16px buttons or text-only is chosen:
954
- if( $new_options['button'] == 'favicon.png|16|16' )
955
- $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_favicon_16_16_text'];
956
- elseif( $new_options['button'] == 'share_16_16.png|16|16' )
957
- $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_share_16_16_text'];
958
- else
959
- $new_options['button_text'] = ( trim($_POST['A2A_SHARE_SAVE_button_text']) != '' ) ? $_POST['A2A_SHARE_SAVE_button_text'] : __('Share','add-to-any');
960
-
961
- // Store chosen individual services to make active
962
- $active_services = Array();
963
- if ( ! isset($_POST['A2A_SHARE_SAVE_active_services']))
964
- $_POST['A2A_SHARE_SAVE_active_services'] = Array();
965
- foreach ( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename )
966
- $active_services[] = substr($sitename, 7);
967
- $new_options['active_services'] = $active_services;
968
-
969
- // Store special service options
970
- $new_options['special_facebook_like_options'] = array(
971
- 'verb' => ((@$_POST['addtoany_facebook_like_verb'] == 'recommend') ? 'recommend' : 'like')
972
- );
973
- $new_options['special_twitter_tweet_options'] = array(
974
- 'show_count' => ((@$_POST['addtoany_twitter_tweet_show_count'] == '1') ? '1' : '-1')
975
- );
976
- $new_options['special_google_plusone_options'] = array(
977
- 'show_count' => ((@$_POST['addtoany_google_plusone_show_count'] == '1') ? '1' : '-1')
978
- );
979
- $new_options['special_google_plus_share_options'] = array(
980
- 'show_count' => ((@$_POST['addtoany_google_plus_share_show_count'] == '1') ? '1' : '-1')
981
- );
982
- $new_options['special_pinterest_pin_options'] = array(
983
- 'show_count' => ((@$_POST['addtoany_pinterest_pin_show_count'] == '1') ? '1' : '-1')
984
- );
985
-
986
- update_option('addtoany_options', $new_options);
987
-
988
- ?>
989
- <div class="updated fade"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
990
- <?php
991
-
992
- } else if (isset($_POST['Reset'])) {
993
- // Nonce verification
994
- check_admin_referer('add-to-any-update-options');
995
-
996
- delete_option('addtoany_options');
997
- }
998
-
999
- $options = get_option('addtoany_options');
1000
-
1001
- function position_in_content($options, $option_box = FALSE) {
1002
-
1003
- if ( ! isset($options['position'])) {
1004
- $options['position'] = 'bottom';
1005
- }
1006
-
1007
- $positions = array(
1008
- 'bottom' => array(
1009
- 'selected' => ('bottom' == $options['position']) ? ' selected="selected"' : '',
1010
- 'string' => __('bottom', 'add-to-any')
1011
- ),
1012
- 'top' => array(
1013
- 'selected' => ('top' == $options['position']) ? ' selected="selected"' : '',
1014
- 'string' => __('top', 'add-to-any')
1015
- ),
1016
- 'both' => array(
1017
- 'selected' => ('both' == $options['position']) ? ' selected="selected"' : '',
1018
- 'string' => __('top &amp; bottom', 'add-to-any')
1019
- )
1020
- );
1021
-
1022
- if ($option_box) {
1023
- $html = '</label>';
1024
- $html .= '<label>'; // Label needed to prevent checkmark toggle on SELECT click
1025
- $html .= '<select name="A2A_SHARE_SAVE_position">';
1026
- $html .= '<option value="bottom"' . $positions['bottom']['selected'] . '>' . $positions['bottom']['string'] . '</option>';
1027
- $html .= '<option value="top"' . $positions['top']['selected'] . '>' . $positions['top']['string'] . '</option>';
1028
- $html .= '<option value="both"' . $positions['both']['selected'] . '>' . $positions['both']['string'] . '</option>';
1029
- $html .= '</select>';
1030
-
1031
- return $html;
1032
- } else {
1033
- $html = '<span class="A2A_SHARE_SAVE_position">';
1034
- $html .= $positions[$options['position']]['string'];
1035
- $html .= '</span>';
1036
-
1037
- return $html;
1038
- }
1039
- }
1040
-
1041
- ?>
1042
-
1043
- <?php A2A_SHARE_SAVE_theme_hooks_check(); ?>
1044
-
1045
- <div class="wrap">
1046
-
1047
- <div id="icon-options-general" class="icon32"></div>
1048
-
1049
- <h2><?php _e( 'AddToAny Share Settings', 'add-to-any' ); ?></h2>
1050
-
1051
- <form id="addtoany_admin_form" method="post" action="">
1052
-
1053
- <?php wp_nonce_field('add-to-any-update-options'); ?>
1054
-
1055
- <table class="form-table">
1056
-
1057
- <tr valign="top">
1058
- <th scope="row"><?php _e("Icon Size", "add-to-any"); ?></th>
1059
- <td><fieldset>
1060
- <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="32"<?php if( !$options['icon_size'] || $options['icon_size']=='32' ) echo ' checked="checked"'; ?>> <?php _e('Large', 'add-to-any'); ?></label>
1061
- <br>
1062
- <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="16"<?php if($options['icon_size']=='16') echo ' checked="checked"'; ?>> <?php _e('Small', 'add-to-any'); ?></label>
1063
- </fieldset></td>
1064
- </tr>
1065
-
1066
- <tr valign="top">
1067
- <th scope="row"><?php _e("Standalone Buttons", "add-to-any"); ?></th>
1068
- <td><fieldset>
1069
- <ul id="addtoany_services_sortable" class="addtoany_admin_list addtoany_override a2a_kit_size_32">
1070
- <li class="dummy"><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/transparent.gif" width="16" height="16" alt="" /></li>
1071
- </ul>
1072
- <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", "add-to-any"); ?></p>
1073
- <ul id="addtoany_services_selectable" class="addtoany_admin_list">
1074
- <li id="a2a_wp_facebook_like" class="addtoany_special_service" title="Facebook Like button">
1075
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
1076
- </li>
1077
- <li id="a2a_wp_twitter_tweet" class="addtoany_special_service" title="Twitter Tweet button">
1078
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
1079
- </li>
1080
- <li id="a2a_wp_google_plusone" class="addtoany_special_service" title="Google +1 button">
1081
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
1082
- </li>
1083
- <li id="a2a_wp_google_plus_share" class="addtoany_special_service" title="Google+ Share button">
1084
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="57" height="20" alt="Google+ Share" /></span>
1085
- </li>
1086
- <li id="a2a_wp_pinterest_pin" class="addtoany_special_service" title="Pinterest Pin It button">
1087
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin.png'; ?>" width="40" height="20" alt="Pinterest Pin It" /></span>
1088
- </li>
1089
- <?php
1090
- // Show all services
1091
- foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
1092
- if (isset($site['href']))
1093
- $custom_service = TRUE;
1094
- else
1095
- $custom_service = FALSE;
1096
- if ( ! isset($site['icon']))
1097
- $site['icon'] = 'default';
1098
- ?>
1099
- <li data-addtoany-icon-name="<?php echo $site['icon']; ?>" id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
1100
- <span><img src="<?php echo (isset($site['icon_url'])) ? $site['icon_url'] : $A2A_SHARE_SAVE_plugin_url_path.'/icons/'.$site['icon'].'.png'; ?>" width="<?php echo (isset($site['icon_width'])) ? $site['icon_width'] : '16'; ?>" height="<?php echo (isset($site['icon_height'])) ? $site['icon_height'] : '16'; ?>" alt="" /><?php echo $site['name']; ?></span>
1101
- </li>
1102
- <?php
1103
- } ?>
1104
- </ul>
1105
- </fieldset></td>
1106
- </tr>
1107
-
1108
- <tr valign="top">
1109
- <th scope="row"><?php _e("Universal Button", "add-to-any"); ?></th>
1110
- <td><fieldset>
1111
- <div class="addtoany_icon_size_large">
1112
- <label class="addtoany_override a2a_kit_size_32">
1113
- <input name="A2A_SHARE_SAVE_button" value="A2A_SVG_32" type="radio"<?php if( !$options['button'] || $options['button']=='A2A_SVG_32' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1114
- <span class="a2a_svg a2a_s_a2a" onclick="this.parentNode.firstChild.checked=true" style="margin-left:9px"></span>
1115
- </label>
1116
- <br>
1117
- </div>
1118
-
1119
- <div class="addtoany_icon_size_small">
1120
- <label>
1121
- <input name="A2A_SHARE_SAVE_button" value="favicon.png|16|16" id="A2A_SHARE_SAVE_button_is_favicon_16" type="radio"<?php if($options['button']=='favicon.png|16|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1122
- <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/favicon.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share','add-to-any'); ?>" title="+ <?php _e('Share','add-to-any'); ?>" onclick="this.parentNode.firstChild.checked=true"/>
1123
- </label>
1124
- <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_favicon_16').checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1125
- <label style="padding-left:9px">
1126
- <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" id="A2A_SHARE_SAVE_button_is_share_icon_16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1127
- <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_16_16.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share','add-to-any'); ?>" title="+ <?php _e('Share','add-to-any'); ?>" onclick="this.parentNode.firstChild.checked=true"/>
1128
- </label>
1129
- <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_share_icon_16').checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1130
- <br>
1131
- <label>
1132
- <input name="A2A_SHARE_SAVE_button" value="share_save_120_16.png|120|16" type="radio"<?php if($options['button']=='share_save_120_16.png|120|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1133
- <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_120_16.png'; ?>" width="120" height="16" border="0" style="padding:9px;vertical-align:middle" onclick="this.parentNode.firstChild.checked=true"/>
1134
- </label>
1135
- <br>
1136
- <label>
1137
- <input name="A2A_SHARE_SAVE_button" value="share_save_171_16.png|171|16" type="radio"<?php if($options['button']=='share_save_171_16.png|171|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1138
- <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_171_16.png'; ?>" width="171" height="16" border="0" style="padding:9px;vertical-align:middle" onclick="this.parentNode.firstChild.checked=true"/>
1139
- </label>
1140
- <br>
1141
- <label>
1142
- <input name="A2A_SHARE_SAVE_button" value="share_save_256_24.png|256|24" type="radio"<?php if($options['button']=='share_save_256_24.png|256|24') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1143
- <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_256_24.png'; ?>" width="256" height="24" border="0" style="padding:9px;vertical-align:middle" onclick="this.parentNode.firstChild.checked=true"/>
1144
- </label>
1145
- <br>
1146
- </div>
1147
-
1148
- <label>
1149
- <input name="A2A_SHARE_SAVE_button" value="CUSTOM" id="A2A_SHARE_SAVE_button_is_custom" type="radio"<?php if( $options['button'] == 'CUSTOM' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1150
- <span style="margin:0 9px;vertical-align:middle"><?php _e("Image URL"); ?>:</span>
1151
- </label>
1152
- <input name="A2A_SHARE_SAVE_button_custom" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_custom').checked=true" style="vertical-align:middle" value="<?php echo $options['button_custom']; ?>" />
1153
- <br>
1154
- <label>
1155
- <input name="A2A_SHARE_SAVE_button" value="TEXT" id="A2A_SHARE_SAVE_button_is_text" type="radio"<?php if( $options['button'] == 'TEXT' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1156
- <span style="margin:0 9px;vertical-align:middle"><?php _e("Text only"); ?>:</span>
1157
- </label>
1158
- <input name="A2A_SHARE_SAVE_button_text" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_text').checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1159
- <br>
1160
- <label>
1161
- <input name="A2A_SHARE_SAVE_button" value="NONE" type="radio"<?php if( $options['button'] == 'NONE' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1162
- <span style="margin:0 9px;vertical-align:middle"><?php _e("None"); ?></span>
1163
- </label>
1164
-
1165
- </fieldset></td>
1166
- </tr>
1167
- <tr valign="top">
1168
- <th scope="row"><?php _e('Placement', 'add-to-any'); ?></th>
1169
- <td><fieldset>
1170
- <label>
1171
- <input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
1172
- if($options['display_in_posts']!='-1') echo ' checked="checked"'; ?> value="1"/>
1173
- <?php printf(__('Display at the %s of posts', 'add-to-any'), position_in_content($options, TRUE)); ?> <strong>*</strong>
1174
- </label>
1175
- <br/>
1176
- <label>
1177
- &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
1178
- if($options['display_in_excerpts']!='-1') echo ' checked="checked"';
1179
- if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1180
- ?> value="1"/>
1181
- <?php printf(__('Display at the %s of post excerpts', 'add-to-any'), position_in_content($options)); ?>
1182
- </label>
1183
- <br/>
1184
- <label>
1185
- &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts_on_front_page" type="checkbox"<?php
1186
- if($options['display_in_posts_on_front_page']!='-1') echo ' checked="checked"';
1187
- if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1188
- ?> value="1"/>
1189
- <?php printf(__('Display at the %s of posts on the front page', 'add-to-any'), position_in_content($options)); ?>
1190
- </label>
1191
- <br/>
1192
- <label>
1193
- &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts_on_archive_pages" type="checkbox"<?php
1194
- if($options['display_in_posts_on_archive_pages']!='-1') echo ' checked="checked"';
1195
- if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1196
- ?> value="1"/>
1197
- <?php printf(__('Display at the %s of posts on archive pages', 'add-to-any'), position_in_content($options)); ?>
1198
- </label>
1199
- <br/>
1200
- <label>
1201
- &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
1202
- if($options['display_in_feed']!='-1') echo ' checked="checked"';
1203
- if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1204
- ?> value="1"/>
1205
- <?php printf(__('Display at the %s of posts in the feed', 'add-to-any'), position_in_content($options)); ?>
1206
- </label>
1207
- <br/>
1208
- <label>
1209
- <input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if($options['display_in_pages']!='-1') echo ' checked="checked"'; ?> value="1"/>
1210
- <?php printf(__('Display at the %s of pages', 'add-to-any'), position_in_content($options, TRUE)); ?>
1211
- </label>
1212
- <br/><br/>
1213
- <div class="setting-description">
1214
- <strong>*</strong> <?php _e("If unchecked, be sure to place the following code in <a href=\"theme-editor.php\">your template pages</a> (within <code>index.php</code>, <code>single.php</code>, and/or <code>page.php</code>)", "add-to-any"); ?>: <span id="addtoany_show_template_button_code" class="button-secondary">&#187;</span>
1215
- <div id="addtoany_template_button_code">
1216
- <code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code>
1217
- </div>
1218
- <noscript><code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code></noscript>
1219
- </div>
1220
- </fieldset></td>
1221
- </tr>
1222
- <tr valign="top">
1223
- <th scope="row"><?php _e('Menu Style', 'add-to-any'); ?></th>
1224
- <td><fieldset>
1225
- <p><?php _e("Using AddToAny's Menu Styler, you can customize the colors of your Share/Save menu! When you're done, be sure to paste the generated code in the <a href=\"#\" onclick=\"document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus();return false\">Additional Options</a> box below.", "add-to-any"); ?></p>
1226
- <p>
1227
- <a href="http://www.addtoany.com/buttons/share_save/menu_style/wordpress" class="button-secondary" title="<?php _e("Open the AddToAny Menu Styler in a new window", "add-to-any"); ?>" target="_blank" onclick="document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus(); document.getElementById('A2A_SHARE_SAVE_menu_styler_note').style.display='';"><?php _e("Open Menu Styler", "add-to-any"); ?></a>
1228
- </p>
1229
- </fieldset></td>
1230
- </tr>
1231
- <tr valign="top">
1232
- <th scope="row"><?php _e('Menu Options', 'add-to-any'); ?></th>
1233
- <td><fieldset>
1234
- <label>
1235
- <input name="A2A_SHARE_SAVE_onclick" type="checkbox"<?php if($options['onclick']=='1') echo ' checked="checked"'; ?> value="1"/>
1236
- <?php _e('Only show the menu when the user clicks the Share/Save button', 'add-to-any'); ?>
1237
- </label>
1238
- <br />
1239
- <label>
1240
- <input name="A2A_SHARE_SAVE_show_title" type="checkbox"<?php if($options['show_title']=='1') echo ' checked="checked"'; ?> value="1"/>
1241
- <?php _e('Show the title of the post (or page) within the menu', 'add-to-any'); ?>
1242
- </label>
1243
- </fieldset></td>
1244
- </tr>
1245
- <tr valign="top">
1246
- <th scope="row"><?php _e('Additional Options', 'add-to-any'); ?></th>
1247
- <td><fieldset>
1248
- <p id="A2A_SHARE_SAVE_menu_styler_note" style="display:none">
1249
- <label for="A2A_SHARE_SAVE_additional_js_variables" class="updated">
1250
- <strong><?php _e("Paste the code from AddToAny's Menu Styler in the box below!", 'add-to-any'); ?></strong>
1251
- </label>
1252
- </p>
1253
- <label for="A2A_SHARE_SAVE_additional_js_variables">
1254
- <p><?php _e('Below you can set special JavaScript variables to apply to each Share/Save menu.', 'add-to-any'); ?>
1255
- <?php _e("Advanced users might want to explore AddToAny's <a href=\"http://www.addtoany.com/buttons/customize/\" target=\"_blank\">additional options</a>.", "add-to-any"); ?></p>
1256
- </label>
1257
- <p>
1258
- <textarea name="A2A_SHARE_SAVE_additional_js_variables" id="A2A_SHARE_SAVE_additional_js_variables" class="code" style="width: 98%; font-size: 12px;" rows="6" cols="50"><?php echo stripslashes($options['additional_js_variables']); ?></textarea>
1259
- </p>
1260
- <?php if( $options['additional_js_variables']!='' ) { ?>
1261
- <label for="A2A_SHARE_SAVE_additional_js_variables" class="setting-description"><?php _e("<strong>Note</strong>: If you're adding new code, be careful not to accidentally overwrite any previous code.</label>", 'add-to-any'); ?>
1262
- <?php } ?>
1263
- </fieldset></td>
1264
- </tr>
1265
- <tr valign="top">
1266
- <th scope="row"><?php _e('Advanced Options', 'add-to-any'); ?></th>
1267
- <td><fieldset>
1268
- <label for="A2A_SHARE_SAVE_inline_css">
1269
- <input name="A2A_SHARE_SAVE_inline_css" id="A2A_SHARE_SAVE_inline_css" type="checkbox"<?php if($options['inline_css']!='-1') echo ' checked="checked"'; ?> value="1"/>
1270
- <?php _e('Use CSS stylesheet', 'add-to-any'); ?>
1271
- </label>
1272
- <br/>
1273
- <label for="A2A_SHARE_SAVE_cache">
1274
- <input name="A2A_SHARE_SAVE_cache" id="A2A_SHARE_SAVE_cache" type="checkbox"<?php if($options['cache']=='1') echo ' checked="checked"'; ?> value="1"/>
1275
- <?php _e('Cache AddToAny locally with daily cache updates', 'add-to-any'); ?> <strong>**</strong>
1276
- </label>
1277
- <br/><br/>
1278
- <div class="setting-description">
1279
- <strong>**</strong> <?php _e("Only consider for sites with frequently returning visitors. Since many visitors will have AddToAny cached in their browser already, serving AddToAny locally from your site will be slower for those visitors. Be sure to set far future cache/expires headers for image files in your <code>uploads/addtoany</code> directory.", "add-to-any"); ?>
1280
- </div>
1281
- </fieldset></td>
1282
- </tr>
1283
- </table>
1284
-
1285
- <p class="submit">
1286
- <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Changes', 'add-to-any' ) ?>" />
1287
- <input id="A2A_SHARE_SAVE_reset_options" type="submit" name="Reset" onclick="return confirm('<?php _e('Are you sure you want to delete all AddToAny options?', 'add-to-any' ) ?>')" value="<?php _e('Reset', 'add-to-any' ) ?>" />
1288
- </p>
1289
-
1290
- </form>
1291
-
1292
- <h2><?php _e('Like this plugin?','add-to-any'); ?></h2>
1293
- <p><?php _e('<a href="http://wordpress.org/extend/plugins/add-to-any/">Give it a good rating</a> on WordPress.org.','add-to-any'); ?> <a href="http://www.facebook.com/AddToAny">Facebook</a> / <a href="http://twitter.com/AddToAny">Twitter</a></p>
1294
- <p><?php _e('<a href="http://www.addtoany.com/share_save?linkname=WordPress%20Share%20%2F%20Bookmark%20Plugin%20by%20AddToAny.com&amp;linkurl=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fadd-to-any%2F">Share it</a> with your friends.','add-to-any'); ?></p>
1295
-
1296
- <h2><?php _e('Need support?','add-to-any'); ?></h2>
1297
- <p><?php _e('See the <a href="http://wordpress.org/extend/plugins/add-to-any/faq/">FAQs</a>.','add-to-any'); ?></p>
1298
- <p><?php _e('Search the <a href="http://wordpress.org/tags/add-to-any">support forums</a>.','add-to-any'); ?></p>
1299
- </div>
1300
-
1301
- <script type="text/javascript" src="http<?php if ( is_ssl() ) echo 's'; ?>://static.addtoany.com/menu/page.js"></script>
1302
- <script type="text/javascript">if ( a2a && a2a.svg_css ) a2a.svg_css();</script>
1303
-
1304
- <?php
1305
-
1306
- }
1307
-
1308
- // Admin page header
1309
- function A2A_SHARE_SAVE_admin_head() {
1310
- if (isset($_GET['page']) && $_GET['page'] == 'add-to-any.php') {
1311
-
1312
- $options = get_option('addtoany_options');
1313
-
1314
- ?>
1315
- <script type="text/javascript"><!--
1316
- jQuery(document).ready(function(){
1317
-
1318
- var show_appropriate_universal_buttons = function() {
1319
-
1320
- // Note the currently checkmarked radio button
1321
- jQuery('input[name="A2A_SHARE_SAVE_button"]:visible').removeClass('addtoany_last_universal_selected').filter(':checked').addClass('addtoany_last_universal_selected');
1322
-
1323
- var select_proper_radio = function() {
1324
- // Select the last-selected visible radio
1325
- jQuery('input[name="A2A_SHARE_SAVE_button"].addtoany_last_universal_selected:radio:visible').attr('checked', true);
1326
-
1327
- // Otherwise select the first visible radio
1328
- if ( jQuery('input[name="A2A_SHARE_SAVE_button"]:visible:checked').length < 1 )
1329
- jQuery('input[name="A2A_SHARE_SAVE_button"]:radio:visible:first').attr('checked', true);
1330
- };
1331
-
1332
- if ( jQuery('input[name="A2A_SHARE_SAVE_icon_size"]:checked').val() == '32' ) {
1333
- // Hide small universal buttons
1334
- jQuery('.addtoany_icon_size_small').hide('fast');
1335
- // Show large universal button
1336
- jQuery('.addtoany_icon_size_large').show('fast', select_proper_radio);
1337
-
1338
- // Switch to large standalone icons
1339
- jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_special_service, #addtoany_show_services').html(function() {
1340
- return jQuery(this).data('a2a_32_icon_html');
1341
- });
1342
-
1343
- // Adjust the Add/Remove Services button
1344
- jQuery('#addtoany_show_services').addClass('addtoany_line_height_32');
1345
- }
1346
- else {
1347
- // Hide small universal buttons
1348
- jQuery('.addtoany_icon_size_large').hide('fast');
1349
- // Show large universal button
1350
- jQuery('.addtoany_icon_size_small').show('fast', select_proper_radio);
1351
-
1352
- // Switch to small standalone icons
1353
- jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_special_service, #addtoany_show_services').html(function() {
1354
- return jQuery(this).data('a2a_16_icon_html');
1355
- });
1356
-
1357
- // Adjust the Add/Remove Services button
1358
- jQuery('#addtoany_show_services').removeClass('addtoany_line_height_32');
1359
- }
1360
- };
1361
-
1362
- show_appropriate_universal_buttons();
1363
-
1364
- // Display buttons/icons of the selected icon size
1365
- jQuery('input[name="A2A_SHARE_SAVE_icon_size"]').bind('change', function(e){
1366
- show_appropriate_universal_buttons();
1367
- });
1368
-
1369
- // Toggle child options of 'Display in posts'
1370
- jQuery('#A2A_SHARE_SAVE_display_in_posts').bind('change click', function(e){
1371
- if (jQuery(this).is(':checked'))
1372
- jQuery('.A2A_SHARE_SAVE_child_of_display_in_posts').attr('checked', true).attr('disabled', false);
1373
- else
1374
- jQuery('.A2A_SHARE_SAVE_child_of_display_in_posts').attr('checked', false).attr('disabled', true);
1375
- });
1376
-
1377
- // Update button position labels/values universally in Placement section
1378
- jQuery('select[name="A2A_SHARE_SAVE_position"]').bind('change click', function(e){
1379
- var $this = jQuery(this);
1380
- jQuery('select[name="A2A_SHARE_SAVE_position"]').not($this).val($this.val());
1381
-
1382
- jQuery('.A2A_SHARE_SAVE_position').html($this.find('option:selected').html());
1383
- });
1384
-
1385
- var to_input = function(this_sortable){
1386
- // Clear any previous hidden inputs for storing chosen services
1387
- // and special service options
1388
- jQuery('input.addtoany_hidden_options').remove();
1389
-
1390
- var services_array = jQuery(this_sortable).sortable('toArray'),
1391
- services_size = services_array.length;
1392
- if(services_size<1) return;
1393
-
1394
- for(var i=0, service_name, show_count_value, fb_verb_value; i < services_size; i++){
1395
- if(services_array[i]!='') { // Exclude dummy icon
1396
- jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="A2A_SHARE_SAVE_active_services[]" type="hidden" value="'+services_array[i]+'"/>');
1397
-
1398
- // Special service options?
1399
- service_name = services_array[i].substr(7);
1400
- if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
1401
- if (service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
1402
- show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
1403
- jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
1404
- }
1405
-
1406
- if (service_name == 'facebook_like') {
1407
- fb_verb_value = (jQuery('#' + services_array[i] + '_verb').val() == 'recommend') ? 'recommend' : 'like';
1408
- jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
1409
- }
1410
- }
1411
- }
1412
- }
1413
- };
1414
-
1415
- jQuery('#addtoany_services_sortable').sortable({
1416
- forcePlaceholderSize: true,
1417
- items: 'li:not(#addtoany_show_services, .dummy)',
1418
- placeholder: 'ui-sortable-placeholder',
1419
- opacity: .6,
1420
- tolerance: 'pointer',
1421
- update: function(){to_input(this)}
1422
- });
1423
-
1424
- // Service click = move to sortable list
1425
- var moveToSortableList = function(){
1426
- var configurable_html = '',
1427
- this_service = jQuery(this),
1428
- this_service_name = this_service.attr('id').substr(7),
1429
- this_service_is_special = this_service.hasClass('addtoany_special_service'),
1430
- checked = '',
1431
- special_options_html = '';
1432
-
1433
- if (jQuery('#addtoany_services_sortable li').not('.dummy').length == 0)
1434
- jQuery('#addtoany_services_sortable').find('.dummy').hide();
1435
-
1436
- if (this_service_is_special) {
1437
- if (this_service_name == 'facebook_like') {
1438
- if (service_options[this_service_name] && service_options[this_service_name].verb)
1439
- checked = ' selected="selected"';
1440
- special_options_html = '<select id="' + this_service.attr('id') + '_verb" name="' + this_service.attr('id') + '_verb">'
1441
- + '<option value="like">Like</option>'
1442
- + '<option' + checked + ' value="recommend">Recommend</option>'
1443
- + '</select>';
1444
- } else {
1445
- // twitter_tweet & google_plusone & google_plus_share & pinterest_pin
1446
- if (service_options[this_service_name] && service_options[this_service_name].show_count) {
1447
- checked = ' checked="checked"';
1448
- }
1449
- special_options_html = '<label><input' + checked + ' id="' + this_service.attr('id') + '_show_count" name="' + this_service.attr('id') + '_show_count" type="checkbox" value="1"> Show count</label>';
1450
- }
1451
-
1452
- configurable_html = '<span class="down_arrow"></span><br style="clear:both"/><div class="special_options">' + special_options_html + '</div>';
1453
- }
1454
-
1455
- var icon_size = jQuery('input:radio[name=A2A_SHARE_SAVE_icon_size]:checked').val();
1456
- new_service = this_service.toggleClass('addtoany_selected')
1457
- .unbind('click', moveToSortableList)
1458
- .bind('click', moveToSelectableList)
1459
- .clone();
1460
-
1461
- new_service.data('a2a_16_icon_html', this_service.find('img').clone().attr('alt', this_service.attr('title')).wrap('<p>').parent().html() + configurable_html);
1462
-
1463
- if (this_service_is_special)
1464
- // If special service, set the same HTML as used for '16px icon size'
1465
- new_service.data( 'a2a_32_icon_html', new_service.data('a2a_16_icon_html') );
1466
- else
1467
- // Set HTML for 32px icon size
1468
- new_service.data( 'a2a_32_icon_html', '<span class="a2a_svg a2a_s__default a2a_s_' + this_service.attr('data-addtoany-icon-name') + '"></span>' );
1469
-
1470
- new_service.html( new_service.data('a2a_' + icon_size + '_icon_html') )
1471
- .click(function(){
1472
- jQuery(this).not('.addtoany_special_service_options_selected').find('.special_options').slideDown('fast').parent().addClass('addtoany_special_service_options_selected');
1473
- })
1474
- .hide()
1475
- .insertBefore('#addtoany_services_sortable .dummy')
1476
- .fadeIn('fast');
1477
-
1478
- this_service.attr( 'id', 'old_'+this_service.attr('id') );
1479
- };
1480
-
1481
- // Service click again = move back to selectable list
1482
- var moveToSelectableList = function(){
1483
- jQuery(this).toggleClass('addtoany_selected')
1484
- .unbind('click', moveToSelectableList)
1485
- .bind('click', moveToSortableList);
1486
-
1487
- jQuery( '#'+jQuery(this).attr('id').substr(4).replace(/\./, '\\.') )
1488
- .hide('fast', function(){
1489
- jQuery(this).remove();
1490
- });
1491
-
1492
-
1493
- if( jQuery('#addtoany_services_sortable li').not('.dummy').length==1 )
1494
- jQuery('#addtoany_services_sortable').find('.dummy').show();
1495
-
1496
- jQuery(this).attr('id', jQuery(this).attr('id').substr(4));
1497
- };
1498
-
1499
- // Service click = move to sortable list
1500
- jQuery('#addtoany_services_selectable li').bind('click', moveToSortableList);
1501
-
1502
- // Form submit = get sortable list
1503
- jQuery('#addtoany_admin_form').submit(function(){to_input('#addtoany_services_sortable')});
1504
-
1505
- // Auto-select active services
1506
- <?php
1507
- $admin_services_saved = isset($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1508
- $active_services = ( $admin_services_saved ) ? @$_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
1509
-
1510
- // Use default services if options have not been set yet (and no services were just saved in the form)
1511
- if ( false === $options && ! $admin_services_saved )
1512
- $active_services = array( 'facebook', 'twitter', 'google_plus' );
1513
- elseif ( empty( $active_services ) )
1514
- $active_services = array();
1515
-
1516
- $active_services_last = end($active_services);
1517
- if($admin_services_saved)
1518
- $active_services_last = substr($active_services_last, 7); // Remove a2a_wp_
1519
- $active_services_quoted = '';
1520
- foreach ($active_services as $service) {
1521
- if($admin_services_saved)
1522
- $service = substr($service, 7); // Remove a2a_wp_
1523
- $active_services_quoted .= '"' . esc_js( $service ) . '"';
1524
- if ( $service != $active_services_last )
1525
- $active_services_quoted .= ',';
1526
- }
1527
- ?>
1528
- var services = [<?php echo $active_services_quoted; ?>],
1529
- service_options = {};
1530
-
1531
- <?php
1532
- // Special service options
1533
- if ( isset($_POST['addtoany_facebook_like_verb']) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
1534
- || ! isset($_POST['addtoany_facebook_like_verb']) && $options['special_facebook_like_options']['verb'] == 'recommend') {
1535
- ?>service_options.facebook_like = {verb: 'recommend'};<?php
1536
- }
1537
- if ( isset($_POST['addtoany_twitter_tweet_show_count']) && $_POST['addtoany_twitter_tweet_show_count'] == '1'
1538
- || ! isset($_POST['addtoany_twitter_tweet_show_count']) && $options['special_twitter_tweet_options']['show_count'] == '1') {
1539
- ?>service_options.twitter_tweet = {show_count: 1};<?php
1540
- }
1541
- if ( isset($_POST['addtoany_google_plusone_show_count']) && $_POST['addtoany_google_plusone_show_count'] == '1'
1542
- || ! isset($_POST['addtoany_google_plusone_show_count']) && $options['special_google_plusone_options']['show_count'] == '1') {
1543
- ?>service_options.google_plusone = {show_count: 1};<?php
1544
- }
1545
- if ( isset($_POST['addtoany_google_plus_share_show_count']) && $_POST['addtoany_google_plus_share_show_count'] == '1'
1546
- || ! isset($_POST['addtoany_google_plus_share_show_count']) && $options['special_google_plus_share_options']['show_count'] == '1') {
1547
- ?>service_options.google_plus_share = {show_count: 1};<?php
1548
- }
1549
- if ( isset($_POST['addtoany_pinterest_pin_show_count']) && $_POST['addtoany_pinterest_pin_show_count'] == '1'
1550
- || ! isset($_POST['addtoany_pinterest_pin_show_count']) && $options['special_pinterest_pin_options']['show_count'] == '1') {
1551
- ?>service_options.pinterest_pin = {show_count: 1};<?php
1552
- }
1553
- ?>
1554
-
1555
- jQuery.each(services, function(i, val){
1556
- jQuery('#a2a_wp_'+val).click();
1557
- });
1558
-
1559
- // Add/Remove Services button
1560
- jQuery('#addtoany_services_sortable .dummy:first').after('<li id="addtoany_show_services"><?php _e('Add/Remove Services', 'add-to-any'); ?> &#187;</li>');
1561
- jQuery('#addtoany_show_services').click(function(e){
1562
- jQuery('#addtoany_services_selectable, #addtoany_services_info').slideDown('fast');
1563
- jQuery(this).fadeOut('fast');
1564
- });
1565
-
1566
- // Adjust the Add/Remove Services button for large or small icons
1567
- if ( jQuery('input:radio[name=A2A_SHARE_SAVE_icon_size]:checked').val() == '32' )
1568
- jQuery('#addtoany_show_services').addClass('addtoany_line_height_32');
1569
-
1570
- // 'Show template code' button
1571
- jQuery('#addtoany_show_template_button_code').click(function(e){
1572
- jQuery('#addtoany_template_button_code').slideDown('fast');
1573
- jQuery(this).fadeOut('fast');
1574
- });
1575
-
1576
- // TBD
1577
- jQuery('#addtoany_show_css_code').click(function(e){
1578
- jQuery('#addtoany_css_code').slideDown('fast');
1579
- jQuery(this).fadeOut('fast');
1580
- });
1581
- });
1582
- --></script>
1583
-
1584
- <style type="text/css">
1585
- .ui-sortable-placeholder{background-color:transparent;border:1px dashed #AAA !important;}
1586
- .addtoany_admin_list{list-style:none;padding:0;margin:0;}
1587
- .addtoany_admin_list li{-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}
1588
-
1589
- #addtoany_services_selectable{clear:left;display:none;}
1590
- #addtoany_services_selectable li{cursor:crosshair;float:left;width:150px;font-size:11px;margin:0;padding:6px;border:1px solid transparent;_border-color:#FAFAFA/*IE6*/;overflow:hidden;}
1591
- <?php // white-space:nowrap could go above, but then webkit does not wrap floats if parent has no width set; wrapping in <span> instead (below) ?>
1592
- #addtoany_services_selectable li span{white-space:nowrap;}
1593
- #addtoany_services_selectable li:hover, #addtoany_services_selectable li.addtoany_selected{border:1px solid #AAA;background-color:#FFF;}
1594
- #addtoany_services_selectable li.addtoany_selected:hover{border-color:#F00;}
1595
- #addtoany_services_selectable li:active{border:1px solid #000;}
1596
- #addtoany_services_selectable img{margin:0 4px;width:16px;height:16px;border:0;vertical-align:middle;}
1597
- #addtoany_services_selectable .addtoany_special_service{padding:3px 6px;}
1598
- #addtoany_services_selectable .addtoany_special_service img{width:auto;height:20px;}
1599
-
1600
- #addtoany_services_sortable li, #addtoany_services_sortable li.dummy:hover{cursor:move;float:left;padding:9px;border:1px solid transparent;_border-color:#FAFAFA/*IE6*/;}
1601
- #addtoany_services_sortable li:hover{border:1px solid #AAA;background-color:#FFF;}
1602
- #addtoany_services_sortable li.dummy, #addtoany_services_sortable li.dummy:hover{cursor:auto;background-color:transparent;}
1603
- #addtoany_services_sortable img{width:16px;height:16px;border:0;vertical-align:middle;}
1604
- #addtoany_services_sortable .addtoany_special_service img{width:auto;height:20px;float:left;}
1605
- #addtoany_services_sortable .addtoany_special_service span.down_arrow{background:url(<?php echo admin_url( '/images/arrows.png' ); ?>) no-repeat 5px 9px;float:right;height:29px;;margin:-6px 0 -6px 4px;width:26px;}
1606
- #addtoany_services_sortable .addtoany_special_service div.special_options{display:none;font-size:11px;margin-top:9px;}
1607
- #addtoany_services_sortable .addtoany_special_service_options_selected{border:1px solid #AAA;background-color:#FFF;}
1608
- #addtoany_services_sortable .addtoany_special_service_options_selected span.down_arrow{display:none;}
1609
-
1610
- li#addtoany_show_services.addtoany_line_height_32{line-height:32px}
1611
- li#addtoany_show_services{border:1px solid #DFDFDF;background-color:#FFF;cursor:pointer;margin-left:9px;}
1612
- li#addtoany_show_services:hover{border:1px solid #AAA;}
1613
- #addtoany_services_info{clear:left;display:none;}
1614
-
1615
- .a2a_kit_size_32.addtoany_override .a2a_svg {
1616
- border-radius: 4px;
1617
- display:inline-block;
1618
- height: 32px;
1619
- vertical-align:middle;
1620
- width: 32px;
1621
- }
1622
-
1623
- #addtoany_template_button_code, #addtoany_css_code{display:none;}
1624
-
1625
- #A2A_SHARE_SAVE_reset_options{color:red;margin-left: 15px;}
1626
- </style>
1627
- <?php
1628
-
1629
- }
1630
- }
1631
-
1632
- add_filter('admin_head', 'A2A_SHARE_SAVE_admin_head');
1633
-
1634
  function A2A_SHARE_SAVE_add_menu_link() {
1635
-
1636
- if( current_user_can('manage_options') ) {
1637
  $page = add_options_page(
1638
  'AddToAny: '. __("Share/Save", "add-to-any"). " " . __("Settings")
1639
  , __("AddToAny", "add-to-any")
@@ -1643,41 +817,36 @@ function A2A_SHARE_SAVE_add_menu_link() {
1643
  );
1644
 
1645
  /* Using registered $page handle to hook script load, to only load in AddToAny admin */
1646
- add_filter('admin_print_scripts-' . $page, 'A2A_SHARE_SAVE_scripts');
1647
  }
1648
  }
1649
 
1650
- function A2A_SHARE_SAVE_scripts() {
1651
- wp_enqueue_script('jquery-ui-sortable');
1652
- }
1653
-
1654
 
1655
  function A2A_SHARE_SAVE_widget_init() {
1656
  global $A2A_SHARE_SAVE_plugin_dir;
1657
 
1658
- include_once($A2A_SHARE_SAVE_plugin_dir . '/add-to-any-wp-widget.php');
1659
- register_widget('A2A_SHARE_SAVE_Widget');
1660
  }
1661
 
1662
- add_action('widgets_init', 'A2A_SHARE_SAVE_widget_init');
1663
-
1664
-
1665
- add_filter('admin_menu', 'A2A_SHARE_SAVE_add_menu_link');
1666
 
1667
  // Place in Option List on Settings > Plugins page
1668
  function A2A_SHARE_SAVE_actlinks( $links, $file ){
1669
  // Static so we don't call plugin_basename on every plugin row.
1670
  static $this_plugin;
1671
- if ( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__);
1672
 
1673
- if ( $file == $this_plugin ){
 
 
 
 
1674
  $settings_link = '<a href="options-general.php?page=add-to-any.php">' . __('Settings') . '</a>';
1675
  array_unshift( $links, $settings_link ); // before other links
1676
  }
 
1677
  return $links;
1678
  }
1679
 
1680
- add_filter("plugin_action_links", 'A2A_SHARE_SAVE_actlinks', 10, 2);
1681
-
1682
-
1683
- ?>
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: 1.2.7.7
7
  Author: micropat
8
  Author URI: http://www.addtoany.com/
9
  */
87
  return compact( 'linkname', 'linkname_enc', 'linkurl', 'linkurl_enc' );
88
  }
89
 
90
+ include_once($A2A_SHARE_SAVE_plugin_dir . '/addtoany.services.php');
91
 
92
  // Combine ADDTOANY_SHARE_SAVE_ICONS and ADDTOANY_SHARE_SAVE_BUTTON
93
  function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
802
  OPTIONS
803
  ******************************/
804
 
805
+ if ( is_admin() ) {
806
+ include_once( $A2A_SHARE_SAVE_plugin_dir . '/addtoany.admin.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
807
  }
808
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
809
  function A2A_SHARE_SAVE_add_menu_link() {
810
+ if ( current_user_can( 'manage_options' ) ) {
 
811
  $page = add_options_page(
812
  'AddToAny: '. __("Share/Save", "add-to-any"). " " . __("Settings")
813
  , __("AddToAny", "add-to-any")
817
  );
818
 
819
  /* Using registered $page handle to hook script load, to only load in AddToAny admin */
820
+ add_filter( 'admin_print_scripts-' . $page, 'A2A_SHARE_SAVE_scripts' );
821
  }
822
  }
823
 
824
+ add_filter( 'admin_menu', 'A2A_SHARE_SAVE_add_menu_link' );
 
 
 
825
 
826
  function A2A_SHARE_SAVE_widget_init() {
827
  global $A2A_SHARE_SAVE_plugin_dir;
828
 
829
+ include_once( $A2A_SHARE_SAVE_plugin_dir . '/addtoany.widget.php' );
830
+ register_widget( 'A2A_SHARE_SAVE_Widget' );
831
  }
832
 
833
+ add_action( 'widgets_init', 'A2A_SHARE_SAVE_widget_init' );
 
 
 
834
 
835
  // Place in Option List on Settings > Plugins page
836
  function A2A_SHARE_SAVE_actlinks( $links, $file ){
837
  // Static so we don't call plugin_basename on every plugin row.
838
  static $this_plugin;
 
839
 
840
+ if ( ! $this_plugin ) {
841
+ $this_plugin = plugin_basename(__FILE__);
842
+ }
843
+
844
+ if ( $file == $this_plugin ) {
845
  $settings_link = '<a href="options-general.php?page=add-to-any.php">' . __('Settings') . '</a>';
846
  array_unshift( $links, $settings_link ); // before other links
847
  }
848
+
849
  return $links;
850
  }
851
 
852
+ add_filter( 'plugin_action_links', 'A2A_SHARE_SAVE_actlinks', 10, 2 );
 
 
 
addtoany.admin.php ADDED
@@ -0,0 +1,836 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Post Options
4
+ function A2A_SHARE_SAVE_add_meta_box() {
5
+ // get_post_types() only included in WP 2.9/3.0
6
+ $post_types = ( function_exists( 'get_post_types' ) ) ? get_post_types( array( 'public' => true ) ) : array( 'post', 'page' ) ;
7
+
8
+ $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) );
9
+ foreach( $post_types as $post_type ) {
10
+ add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' );
11
+ }
12
+ }
13
+
14
+ function A2A_SHARE_SAVE_meta_box_content( $post ) {
15
+ do_action( 'start_A2A_SHARE_SAVE_meta_box_content', $post );
16
+
17
+ $disabled = get_post_meta( $post->ID, 'sharing_disabled', true ); ?>
18
+
19
+ <p>
20
+ <label for="enable_post_addtoany_sharing">
21
+ <input type="checkbox" name="enable_post_addtoany_sharing" id="enable_post_addtoany_sharing" value="1" <?php checked( empty( $disabled ) ); ?>>
22
+ <?php _e( 'Show sharing buttons.' , 'add-to-any'); ?>
23
+ </label>
24
+ <input type="hidden" name="addtoany_sharing_status_hidden" value="1" />
25
+ </p>
26
+
27
+ <?php
28
+ do_action( 'end_A2A_SHARE_SAVE_meta_box_content', $post );
29
+ }
30
+
31
+ function A2A_SHARE_SAVE_meta_box_save( $post_id ) {
32
+ // If this is an autosave, this form has not been submitted, so we don't want to do anything.
33
+ if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
34
+ return $post_id;
35
+
36
+ // Save sharing_disabled if "Show sharing buttons" checkbox is unchecked
37
+ if ( isset( $_POST['post_type'] ) ) {
38
+ if ( current_user_can( 'edit_post', $post_id ) ) {
39
+ if ( isset( $_POST['addtoany_sharing_status_hidden'] ) ) {
40
+ if ( !isset( $_POST['enable_post_addtoany_sharing'] ) ) {
41
+ update_post_meta( $post_id, 'sharing_disabled', 1 );
42
+ } else {
43
+ delete_post_meta( $post_id, 'sharing_disabled' );
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ return $post_id;
50
+ }
51
+
52
+ add_action( 'admin_init', 'A2A_SHARE_SAVE_add_meta_box' );
53
+ add_action( 'save_post', 'A2A_SHARE_SAVE_meta_box_save' );
54
+
55
+
56
+ function A2A_SHARE_SAVE_migrate_options() {
57
+
58
+ $options = array(
59
+ 'inline_css' => '1', // Modernly used for "Use CSS Stylesheet?"
60
+ 'cache' => '-1',
61
+ 'display_in_posts_on_front_page' => '1',
62
+ 'display_in_posts_on_archive_pages' => '1',
63
+ 'display_in_posts' => '1',
64
+ 'display_in_pages' => '1',
65
+ 'display_in_feed' => '1',
66
+ 'show_title' => '-1',
67
+ 'onclick' => '-1',
68
+ 'button' => 'A2A_SVG_32',
69
+ 'button_custom' => '',
70
+ 'additional_js_variables' => '',
71
+ 'button_text' => 'Share',
72
+ 'display_in_excerpts' => '1',
73
+ 'active_services' => Array(),
74
+ );
75
+
76
+ $namespace = 'A2A_SHARE_SAVE_';
77
+
78
+ foreach ($options as $option_name => $option_value) {
79
+ $old_option_name = $namespace . $option_name;
80
+ $old_option_value = get_option($old_option_name);
81
+
82
+ if($old_option_value === FALSE) {
83
+ // Default value
84
+ $options[$option_name] = $option_value;
85
+ } else {
86
+ // Old value
87
+ $options[$option_name] = $old_option_value;
88
+ }
89
+
90
+ delete_option($old_option_name);
91
+ }
92
+
93
+ update_option('addtoany_options', $options);
94
+
95
+ $deprecated_options = array(
96
+ 'button_opens_new_window',
97
+ 'hide_embeds',
98
+ );
99
+
100
+ foreach ($deprecated_options as $option_name) {
101
+ delete_option($namespace . $option_name);
102
+ }
103
+
104
+ }
105
+
106
+ function A2A_SHARE_SAVE_options_page() {
107
+
108
+ global $A2A_SHARE_SAVE_plugin_url_path,
109
+ $A2A_SHARE_SAVE_services;
110
+
111
+ // Require admin privs
112
+ if ( ! current_user_can('manage_options') )
113
+ return false;
114
+
115
+ $new_options = array();
116
+
117
+ $namespace = 'A2A_SHARE_SAVE_';
118
+
119
+ // Make available services extensible via plugins, themes (functions.php), etc.
120
+ $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services);
121
+
122
+ if (isset($_POST['Submit'])) {
123
+
124
+ // Nonce verification
125
+ check_admin_referer('add-to-any-update-options');
126
+
127
+ $new_options['position'] = ($_POST['A2A_SHARE_SAVE_position']) ? @$_POST['A2A_SHARE_SAVE_position'] : 'bottom';
128
+ $new_options['display_in_posts_on_front_page'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts_on_front_page']=='1') ? '1':'-1';
129
+ $new_options['display_in_posts_on_archive_pages'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts_on_archive_pages']=='1') ? '1':'-1';
130
+ $new_options['display_in_excerpts'] = (@$_POST['A2A_SHARE_SAVE_display_in_excerpts']=='1') ? '1':'-1';
131
+ $new_options['display_in_posts'] = (@$_POST['A2A_SHARE_SAVE_display_in_posts']=='1') ? '1':'-1';
132
+ $new_options['display_in_pages'] = (@$_POST['A2A_SHARE_SAVE_display_in_pages']=='1') ? '1':'-1';
133
+ $new_options['display_in_feed'] = (@$_POST['A2A_SHARE_SAVE_display_in_feed']=='1') ? '1':'-1';
134
+ $new_options['show_title'] = (@$_POST['A2A_SHARE_SAVE_show_title']=='1') ? '1':'-1';
135
+ $new_options['onclick'] = (@$_POST['A2A_SHARE_SAVE_onclick']=='1') ? '1':'-1';
136
+ $new_options['icon_size'] = @$_POST['A2A_SHARE_SAVE_icon_size'];
137
+ $new_options['button'] = @$_POST['A2A_SHARE_SAVE_button'];
138
+ $new_options['button_custom'] = @$_POST['A2A_SHARE_SAVE_button_custom'];
139
+ $new_options['additional_js_variables'] = trim(@$_POST['A2A_SHARE_SAVE_additional_js_variables']);
140
+ $new_options['inline_css'] = (@$_POST['A2A_SHARE_SAVE_inline_css']=='1') ? '1':'-1';
141
+ $new_options['cache'] = (@$_POST['A2A_SHARE_SAVE_cache']=='1') ? '1':'-1';
142
+
143
+ // Schedule cache refresh?
144
+ if (@$_POST['A2A_SHARE_SAVE_cache']=='1') {
145
+ A2A_SHARE_SAVE_schedule_cache();
146
+ A2A_SHARE_SAVE_refresh_cache();
147
+ } else {
148
+ A2A_SHARE_SAVE_unschedule_cache();
149
+ }
150
+
151
+ // Store desired text if 16 x 16px buttons or text-only is chosen:
152
+ if( $new_options['button'] == 'favicon.png|16|16' )
153
+ $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_favicon_16_16_text'];
154
+ elseif( $new_options['button'] == 'share_16_16.png|16|16' )
155
+ $new_options['button_text'] = $_POST['A2A_SHARE_SAVE_button_share_16_16_text'];
156
+ else
157
+ $new_options['button_text'] = ( trim($_POST['A2A_SHARE_SAVE_button_text']) != '' ) ? $_POST['A2A_SHARE_SAVE_button_text'] : __('Share','add-to-any');
158
+
159
+ // Store chosen individual services to make active
160
+ $active_services = Array();
161
+ if ( ! isset($_POST['A2A_SHARE_SAVE_active_services']))
162
+ $_POST['A2A_SHARE_SAVE_active_services'] = Array();
163
+ foreach ( $_POST['A2A_SHARE_SAVE_active_services'] as $dummy=>$sitename )
164
+ $active_services[] = substr($sitename, 7);
165
+ $new_options['active_services'] = $active_services;
166
+
167
+ // Store special service options
168
+ $new_options['special_facebook_like_options'] = array(
169
+ 'verb' => ((@$_POST['addtoany_facebook_like_verb'] == 'recommend') ? 'recommend' : 'like')
170
+ );
171
+ $new_options['special_twitter_tweet_options'] = array(
172
+ 'show_count' => ((@$_POST['addtoany_twitter_tweet_show_count'] == '1') ? '1' : '-1')
173
+ );
174
+ $new_options['special_google_plusone_options'] = array(
175
+ 'show_count' => ((@$_POST['addtoany_google_plusone_show_count'] == '1') ? '1' : '-1')
176
+ );
177
+ $new_options['special_google_plus_share_options'] = array(
178
+ 'show_count' => ((@$_POST['addtoany_google_plus_share_show_count'] == '1') ? '1' : '-1')
179
+ );
180
+ $new_options['special_pinterest_pin_options'] = array(
181
+ 'show_count' => ((@$_POST['addtoany_pinterest_pin_show_count'] == '1') ? '1' : '-1')
182
+ );
183
+
184
+ update_option('addtoany_options', $new_options);
185
+
186
+ ?>
187
+ <div class="updated fade"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
188
+ <?php
189
+
190
+ } else if (isset($_POST['Reset'])) {
191
+ // Nonce verification
192
+ check_admin_referer('add-to-any-update-options');
193
+
194
+ delete_option('addtoany_options');
195
+ }
196
+
197
+ $options = get_option('addtoany_options');
198
+
199
+ function position_in_content($options, $option_box = FALSE) {
200
+
201
+ if ( ! isset($options['position'])) {
202
+ $options['position'] = 'bottom';
203
+ }
204
+
205
+ $positions = array(
206
+ 'bottom' => array(
207
+ 'selected' => ('bottom' == $options['position']) ? ' selected="selected"' : '',
208
+ 'string' => __('bottom', 'add-to-any')
209
+ ),
210
+ 'top' => array(
211
+ 'selected' => ('top' == $options['position']) ? ' selected="selected"' : '',
212
+ 'string' => __('top', 'add-to-any')
213
+ ),
214
+ 'both' => array(
215
+ 'selected' => ('both' == $options['position']) ? ' selected="selected"' : '',
216
+ 'string' => __('top &amp; bottom', 'add-to-any')
217
+ )
218
+ );
219
+
220
+ if ($option_box) {
221
+ $html = '</label>';
222
+ $html .= '<label>'; // Label needed to prevent checkmark toggle on SELECT click
223
+ $html .= '<select name="A2A_SHARE_SAVE_position">';
224
+ $html .= '<option value="bottom"' . $positions['bottom']['selected'] . '>' . $positions['bottom']['string'] . '</option>';
225
+ $html .= '<option value="top"' . $positions['top']['selected'] . '>' . $positions['top']['string'] . '</option>';
226
+ $html .= '<option value="both"' . $positions['both']['selected'] . '>' . $positions['both']['string'] . '</option>';
227
+ $html .= '</select>';
228
+
229
+ return $html;
230
+ } else {
231
+ $html = '<span class="A2A_SHARE_SAVE_position">';
232
+ $html .= $positions[$options['position']]['string'];
233
+ $html .= '</span>';
234
+
235
+ return $html;
236
+ }
237
+ }
238
+
239
+ ?>
240
+
241
+ <?php A2A_SHARE_SAVE_theme_hooks_check(); ?>
242
+
243
+ <div class="wrap">
244
+
245
+ <div id="icon-options-general" class="icon32"></div>
246
+
247
+ <h2><?php _e( 'AddToAny Share Settings', 'add-to-any' ); ?></h2>
248
+
249
+ <form id="addtoany_admin_form" method="post" action="">
250
+
251
+ <?php wp_nonce_field('add-to-any-update-options'); ?>
252
+
253
+ <table class="form-table">
254
+
255
+ <tr valign="top">
256
+ <th scope="row"><?php _e("Icon Size", "add-to-any"); ?></th>
257
+ <td><fieldset>
258
+ <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="32"<?php if( !$options['icon_size'] || $options['icon_size']=='32' ) echo ' checked="checked"'; ?>> <?php _e('Large', 'add-to-any'); ?></label>
259
+ <br>
260
+ <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="16"<?php if($options['icon_size']=='16') echo ' checked="checked"'; ?>> <?php _e('Small', 'add-to-any'); ?></label>
261
+ </fieldset></td>
262
+ </tr>
263
+
264
+ <tr valign="top">
265
+ <th scope="row"><?php _e("Standalone Buttons", "add-to-any"); ?></th>
266
+ <td><fieldset>
267
+ <ul id="addtoany_services_sortable" class="addtoany_admin_list addtoany_override a2a_kit_size_32">
268
+ <li class="dummy"><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/transparent.gif" width="16" height="16" alt="" /></li>
269
+ </ul>
270
+ <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", "add-to-any"); ?></p>
271
+ <ul id="addtoany_services_selectable" class="addtoany_admin_list">
272
+ <li id="a2a_wp_facebook_like" class="addtoany_special_service" title="Facebook Like button">
273
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
274
+ </li>
275
+ <li id="a2a_wp_twitter_tweet" class="addtoany_special_service" title="Twitter Tweet button">
276
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
277
+ </li>
278
+ <li id="a2a_wp_google_plusone" class="addtoany_special_service" title="Google +1 button">
279
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
280
+ </li>
281
+ <li id="a2a_wp_google_plus_share" class="addtoany_special_service" title="Google+ Share button">
282
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="57" height="20" alt="Google+ Share" /></span>
283
+ </li>
284
+ <li id="a2a_wp_pinterest_pin" class="addtoany_special_service" title="Pinterest Pin It button">
285
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin.png'; ?>" width="40" height="20" alt="Pinterest Pin It" /></span>
286
+ </li>
287
+ <?php
288
+ // Show all services
289
+ foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
290
+ if (isset($site['href']))
291
+ $custom_service = TRUE;
292
+ else
293
+ $custom_service = FALSE;
294
+ if ( ! isset($site['icon']))
295
+ $site['icon'] = 'default';
296
+ ?>
297
+ <li data-addtoany-icon-name="<?php echo $site['icon']; ?>" id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
298
+ <span><img src="<?php echo (isset($site['icon_url'])) ? $site['icon_url'] : $A2A_SHARE_SAVE_plugin_url_path.'/icons/'.$site['icon'].'.png'; ?>" width="<?php echo (isset($site['icon_width'])) ? $site['icon_width'] : '16'; ?>" height="<?php echo (isset($site['icon_height'])) ? $site['icon_height'] : '16'; ?>" alt="" /><?php echo $site['name']; ?></span>
299
+ </li>
300
+ <?php
301
+ } ?>
302
+ </ul>
303
+ </fieldset></td>
304
+ </tr>
305
+
306
+ <tr valign="top">
307
+ <th scope="row"><?php _e("Universal Button", "add-to-any"); ?></th>
308
+ <td><fieldset>
309
+ <div class="addtoany_icon_size_large">
310
+ <label class="addtoany_override a2a_kit_size_32">
311
+ <input name="A2A_SHARE_SAVE_button" value="A2A_SVG_32" type="radio"<?php if( !$options['button'] || $options['button']=='A2A_SVG_32' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
312
+ <span class="a2a_svg a2a_s_a2a" onclick="this.parentNode.firstChild.checked=true" style="margin-left:9px"></span>
313
+ </label>
314
+ <br>
315
+ </div>
316
+
317
+ <div class="addtoany_icon_size_small">
318
+ <label>
319
+ <input name="A2A_SHARE_SAVE_button" value="favicon.png|16|16" id="A2A_SHARE_SAVE_button_is_favicon_16" type="radio"<?php if($options['button']=='favicon.png|16|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
320
+ <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/favicon.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share','add-to-any'); ?>" title="+ <?php _e('Share','add-to-any'); ?>" onclick="this.parentNode.firstChild.checked=true"/>
321
+ </label>
322
+ <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_favicon_16').checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
323
+ <label style="padding-left:9px">
324
+ <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" id="A2A_SHARE_SAVE_button_is_share_icon_16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
325
+ <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_16_16.png'; ?>" width="16" height="16" border="0" style="padding:9px;vertical-align:middle" alt="+ <?php _e('Share','add-to-any'); ?>" title="+ <?php _e('Share','add-to-any'); ?>" onclick="this.parentNode.firstChild.checked=true"/>
326
+ </label>
327
+ <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_share_icon_16').checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
328
+ <br>
329
+ <label>
330
+ <input name="A2A_SHARE_SAVE_button" value="share_save_120_16.png|120|16" type="radio"<?php if($options['button']=='share_save_120_16.png|120|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
331
+ <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_120_16.png'; ?>" width="120" height="16" border="0" style="padding:9px;vertical-align:middle" onclick="this.parentNode.firstChild.checked=true"/>
332
+ </label>
333
+ <br>
334
+ <label>
335
+ <input name="A2A_SHARE_SAVE_button" value="share_save_171_16.png|171|16" type="radio"<?php if($options['button']=='share_save_171_16.png|171|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
336
+ <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_171_16.png'; ?>" width="171" height="16" border="0" style="padding:9px;vertical-align:middle" onclick="this.parentNode.firstChild.checked=true"/>
337
+ </label>
338
+ <br>
339
+ <label>
340
+ <input name="A2A_SHARE_SAVE_button" value="share_save_256_24.png|256|24" type="radio"<?php if($options['button']=='share_save_256_24.png|256|24') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
341
+ <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/share_save_256_24.png'; ?>" width="256" height="24" border="0" style="padding:9px;vertical-align:middle" onclick="this.parentNode.firstChild.checked=true"/>
342
+ </label>
343
+ <br>
344
+ </div>
345
+
346
+ <label>
347
+ <input name="A2A_SHARE_SAVE_button" value="CUSTOM" id="A2A_SHARE_SAVE_button_is_custom" type="radio"<?php if( $options['button'] == 'CUSTOM' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
348
+ <span style="margin:0 9px;vertical-align:middle"><?php _e("Image URL"); ?>:</span>
349
+ </label>
350
+ <input name="A2A_SHARE_SAVE_button_custom" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_custom').checked=true" style="vertical-align:middle" value="<?php echo $options['button_custom']; ?>" />
351
+ <br>
352
+ <label>
353
+ <input name="A2A_SHARE_SAVE_button" value="TEXT" id="A2A_SHARE_SAVE_button_is_text" type="radio"<?php if( $options['button'] == 'TEXT' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
354
+ <span style="margin:0 9px;vertical-align:middle"><?php _e("Text only"); ?>:</span>
355
+ </label>
356
+ <input name="A2A_SHARE_SAVE_button_text" type="text" class="code" size="50" onclick="document.getElementById('A2A_SHARE_SAVE_button_is_text').checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
357
+ <br>
358
+ <label>
359
+ <input name="A2A_SHARE_SAVE_button" value="NONE" type="radio"<?php if( $options['button'] == 'NONE' ) echo ' checked="checked"'; ?> onclick="return confirm('<?php _e('This option will disable universal sharing. Are you sure you want to disable universal sharing?', 'add-to-any' ) ?>')" style="margin:9px 0;vertical-align:middle">
360
+ <span style="margin:0 9px;vertical-align:middle"><?php _e("None"); ?></span>
361
+ </label>
362
+
363
+ </fieldset></td>
364
+ </tr>
365
+ <tr valign="top">
366
+ <th scope="row"><?php _e('Placement', 'add-to-any'); ?></th>
367
+ <td><fieldset>
368
+ <label>
369
+ <input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
370
+ if($options['display_in_posts']!='-1') echo ' checked="checked"'; ?> value="1"/>
371
+ <?php printf(__('Display at the %s of posts', 'add-to-any'), position_in_content($options, TRUE)); ?> <strong>*</strong>
372
+ </label>
373
+ <br/>
374
+ <label>
375
+ &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
376
+ if($options['display_in_excerpts']!='-1') echo ' checked="checked"';
377
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
378
+ ?> value="1"/>
379
+ <?php printf(__('Display at the %s of post excerpts', 'add-to-any'), position_in_content($options)); ?>
380
+ </label>
381
+ <br/>
382
+ <label>
383
+ &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts_on_front_page" type="checkbox"<?php
384
+ if($options['display_in_posts_on_front_page']!='-1') echo ' checked="checked"';
385
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
386
+ ?> value="1"/>
387
+ <?php printf(__('Display at the %s of posts on the front page', 'add-to-any'), position_in_content($options)); ?>
388
+ </label>
389
+ <br/>
390
+ <label>
391
+ &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts_on_archive_pages" type="checkbox"<?php
392
+ if($options['display_in_posts_on_archive_pages']!='-1') echo ' checked="checked"';
393
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
394
+ ?> value="1"/>
395
+ <?php printf(__('Display at the %s of posts on archive pages', 'add-to-any'), position_in_content($options)); ?>
396
+ </label>
397
+ <br/>
398
+ <label>
399
+ &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
400
+ if($options['display_in_feed']!='-1') echo ' checked="checked"';
401
+ if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
402
+ ?> value="1"/>
403
+ <?php printf(__('Display at the %s of posts in the feed', 'add-to-any'), position_in_content($options)); ?>
404
+ </label>
405
+ <br/>
406
+ <label>
407
+ <input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if($options['display_in_pages']!='-1') echo ' checked="checked"'; ?> value="1"/>
408
+ <?php printf(__('Display at the %s of pages', 'add-to-any'), position_in_content($options, TRUE)); ?>
409
+ </label>
410
+ <br/><br/>
411
+ <div class="setting-description">
412
+ <strong>*</strong> <?php _e("If unchecked, be sure to place the following code in <a href=\"theme-editor.php\">your template pages</a> (within <code>index.php</code>, <code>single.php</code>, and/or <code>page.php</code>)", "add-to-any"); ?>: <span id="addtoany_show_template_button_code" class="button-secondary">&#187;</span>
413
+ <div id="addtoany_template_button_code">
414
+ <code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code>
415
+ </div>
416
+ <noscript><code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code></noscript>
417
+ </div>
418
+ </fieldset></td>
419
+ </tr>
420
+ <tr valign="top">
421
+ <th scope="row"><?php _e('Menu Style', 'add-to-any'); ?></th>
422
+ <td><fieldset>
423
+ <p><?php _e("Using AddToAny's Menu Styler, you can customize the colors of your Share/Save menu! When you're done, be sure to paste the generated code in the <a href=\"#\" onclick=\"document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus();return false\">Additional Options</a> box below.", "add-to-any"); ?></p>
424
+ <p>
425
+ <a href="http://www.addtoany.com/buttons/share_save/menu_style/wordpress" class="button-secondary" title="<?php _e("Open the AddToAny Menu Styler in a new window", "add-to-any"); ?>" target="_blank" onclick="document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus(); document.getElementById('A2A_SHARE_SAVE_menu_styler_note').style.display='';"><?php _e("Open Menu Styler", "add-to-any"); ?></a>
426
+ </p>
427
+ </fieldset></td>
428
+ </tr>
429
+ <tr valign="top">
430
+ <th scope="row"><?php _e('Menu Options', 'add-to-any'); ?></th>
431
+ <td><fieldset>
432
+ <label>
433
+ <input name="A2A_SHARE_SAVE_onclick" type="checkbox"<?php if($options['onclick']=='1') echo ' checked="checked"'; ?> value="1"/>
434
+ <?php _e('Only show the menu when the user clicks the Share/Save button', 'add-to-any'); ?>
435
+ </label>
436
+ <br />
437
+ <label>
438
+ <input name="A2A_SHARE_SAVE_show_title" type="checkbox"<?php if($options['show_title']=='1') echo ' checked="checked"'; ?> value="1"/>
439
+ <?php _e('Show the title of the post (or page) within the menu', 'add-to-any'); ?>
440
+ </label>
441
+ </fieldset></td>
442
+ </tr>
443
+ <tr valign="top">
444
+ <th scope="row"><?php _e('Additional Options', 'add-to-any'); ?></th>
445
+ <td><fieldset>
446
+ <p id="A2A_SHARE_SAVE_menu_styler_note" style="display:none">
447
+ <label for="A2A_SHARE_SAVE_additional_js_variables" class="updated">
448
+ <strong><?php _e("Paste the code from AddToAny's Menu Styler in the box below!", 'add-to-any'); ?></strong>
449
+ </label>
450
+ </p>
451
+ <label for="A2A_SHARE_SAVE_additional_js_variables">
452
+ <p><?php _e('Below you can set special JavaScript variables to apply to each Share/Save menu.', 'add-to-any'); ?>
453
+ <?php _e("Advanced users might want to explore AddToAny's <a href=\"http://www.addtoany.com/buttons/customize/\" target=\"_blank\">additional options</a>.", "add-to-any"); ?></p>
454
+ </label>
455
+ <p>
456
+ <textarea name="A2A_SHARE_SAVE_additional_js_variables" id="A2A_SHARE_SAVE_additional_js_variables" class="code" style="width: 98%; font-size: 12px;" rows="6" cols="50"><?php echo stripslashes($options['additional_js_variables']); ?></textarea>
457
+ </p>
458
+ <?php if( $options['additional_js_variables']!='' ) { ?>
459
+ <label for="A2A_SHARE_SAVE_additional_js_variables" class="setting-description"><?php _e("<strong>Note</strong>: If you're adding new code, be careful not to accidentally overwrite any previous code.</label>", 'add-to-any'); ?>
460
+ <?php } ?>
461
+ </fieldset></td>
462
+ </tr>
463
+ <tr valign="top">
464
+ <th scope="row"><?php _e('Advanced Options', 'add-to-any'); ?></th>
465
+ <td><fieldset>
466
+ <label for="A2A_SHARE_SAVE_inline_css">
467
+ <input name="A2A_SHARE_SAVE_inline_css" id="A2A_SHARE_SAVE_inline_css" type="checkbox"<?php if($options['inline_css']!='-1') echo ' checked="checked"'; ?> value="1"/>
468
+ <?php _e('Use CSS stylesheet', 'add-to-any'); ?>
469
+ </label>
470
+ <br/>
471
+ <label for="A2A_SHARE_SAVE_cache">
472
+ <input name="A2A_SHARE_SAVE_cache" id="A2A_SHARE_SAVE_cache" type="checkbox"<?php if($options['cache']=='1') echo ' checked="checked"'; ?> value="1"/>
473
+ <?php _e('Cache AddToAny locally with daily cache updates', 'add-to-any'); ?> <strong>**</strong>
474
+ </label>
475
+ <br/><br/>
476
+ <div class="setting-description">
477
+ <strong>**</strong> <?php _e("Only consider for sites with frequently returning visitors. Since many visitors will have AddToAny cached in their browser already, serving AddToAny locally from your site will be slower for those visitors. Be sure to set far future cache/expires headers for image files in your <code>uploads/addtoany</code> directory.", "add-to-any"); ?>
478
+ </div>
479
+ </fieldset></td>
480
+ </tr>
481
+ </table>
482
+
483
+ <p class="submit">
484
+ <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Changes', 'add-to-any' ) ?>" />
485
+ <input id="A2A_SHARE_SAVE_reset_options" type="submit" name="Reset" onclick="return confirm('<?php _e('Are you sure you want to delete all AddToAny options?', 'add-to-any' ) ?>')" value="<?php _e('Reset', 'add-to-any' ) ?>" />
486
+ </p>
487
+
488
+ </form>
489
+
490
+ <h2><?php _e('Like this plugin?','add-to-any'); ?></h2>
491
+ <p><?php _e('<a href="http://wordpress.org/extend/plugins/add-to-any/">Give it a good rating</a> on WordPress.org.','add-to-any'); ?> <a href="http://www.facebook.com/AddToAny">Facebook</a> / <a href="http://twitter.com/AddToAny">Twitter</a></p>
492
+ <p><?php _e('<a href="http://www.addtoany.com/share_save?linkname=WordPress%20Share%20%2F%20Bookmark%20Plugin%20by%20AddToAny.com&amp;linkurl=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fadd-to-any%2F">Share it</a> with your friends.','add-to-any'); ?></p>
493
+
494
+ <h2><?php _e('Need support?','add-to-any'); ?></h2>
495
+ <p><?php _e('See the <a href="http://wordpress.org/extend/plugins/add-to-any/faq/">FAQs</a>.','add-to-any'); ?></p>
496
+ <p><?php _e('Search the <a href="http://wordpress.org/tags/add-to-any">support forums</a>.','add-to-any'); ?></p>
497
+ </div>
498
+
499
+ <script type="text/javascript" src="http<?php if ( is_ssl() ) echo 's'; ?>://static.addtoany.com/menu/page.js"></script>
500
+ <script type="text/javascript">if ( a2a && a2a.svg_css ) a2a.svg_css();</script>
501
+
502
+ <?php
503
+
504
+ }
505
+
506
+ // Admin page header
507
+ function A2A_SHARE_SAVE_admin_head() {
508
+ if (isset($_GET['page']) && $_GET['page'] == 'add-to-any.php') {
509
+
510
+ $options = get_option('addtoany_options');
511
+
512
+ ?>
513
+ <script type="text/javascript"><!--
514
+ jQuery(document).ready(function(){
515
+
516
+ var show_appropriate_universal_buttons = function() {
517
+
518
+ // Note the currently checkmarked radio button
519
+ jQuery('input[name="A2A_SHARE_SAVE_button"]:visible').removeClass('addtoany_last_universal_selected').filter(':checked').addClass('addtoany_last_universal_selected');
520
+
521
+ var select_proper_radio = function() {
522
+ // Select the last-selected visible radio
523
+ jQuery('input[name="A2A_SHARE_SAVE_button"].addtoany_last_universal_selected:radio:visible').attr('checked', true);
524
+
525
+ // Otherwise select the first visible radio
526
+ if ( jQuery('input[name="A2A_SHARE_SAVE_button"]:visible:checked').length < 1 )
527
+ jQuery('input[name="A2A_SHARE_SAVE_button"]:radio:visible:first').attr('checked', true);
528
+ };
529
+
530
+ if ( jQuery('input[name="A2A_SHARE_SAVE_icon_size"]:checked').val() == '32' ) {
531
+ // Hide small universal buttons
532
+ jQuery('.addtoany_icon_size_small').hide('fast');
533
+ // Show large universal button
534
+ jQuery('.addtoany_icon_size_large').show('fast', select_proper_radio);
535
+
536
+ // Switch to large standalone icons
537
+ jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_special_service, #addtoany_show_services').html(function() {
538
+ return jQuery(this).data('a2a_32_icon_html');
539
+ });
540
+
541
+ // Adjust the Add/Remove Services button
542
+ jQuery('#addtoany_show_services').addClass('addtoany_line_height_32');
543
+ }
544
+ else {
545
+ // Hide small universal buttons
546
+ jQuery('.addtoany_icon_size_large').hide('fast');
547
+ // Show large universal button
548
+ jQuery('.addtoany_icon_size_small').show('fast', select_proper_radio);
549
+
550
+ // Switch to small standalone icons
551
+ jQuery('#addtoany_services_sortable li').not('.dummy, .addtoany_special_service, #addtoany_show_services').html(function() {
552
+ return jQuery(this).data('a2a_16_icon_html');
553
+ });
554
+
555
+ // Adjust the Add/Remove Services button
556
+ jQuery('#addtoany_show_services').removeClass('addtoany_line_height_32');
557
+ }
558
+ };
559
+
560
+ show_appropriate_universal_buttons();
561
+
562
+ // Display buttons/icons of the selected icon size
563
+ jQuery('input[name="A2A_SHARE_SAVE_icon_size"]').bind('change', function(e){
564
+ show_appropriate_universal_buttons();
565
+ });
566
+
567
+ // Toggle child options of 'Display in posts'
568
+ jQuery('#A2A_SHARE_SAVE_display_in_posts').bind('change click', function(e){
569
+ if (jQuery(this).is(':checked'))
570
+ jQuery('.A2A_SHARE_SAVE_child_of_display_in_posts').attr('checked', true).attr('disabled', false);
571
+ else
572
+ jQuery('.A2A_SHARE_SAVE_child_of_display_in_posts').attr('checked', false).attr('disabled', true);
573
+ });
574
+
575
+ // Update button position labels/values universally in Placement section
576
+ jQuery('select[name="A2A_SHARE_SAVE_position"]').bind('change click', function(e){
577
+ var $this = jQuery(this);
578
+ jQuery('select[name="A2A_SHARE_SAVE_position"]').not($this).val($this.val());
579
+
580
+ jQuery('.A2A_SHARE_SAVE_position').html($this.find('option:selected').html());
581
+ });
582
+
583
+ var to_input = function(this_sortable){
584
+ // Clear any previous hidden inputs for storing chosen services
585
+ // and special service options
586
+ jQuery('input.addtoany_hidden_options').remove();
587
+
588
+ var services_array = jQuery(this_sortable).sortable('toArray'),
589
+ services_size = services_array.length;
590
+ if(services_size<1) return;
591
+
592
+ for(var i=0, service_name, show_count_value, fb_verb_value; i < services_size; i++){
593
+ if(services_array[i]!='') { // Exclude dummy icon
594
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="A2A_SHARE_SAVE_active_services[]" type="hidden" value="'+services_array[i]+'"/>');
595
+
596
+ // Special service options?
597
+ service_name = services_array[i].substr(7);
598
+ if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
599
+ if (service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
600
+ show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
601
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
602
+ }
603
+
604
+ if (service_name == 'facebook_like') {
605
+ fb_verb_value = (jQuery('#' + services_array[i] + '_verb').val() == 'recommend') ? 'recommend' : 'like';
606
+ jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_verb" type="hidden" value="' + fb_verb_value + '"/>');
607
+ }
608
+ }
609
+ }
610
+ }
611
+ };
612
+
613
+ jQuery('#addtoany_services_sortable').sortable({
614
+ forcePlaceholderSize: true,
615
+ items: 'li:not(#addtoany_show_services, .dummy)',
616
+ placeholder: 'ui-sortable-placeholder',
617
+ opacity: .6,
618
+ tolerance: 'pointer',
619
+ update: function(){to_input(this)}
620
+ });
621
+
622
+ // Service click = move to sortable list
623
+ var moveToSortableList = function(){
624
+ var configurable_html = '',
625
+ this_service = jQuery(this),
626
+ this_service_name = this_service.attr('id').substr(7),
627
+ this_service_is_special = this_service.hasClass('addtoany_special_service'),
628
+ checked = '',
629
+ special_options_html = '';
630
+
631
+ if (jQuery('#addtoany_services_sortable li').not('.dummy').length == 0)
632
+ jQuery('#addtoany_services_sortable').find('.dummy').hide();
633
+
634
+ if (this_service_is_special) {
635
+ if (this_service_name == 'facebook_like') {
636
+ if (service_options[this_service_name] && service_options[this_service_name].verb)
637
+ checked = ' selected="selected"';
638
+ special_options_html = '<select id="' + this_service.attr('id') + '_verb" name="' + this_service.attr('id') + '_verb">'
639
+ + '<option value="like">Like</option>'
640
+ + '<option' + checked + ' value="recommend">Recommend</option>'
641
+ + '</select>';
642
+ } else {
643
+ // twitter_tweet & google_plusone & google_plus_share & pinterest_pin
644
+ if (service_options[this_service_name] && service_options[this_service_name].show_count) {
645
+ checked = ' checked="checked"';
646
+ }
647
+ special_options_html = '<label><input' + checked + ' id="' + this_service.attr('id') + '_show_count" name="' + this_service.attr('id') + '_show_count" type="checkbox" value="1"> Show count</label>';
648
+ }
649
+
650
+ configurable_html = '<span class="down_arrow"></span><br style="clear:both"/><div class="special_options">' + special_options_html + '</div>';
651
+ }
652
+
653
+ var icon_size = jQuery('input:radio[name=A2A_SHARE_SAVE_icon_size]:checked').val();
654
+ new_service = this_service.toggleClass('addtoany_selected')
655
+ .unbind('click', moveToSortableList)
656
+ .bind('click', moveToSelectableList)
657
+ .clone();
658
+
659
+ new_service.data('a2a_16_icon_html', this_service.find('img').clone().attr('alt', this_service.attr('title')).wrap('<p>').parent().html() + configurable_html);
660
+
661
+ if (this_service_is_special)
662
+ // If special service, set the same HTML as used for '16px icon size'
663
+ new_service.data( 'a2a_32_icon_html', new_service.data('a2a_16_icon_html') );
664
+ else
665
+ // Set HTML for 32px icon size
666
+ new_service.data( 'a2a_32_icon_html', '<span class="a2a_svg a2a_s__default a2a_s_' + this_service.attr('data-addtoany-icon-name') + '"></span>' );
667
+
668
+ new_service.html( new_service.data('a2a_' + icon_size + '_icon_html') )
669
+ .click(function(){
670
+ jQuery(this).not('.addtoany_special_service_options_selected').find('.special_options').slideDown('fast').parent().addClass('addtoany_special_service_options_selected');
671
+ })
672
+ .hide()
673
+ .insertBefore('#addtoany_services_sortable .dummy')
674
+ .fadeIn('fast');
675
+
676
+ this_service.attr( 'id', 'old_'+this_service.attr('id') );
677
+ };
678
+
679
+ // Service click again = move back to selectable list
680
+ var moveToSelectableList = function(){
681
+ jQuery(this).toggleClass('addtoany_selected')
682
+ .unbind('click', moveToSelectableList)
683
+ .bind('click', moveToSortableList);
684
+
685
+ jQuery( '#'+jQuery(this).attr('id').substr(4).replace(/\./, '\\.') )
686
+ .hide('fast', function(){
687
+ jQuery(this).remove();
688
+ });
689
+
690
+
691
+ if( jQuery('#addtoany_services_sortable li').not('.dummy').length==1 )
692
+ jQuery('#addtoany_services_sortable').find('.dummy').show();
693
+
694
+ jQuery(this).attr('id', jQuery(this).attr('id').substr(4));
695
+ };
696
+
697
+ // Service click = move to sortable list
698
+ jQuery('#addtoany_services_selectable li').bind('click', moveToSortableList);
699
+
700
+ // Form submit = get sortable list
701
+ jQuery('#addtoany_admin_form').submit(function(){to_input('#addtoany_services_sortable')});
702
+
703
+ // Auto-select active services
704
+ <?php
705
+ $admin_services_saved = isset($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
706
+ $active_services = ( $admin_services_saved ) ? @$_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
707
+
708
+ // Use default services if options have not been set yet (and no services were just saved in the form)
709
+ if ( false === $options && ! $admin_services_saved )
710
+ $active_services = array( 'facebook', 'twitter', 'google_plus' );
711
+ elseif ( empty( $active_services ) )
712
+ $active_services = array();
713
+
714
+ $active_services_last = end($active_services);
715
+ if($admin_services_saved)
716
+ $active_services_last = substr($active_services_last, 7); // Remove a2a_wp_
717
+ $active_services_quoted = '';
718
+ foreach ($active_services as $service) {
719
+ if($admin_services_saved)
720
+ $service = substr($service, 7); // Remove a2a_wp_
721
+ $active_services_quoted .= '"' . esc_js( $service ) . '"';
722
+ if ( $service != $active_services_last )
723
+ $active_services_quoted .= ',';
724
+ }
725
+ ?>
726
+ var services = [<?php echo $active_services_quoted; ?>],
727
+ service_options = {};
728
+
729
+ <?php
730
+ // Special service options
731
+ if ( isset($_POST['addtoany_facebook_like_verb']) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
732
+ || ! isset($_POST['addtoany_facebook_like_verb']) && $options['special_facebook_like_options']['verb'] == 'recommend') {
733
+ ?>service_options.facebook_like = {verb: 'recommend'};<?php
734
+ }
735
+ if ( isset($_POST['addtoany_twitter_tweet_show_count']) && $_POST['addtoany_twitter_tweet_show_count'] == '1'
736
+ || ! isset($_POST['addtoany_twitter_tweet_show_count']) && $options['special_twitter_tweet_options']['show_count'] == '1') {
737
+ ?>service_options.twitter_tweet = {show_count: 1};<?php
738
+ }
739
+ if ( isset($_POST['addtoany_google_plusone_show_count']) && $_POST['addtoany_google_plusone_show_count'] == '1'
740
+ || ! isset($_POST['addtoany_google_plusone_show_count']) && $options['special_google_plusone_options']['show_count'] == '1') {
741
+ ?>service_options.google_plusone = {show_count: 1};<?php
742
+ }
743
+ if ( isset($_POST['addtoany_google_plus_share_show_count']) && $_POST['addtoany_google_plus_share_show_count'] == '1'
744
+ || ! isset($_POST['addtoany_google_plus_share_show_count']) && $options['special_google_plus_share_options']['show_count'] == '1') {
745
+ ?>service_options.google_plus_share = {show_count: 1};<?php
746
+ }
747
+ if ( isset($_POST['addtoany_pinterest_pin_show_count']) && $_POST['addtoany_pinterest_pin_show_count'] == '1'
748
+ || ! isset($_POST['addtoany_pinterest_pin_show_count']) && $options['special_pinterest_pin_options']['show_count'] == '1') {
749
+ ?>service_options.pinterest_pin = {show_count: 1};<?php
750
+ }
751
+ ?>
752
+
753
+ jQuery.each(services, function(i, val){
754
+ jQuery('#a2a_wp_'+val).click();
755
+ });
756
+
757
+ // Add/Remove Services button
758
+ jQuery('#addtoany_services_sortable .dummy:first').after('<li id="addtoany_show_services"><?php _e('Add/Remove Services', 'add-to-any'); ?> &#187;</li>');
759
+ jQuery('#addtoany_show_services').click(function(e){
760
+ jQuery('#addtoany_services_selectable, #addtoany_services_info').slideDown('fast');
761
+ jQuery(this).fadeOut('fast');
762
+ });
763
+
764
+ // Adjust the Add/Remove Services button for large or small icons
765
+ if ( jQuery('input:radio[name=A2A_SHARE_SAVE_icon_size]:checked').val() == '32' )
766
+ jQuery('#addtoany_show_services').addClass('addtoany_line_height_32');
767
+
768
+ // 'Show template code' button
769
+ jQuery('#addtoany_show_template_button_code').click(function(e){
770
+ jQuery('#addtoany_template_button_code').slideDown('fast');
771
+ jQuery(this).fadeOut('fast');
772
+ });
773
+
774
+ // TBD
775
+ jQuery('#addtoany_show_css_code').click(function(e){
776
+ jQuery('#addtoany_css_code').slideDown('fast');
777
+ jQuery(this).fadeOut('fast');
778
+ });
779
+ });
780
+ --></script>
781
+
782
+ <style type="text/css">
783
+ .ui-sortable-placeholder{background-color:transparent;border:1px dashed #AAA !important;}
784
+ .addtoany_admin_list{list-style:none;padding:0;margin:0;}
785
+ .addtoany_admin_list li{-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}
786
+
787
+ #addtoany_services_selectable{clear:left;display:none;}
788
+ #addtoany_services_selectable li{cursor:pointer;float:left;width:150px;font-size:11px;margin:0;padding:6px;border:1px solid transparent;_border-color:#FAFAFA/*IE6*/;overflow:hidden;}
789
+ <?php // white-space:nowrap could go above, but then webkit does not wrap floats if parent has no width set; wrapping in <span> instead (below) ?>
790
+ #addtoany_services_selectable li span{white-space:nowrap;}
791
+ #addtoany_services_selectable li:hover, #addtoany_services_selectable li.addtoany_selected{border:1px solid #AAA;background-color:#FFF;}
792
+ #addtoany_services_selectable li.addtoany_selected:hover{border-color:#F00;}
793
+ #addtoany_services_selectable li:active{border:1px solid #000;}
794
+ #addtoany_services_selectable img{margin:0 4px;width:16px;height:16px;border:0;vertical-align:middle;}
795
+ #addtoany_services_selectable .addtoany_special_service{padding:3px 6px;}
796
+ #addtoany_services_selectable .addtoany_special_service img{width:auto;height:20px;}
797
+
798
+ #addtoany_services_sortable li, #addtoany_services_sortable li.dummy:hover{cursor:move;float:left;padding:9px;border:1px solid transparent;_border-color:#FAFAFA/*IE6*/;}
799
+ #addtoany_services_sortable li:hover{border:1px solid #AAA;background-color:#FFF;}
800
+ #addtoany_services_sortable li.dummy, #addtoany_services_sortable li.dummy:hover{cursor:auto;background-color:transparent;}
801
+ #addtoany_services_sortable img{width:16px;height:16px;border:0;vertical-align:middle;}
802
+ #addtoany_services_sortable .addtoany_special_service img{width:auto;height:20px;float:left;}
803
+ #addtoany_services_sortable .addtoany_special_service span.down_arrow{background:url(<?php echo admin_url( '/images/arrows.png' ); ?>) no-repeat 5px 9px;float:right;height:29px;;margin:-6px 0 -6px 4px;width:26px;}
804
+ #addtoany_services_sortable .addtoany_special_service div.special_options{display:none;font-size:11px;margin-top:9px;}
805
+ #addtoany_services_sortable .addtoany_special_service_options_selected{border:1px solid #AAA;background-color:#FFF;}
806
+ #addtoany_services_sortable .addtoany_special_service_options_selected span.down_arrow{display:none;}
807
+
808
+ li#addtoany_show_services.addtoany_line_height_32{line-height:32px}
809
+ li#addtoany_show_services{border:1px solid #DFDFDF;background-color:#FFF;cursor:pointer;margin-left:9px;}
810
+ li#addtoany_show_services:hover{border:1px solid #AAA;}
811
+ #addtoany_services_info{clear:left;display:none;margin:10px;}
812
+
813
+ .a2a_kit_size_32.addtoany_override .a2a_svg {
814
+ border-radius: 4px;
815
+ display:inline-block;
816
+ height: 32px;
817
+ vertical-align:middle;
818
+ width: 32px;
819
+ }
820
+
821
+ #addtoany_template_button_code, #addtoany_css_code{display:none;}
822
+
823
+ #A2A_SHARE_SAVE_reset_options{color:red;margin-left: 15px;}
824
+ </style>
825
+ <?php
826
+
827
+ }
828
+ }
829
+
830
+ add_filter('admin_head', 'A2A_SHARE_SAVE_admin_head');
831
+
832
+
833
+
834
+ function A2A_SHARE_SAVE_scripts() {
835
+ wp_enqueue_script('jquery-ui-sortable');
836
+ }
services.php → addtoany.services.php RENAMED
File without changes
add-to-any-wp-widget.php → addtoany.widget.php RENAMED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
 
3
  class A2A_SHARE_SAVE_Widget extends WP_Widget {
4
  /** constructor */
@@ -56,7 +60,7 @@ class A2A_SHARE_SAVE_Widget extends WP_Widget {
56
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
57
  </p>
58
  <p>
59
- <a href="options-general.php?page=add-to-any.php"><?php _e("Settings", "add-to-any"); ?>...</a>
60
  </p>
61
  <?php
62
  }
1
  <?php
2
+
3
+ /**
4
+ * AddToAny WordPress Widget
5
+ */
6
 
7
  class A2A_SHARE_SAVE_Widget extends WP_Widget {
8
  /** constructor */
60
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
61
  </p>
62
  <p>
63
+ <a href="options-general.php?page=add-to-any.php"><?php _e("AddToAny Settings", "add-to-any"); ?>...</a>
64
  </p>
65
  <?php
66
  }
icons/email.png CHANGED
Binary file