AddToAny Share Buttons - Version 1.2.2

Version Description

  • Fix code format issues
Download this release

Release Info

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

Code changes from version 1.2.1 to 1.2.2

Files changed (3) hide show
  1. README.txt +4 -1
  2. add-to-any-wp-widget.php +10 -11
  3. add-to-any.php +251 -274
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, messenger, stumbleupon, technorati, lockerz, addthis, sexybookmarks, sociable, sharedaddy, shareaholic, icon, icons, vector, SVG, wpmu, addtoany
4
  Requires at least: 2.8
5
  Tested up to: 3.7
6
- Stable tag: 1.2.1
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
@@ -225,6 +225,9 @@ Upload the plugin directory (including all files and directories within) to the
225
 
226
  == Changelog ==
227
 
 
 
 
228
  = 1.2.1 =
229
  * Checkbox option to disable sharing buttons on each post and page
230
 
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, messenger, stumbleupon, technorati, lockerz, addthis, sexybookmarks, sociable, sharedaddy, shareaholic, icon, icons, vector, SVG, wpmu, addtoany
4
  Requires at least: 2.8
5
  Tested up to: 3.7
6
+ Stable tag: 1.2.2
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
225
 
226
  == Changelog ==
227
 
228
+ = 1.2.2 =
229
+ * Fix code format issues
230
+
231
  = 1.2.1 =
232
  * Checkbox option to disable sharing buttons on each post and page
233
 
add-to-any-wp-widget.php CHANGED
@@ -2,16 +2,16 @@
2
 
3
  class A2A_SHARE_SAVE_Widget extends WP_Widget {
4
  /** constructor */
5
- function A2A_SHARE_SAVE_Widget() {
6
- parent::WP_Widget('', 'AddToAny Sharing', array('description' => 'Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more.'), array('width' => 400));
7
- }
8
 
9
  /** Backwards compatibility for A2A_SHARE_SAVE_Widget::display(); usage */
10
  function display( $args = false ) {
11
  self::widget($args, NULL);
12
  }
13
 
14
- /** @see WP_Widget::widget */
15
  function widget($args = array(), $instance) {
16
 
17
  global $A2A_SHARE_SAVE_plugin_url_path;
@@ -41,25 +41,24 @@ class A2A_SHARE_SAVE_Widget extends WP_Widget {
41
  }
42
 
43
  /** @see WP_Widget::update */
44
- function update($new_instance, $old_instance) {
45
  $instance = $old_instance;
46
  $instance['title'] = strip_tags($new_instance['title']);
47
  return $instance;
48
- }
49
 
50
  /** @see WP_Widget::form */
51
- function form($instance) {
52
- $title = (isset($instance) && isset($instance['title'])) ? esc_attr($instance['title']) : '';
53
  ?>
54
  <p>
55
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
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
- }
63
 
64
  }
65
-
2
 
3
  class A2A_SHARE_SAVE_Widget extends WP_Widget {
4
  /** constructor */
5
+ function A2A_SHARE_SAVE_Widget() {
6
+ parent::WP_Widget('', 'AddToAny Sharing', array('description' => 'Help people share, bookmark, and email your posts & pages using any service, such as Facebook, Twitter, StumbleUpon, Digg and many more.'), array('width' => 400));
7
+ }
8
 
9
  /** Backwards compatibility for A2A_SHARE_SAVE_Widget::display(); usage */
10
  function display( $args = false ) {
11
  self::widget($args, NULL);
12
  }
13
 
14
+ /** @see WP_Widget::widget */
15
  function widget($args = array(), $instance) {
16
 
17
  global $A2A_SHARE_SAVE_plugin_url_path;
41
  }
42
 
43
  /** @see WP_Widget::update */
44
+ function update($new_instance, $old_instance) {
45
  $instance = $old_instance;
46
  $instance['title'] = strip_tags($new_instance['title']);
47
  return $instance;
48
+ }
49
 
50
  /** @see WP_Widget::form */
51
+ function form($instance) {
52
+ $title = (isset($instance) && isset($instance['title'])) ? esc_attr($instance['title']) : '';
53
  ?>
54
  <p>
55
  <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
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
+ }
63
 
64
  }
 
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.1
7
  Author: micropat
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -45,10 +45,10 @@ function A2A_SHARE_SAVE_init() {
45
  $A2A_SHARE_SAVE_options;
46
 
47
  if (get_option('A2A_SHARE_SAVE_button')) {
48
- A2A_SHARE_SAVE_migrate_options();
49
- $A2A_SHARE_SAVE_options = get_option('addtoany_options');
50
  }
51
-
52
  load_plugin_textdomain('add-to-any',
53
  $A2A_SHARE_SAVE_plugin_url_path.'/languages',
54
  $A2A_SHARE_SAVE_plugin_basename.'/languages');
@@ -115,11 +115,11 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = false ) {
115
  if ( ! isset($args['html_wrap_close']))
116
  $args['html_wrap_close'] = "";
117
 
118
- $kit_html = ADDTOANY_SHARE_SAVE_ICONS($args);
119
 
120
  $args['html_container_close'] = $html_container_close; // Re-set because unset above for _ICONS
121
- unset($args['html_container_open']); // Avoid passing to ADDTOANY_SHARE_SAVE_BUTTON since set in _ICONS
122
-
123
  $kit_html .= ADDTOANY_SHARE_SAVE_BUTTON($args);
124
 
125
  if (isset($args['output_later']) && $args['output_later'])
@@ -166,7 +166,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
166
 
167
  // True only if "icon_size" option is set and it is not '16'
168
  $large_icons = ( isset($options['icon_size']) && $options['icon_size'] != '16' ) ? TRUE : FALSE;
169
-
170
  $active_services = $options['active_services'];
171
 
172
  $ind_html = "" . $html_container_open;
@@ -274,7 +274,7 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
274
 
275
  $is_feed = is_feed();
276
  $button_target = '';
277
- $button_href_querystring = ($is_feed) ? '#url=' . $linkurl_enc . '&amp;title=' . $linkname_enc : '';
278
  $options = get_option('addtoany_options');
279
 
280
  if( ! $options['button'] ) {
@@ -366,26 +366,26 @@ function ADDTOANY_SHARE_SAVE_SPECIAL($special_service_code, $args = array() ) {
366
  $custom_attributes = '';
367
 
368
  if ($special_service_code == 'facebook_like') {
369
- $custom_attributes .= ($options['special_facebook_like_options']['verb'] == 'recommend') ? ' data-action="recommend"' : '';
370
  $custom_attributes .= ' data-href="' . $linkurl . '"';
371
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
372
  }
373
 
374
  elseif ($special_service_code == 'twitter_tweet') {
375
- $custom_attributes .= ($options['special_twitter_tweet_options']['show_count'] == '1') ? ' data-count="horizontal"' : ' data-count="none"';
376
  $custom_attributes .= ' data-url="' . $linkurl . '"';
377
  $custom_attributes .= ' data-text="' . $linkname . '"';
378
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
379
  }
380
 
381
  elseif ($special_service_code == 'google_plusone') {
382
- $custom_attributes .= ($options['special_google_plusone_options']['show_count'] == '1') ? '' : ' data-annotation="none"';
383
  $custom_attributes .= ' data-href="' . $linkurl . '"';
384
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
385
  }
386
 
387
  elseif ($special_service_code == 'google_plus_share') {
388
- $custom_attributes .= ($options['special_google_plus_share_options']['show_count'] == '1') ? '' : ' data-annotation="none"';
389
  $custom_attributes .= ' data-href="' . $linkurl . '"';
390
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
391
  }
@@ -400,27 +400,27 @@ if (!function_exists('A2A_menu_locale')) {
400
  function A2A_menu_locale() {
401
  global $A2A_locale;
402
  $locale = get_locale();
403
- if($locale == 'en_US' || $locale == 'en' || $A2A_locale != '' )
404
  return false;
405
 
406
  $A2A_locale = 'a2a_localize = {
407
  Share: "' . __("Share", "add-to-any") . '",
408
  Save: "' . __("Save", "add-to-any") . '",
409
  Subscribe: "' . __("Subscribe", "add-to-any") . '",
410
- Email: "' . __("E-mail", "add-to-any") . '",
411
- Bookmark: "' . __("Bookmark", "add-to-any") . '",
412
  ShowAll: "' . __("Show all", "add-to-any") . '",
413
  ShowLess: "' . __("Show less", "add-to-any") . '",
414
  FindServices: "' . __("Find service(s)", "add-to-any") . '",
415
  FindAnyServiceToAddTo: "' . __("Instantly find any service to add to", "add-to-any") . '",
416
  PoweredBy: "' . __("Powered by", "add-to-any") . '",
417
- ShareViaEmail: "' . __("Share via e-mail", "add-to-any") . '",
418
- SubscribeViaEmail: "' . __("Subscribe via e-mail", "add-to-any") . '",
419
  BookmarkInYourBrowser: "' . __("Bookmark in your browser", "add-to-any") . '",
420
  BookmarkInstructions: "' . __("Press Ctrl+D or \u2318+D to bookmark this page", "add-to-any") . '",
421
  AddToYourFavorites: "' . __("Add to your favorites", "add-to-any") . '",
422
- SendFromWebOrProgram: "' . __("Send from any e-mail address or e-mail program", "add-to-any") . '",
423
- EmailProgram: "' . __("E-mail program", "add-to-any") . '"
424
  };
425
  ';
426
  return $A2A_locale;
@@ -448,7 +448,7 @@ function A2A_SHARE_SAVE_head_script() {
448
  $script_configs = (($cache) ? "\n" . 'a2a_config.static_server="' . $static_server . '";' : '' )
449
  . (($options['onclick']=='1') ? "\n" . 'a2a_config.onclick=1;' : '')
450
  . (($options['show_title']=='1') ? "\n" . 'a2a_config.show_title=1;' : '')
451
- . (($additional_js) ? "\n" . stripslashes($additional_js) : '');
452
  $A2A_SHARE_SAVE_external_script_called = true;
453
  }
454
  else {
@@ -589,7 +589,7 @@ function A2A_SHARE_SAVE_add_to_content($content) {
589
  $is_feed = is_feed();
590
  $options = get_option('addtoany_options');
591
  $sharing_disabled = get_post_meta( get_the_ID(), 'sharing_disabled', false );
592
-
593
  if( ! $A2A_SHARE_SAVE_auto_placement_ready)
594
  return $content;
595
 
@@ -788,7 +788,7 @@ function A2A_SHARE_SAVE_meta_box_save( $post_id ) {
788
  }
789
  }
790
 
791
- return $post_id;
792
  }
793
 
794
  add_action( 'admin_init', 'A2A_SHARE_SAVE_add_meta_box' );
@@ -816,17 +816,17 @@ function A2A_SHARE_SAVE_migrate_options() {
816
  );
817
 
818
  $namespace = 'A2A_SHARE_SAVE_';
819
-
820
  foreach ($options as $option_name => $option_value) {
821
- $old_option_name = $namespace . $option_name;
822
  $old_option_value = get_option($old_option_name);
823
 
824
  if($old_option_value === FALSE) {
825
  // Default value
826
- $options[$option_name] = $option_value;
827
  } else {
828
  // Old value
829
- $options[$option_name] = $old_option_value;
830
  }
831
 
832
  delete_option($old_option_name);
@@ -861,7 +861,7 @@ function A2A_SHARE_SAVE_options_page() {
861
  // Make available services extensible via plugins, themes (functions.php), etc.
862
  $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services);
863
 
864
- if (isset($_POST['Submit'])) {
865
 
866
  // Nonce verification
867
  check_admin_referer('add-to-any-update-options');
@@ -920,20 +920,20 @@ function A2A_SHARE_SAVE_options_page() {
920
  'show_count' => ((@$_POST['addtoany_google_plus_share_show_count'] == '1') ? '1' : '-1')
921
  );
922
 
923
- update_option('addtoany_options', $new_options);
924
-
925
  ?>
926
- <div class="updated fade"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
927
  <?php
928
 
929
- } else if (isset($_POST['Reset'])) {
930
- // Nonce verification
931
- check_admin_referer('add-to-any-update-options');
932
-
933
- delete_option('addtoany_options');
934
- }
935
 
936
- $options = get_option('addtoany_options');
937
 
938
  function position_in_content($options, $option_box = FALSE) {
939
 
@@ -959,13 +959,13 @@ function A2A_SHARE_SAVE_options_page() {
959
  if ($option_box) {
960
  $html = '</label>';
961
  $html .= '<label>'; // Label needed to prevent checkmark toggle on SELECT click
962
- $html .= '<select name="A2A_SHARE_SAVE_position">';
963
- $html .= '<option value="bottom"' . $positions['bottom']['selected'] . '>' . $positions['bottom']['string'] . '</option>';
964
- $html .= '<option value="top"' . $positions['top']['selected'] . '>' . $positions['top']['string'] . '</option>';
965
- $html .= '<option value="both"' . $positions['both']['selected'] . '>' . $positions['both']['string'] . '</option>';
966
  $html .= '</select>';
967
-
968
- return $html;
969
  } else {
970
  $html = '<span class="A2A_SHARE_SAVE_position">';
971
  $html .= $positions[$options['position']]['string'];
@@ -975,58 +975,58 @@ function A2A_SHARE_SAVE_options_page() {
975
  }
976
  }
977
 
978
- ?>
979
-
980
- <?php A2A_SHARE_SAVE_theme_hooks_check(); ?>
981
-
982
- <div class="wrap">
983
 
984
  <div id="icon-options-general" class="icon32"></div>
985
 
986
  <h2><?php _e( 'AddToAny Share Settings', 'add-to-any' ); ?></h2>
987
 
988
- <form id="addtoany_admin_form" method="post" action="">
989
-
990
  <?php wp_nonce_field('add-to-any-update-options'); ?>
991
-
992
- <table class="form-table">
 
 
 
 
 
 
 
 
 
993
 
994
  <tr valign="top">
995
- <th scope="row"><?php _e("Icon Size", "add-to-any"); ?></th>
996
- <td><fieldset>
997
- <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="32"<?php if($options['icon_size']=='32' ) echo ' checked="checked"'; ?>> <?php _e('Large', 'add-to-any'); ?></label>
998
- <br>
999
- <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="16"<?php if( !$options['icon_size'] || $options['icon_size']=='16') echo ' checked="checked"'; ?>> <?php _e('Small', 'add-to-any'); ?></label>
1000
- </fieldset></td>
1001
- </tr>
1002
-
1003
- <tr valign="top">
1004
- <th scope="row"><?php _e("Standalone Buttons", "add-to-any"); ?></th>
1005
  <td><fieldset>
1006
- <ul id="addtoany_services_sortable" class="addtoany_admin_list addtoany_override a2a_kit_size_32">
1007
- <li class="dummy"><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/transparent.gif" width="16" height="16" alt="" /></li>
1008
- </ul>
1009
- <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>
1010
- <ul id="addtoany_services_selectable" class="addtoany_admin_list">
1011
- <li id="a2a_wp_facebook_like" class="addtoany_special_service" title="Facebook Like button">
1012
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
1013
- </li>
1014
  <li id="a2a_wp_twitter_tweet" class="addtoany_special_service" title="Twitter Tweet button">
1015
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
1016
- </li>
1017
- <li id="a2a_wp_google_plusone" class="addtoany_special_service" title="Google +1 button">
1018
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
1019
- </li>
1020
- <li id="a2a_wp_google_plus_share" class="addtoany_special_service" title="Google+ Share button">
1021
- <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="57" height="20" alt="Google+ Share Button" /></span>
1022
- </li>
1023
  <?php
1024
  // Show all services
1025
  $active_services = $options['active_services'];
1026
  if( !$active_services )
1027
  $active_services = Array();
1028
 
1029
- foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
1030
  if (isset($site['href']))
1031
  $custom_service = TRUE;
1032
  else
@@ -1034,97 +1034,80 @@ function A2A_SHARE_SAVE_options_page() {
1034
  if ( ! isset($site['icon']))
1035
  $site['icon'] = 'default';
1036
  ?>
1037
- <li data-addtoany-icon-name="<?php echo $site['icon']; ?>" id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
1038
- <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>
1039
- </li>
1040
  <?php
1041
- } ?>
1042
- </ul>
1043
- </fieldset></td>
1044
- </tr>
1045
-
1046
- <tr valign="top">
1047
- <th scope="row"><?php _e("Universal Button", "add-to-any"); ?></th>
1048
- <td><fieldset>
1049
- <div class="addtoany_icon_size_large">
1050
- <label class="addtoany_override a2a_kit_size_32">
1051
- <input name="A2A_SHARE_SAVE_button" value="A2A_SVG_32" type="radio"<?php if($options['button']=='A2A_SVG_32') echo ' checked="checked"'; ?>
1052
- style="margin:9px 0;vertical-align:middle">
1053
- <span class="a2a_svg a2a_s_a2a" onclick="this.parentNode.firstChild.checked=true" style="margin-left:9px"></span>
1054
- </label>
1055
- <br>
1056
- </div>
1057
-
1058
- <div class="addtoany_icon_size_small">
1059
- <label>
1060
- <input name="A2A_SHARE_SAVE_button" value="favicon.png|16|16" type="radio"<?php if($options['button']=='favicon.png|16|16') echo ' checked="checked"'; ?>
1061
- style="margin:9px 0;vertical-align:middle">
1062
- <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'); ?>"
1063
- onclick="this.parentNode.firstChild.checked=true"/>
1064
- </label>
1065
- <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-7].checked=true" style="vertical-align:middle;width:150px"
1066
- value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1067
- <label style="padding-left:9px">
1068
- <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?>
1069
- style="margin:9px 0;vertical-align:middle">
1070
- <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'); ?>"
1071
- onclick="this.parentNode.firstChild.checked=true"/>
1072
- </label>
1073
- <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-6].checked=true" style="vertical-align:middle;width:150px"
1074
- value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1075
- <br>
1076
- <label>
1077
- <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"'; ?>
1078
- style="margin:9px 0;vertical-align:middle">
1079
- <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"
1080
- onclick="this.parentNode.firstChild.checked=true"/>
1081
- </label>
1082
- <br>
1083
- <label>
1084
- <input name="A2A_SHARE_SAVE_button" value="share_save_171_16.png|171|16" type="radio"<?php if( !$options['button'] || $options['button']=='share_save_171_16.png|171|16' ) echo ' checked="checked"'; ?>
1085
- style="margin:9px 0;vertical-align:middle">
1086
- <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"
1087
- onclick="this.parentNode.firstChild.checked=true"/>
1088
- </label>
1089
- <br>
1090
- <label>
1091
- <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"'; ?>
1092
- style="margin:9px 0;vertical-align:middle">
1093
- <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"
1094
- onclick="this.parentNode.firstChild.checked=true"/>
1095
  </label>
1096
  <br>
1097
- </div>
1098
-
1099
- <label>
1100
- <input name="A2A_SHARE_SAVE_button" value="CUSTOM" type="radio"<?php if( $options['button'] == 'CUSTOM' ) echo ' checked="checked"'; ?>
1101
- style="margin:9px 0;vertical-align:middle">
 
 
 
 
1102
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Image URL"); ?>:</span>
1103
  </label>
1104
- <input name="A2A_SHARE_SAVE_button_custom" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-2].checked=true" style="vertical-align:middle"
1105
- value="<?php echo $options['button_custom']; ?>" />
1106
- <br>
1107
  <label>
1108
- <input name="A2A_SHARE_SAVE_button" value="TEXT" type="radio"<?php if( $options['button'] == 'TEXT' ) echo ' checked="checked"'; ?>
1109
- style="margin:9px 0;vertical-align:middle">
1110
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Text only"); ?>:</span>
1111
  </label>
1112
- <input name="A2A_SHARE_SAVE_button_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-1].checked=true" style="vertical-align:middle;width:150px"
1113
- value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1114
-
1115
- </fieldset></td>
1116
- </tr>
1117
- <tr valign="top">
1118
- <th scope="row"><?php _e('Placement', 'add-to-any'); ?></th>
1119
- <td><fieldset>
1120
- <label>
1121
- <input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
1122
  if($options['display_in_posts']!='-1') echo ' checked="checked"'; ?> value="1"/>
1123
- <?php printf(__('Display at the %s of posts', 'add-to-any'), position_in_content($options, TRUE)); ?> <strong>*</strong>
1124
- </label>
1125
- <br/>
1126
- <label>
1127
- &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
1128
  if($options['display_in_excerpts']!='-1') echo ' checked="checked"';
1129
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1130
  ?> value="1"/>
@@ -1132,141 +1115,135 @@ function A2A_SHARE_SAVE_options_page() {
1132
  </label>
1133
  <br/>
1134
  <label>
1135
- &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
1136
  if($options['display_in_posts_on_front_page']!='-1') echo ' checked="checked"';
1137
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1138
  ?> value="1"/>
1139
- <?php printf(__('Display at the %s of posts on the front page', 'add-to-any'), position_in_content($options)); ?>
1140
  </label>
1141
  <br/>
1142
  <label>
1143
- &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
1144
  if($options['display_in_posts_on_archive_pages']!='-1') echo ' checked="checked"';
1145
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1146
  ?> value="1"/>
1147
- <?php printf(__('Display at the %s of posts on archive pages', 'add-to-any'), position_in_content($options)); ?>
1148
  </label>
1149
  <br/>
1150
  <label>
1151
- &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
1152
  if($options['display_in_feed']!='-1') echo ' checked="checked"';
1153
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1154
  ?> value="1"/>
1155
  <?php printf(__('Display at the %s of posts in the feed', 'add-to-any'), position_in_content($options)); ?>
1156
  </label>
1157
  <br/>
1158
- <label>
1159
- <input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if($options['display_in_pages']!='-1') echo ' checked="checked"'; ?> value="1"/>
1160
- <?php printf(__('Display at the %s of pages', 'add-to-any'), position_in_content($options, TRUE)); ?>
1161
  </label>
1162
- <br/><br/>
1163
- <div class="setting-description">
1164
- <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>
1165
- <div id="addtoany_template_button_code">
1166
- <code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code>
1167
- </div>
1168
- <noscript><code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code></noscript>
1169
- </div>
1170
- </fieldset></td>
1171
- </tr>
1172
- <tr valign="top">
1173
- <th scope="row"><?php _e('Menu Style', 'add-to-any'); ?></th>
1174
- <td><fieldset>
1175
  <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>
1176
- <p>
1177
- <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"
1178
- onclick="document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus();
1179
- document.getElementById('A2A_SHARE_SAVE_menu_styler_note').style.display='';"><?php _e("Open Menu Styler", "add-to-any"); ?></a>
1180
  </p>
1181
- </fieldset></td>
1182
- </tr>
1183
- <tr valign="top">
1184
- <th scope="row"><?php _e('Menu Options', 'add-to-any'); ?></th>
1185
- <td><fieldset>
1186
- <label>
1187
- <input name="A2A_SHARE_SAVE_onclick"
1188
- type="checkbox"<?php if($options['onclick']=='1') echo ' checked="checked"'; ?> value="1"/>
1189
- <?php _e('Only show the menu when the user clicks the Share/Save button', 'add-to-any'); ?>
1190
- </label>
1191
- <br />
1192
  <label>
1193
- <input name="A2A_SHARE_SAVE_show_title"
1194
- type="checkbox"<?php if($options['show_title']=='1') echo ' checked="checked"'; ?> value="1"/>
1195
- <?php _e('Show the title of the post (or page) within the menu', 'add-to-any'); ?>
1196
- </label>
1197
- </fieldset></td>
1198
- </tr>
1199
- <tr valign="top">
1200
- <th scope="row"><?php _e('Additional Options', 'add-to-any'); ?></th>
1201
- <td><fieldset>
1202
- <p id="A2A_SHARE_SAVE_menu_styler_note" style="display:none">
1203
- <label for="A2A_SHARE_SAVE_additional_js_variables" class="updated">
1204
- <strong><?php _e("Paste the code from AddToAny's Menu Styler in the box below!", 'add-to-any'); ?></strong>
1205
- </label>
1206
- </p>
1207
- <label for="A2A_SHARE_SAVE_additional_js_variables">
1208
- <p><?php _e('Below you can set special JavaScript variables to apply to each Share/Save menu.', 'add-to-any'); ?>
1209
- <?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>
1210
  </label>
1211
- <p>
1212
- <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>
1213
- </p>
1214
- <?php if( $options['additional_js_variables']!='' ) { ?>
1215
- <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'); ?>
1216
- <?php } ?>
 
 
 
 
 
1217
  </fieldset></td>
1218
- </tr>
1219
  <tr valign="top">
1220
- <th scope="row"><?php _e('Advanced Options', 'add-to-any'); ?></th>
1221
- <td><fieldset>
1222
- <label for="A2A_SHARE_SAVE_inline_css">
1223
- <input name="A2A_SHARE_SAVE_inline_css" id="A2A_SHARE_SAVE_inline_css"
1224
- type="checkbox"<?php if($options['inline_css']!='-1') echo ' checked="checked"'; ?> value="1"/>
1225
- <?php _e('Use CSS stylesheet', 'add-to-any'); ?>
1226
  </label>
1227
  <br/>
1228
  <label for="A2A_SHARE_SAVE_cache">
1229
- <input name="A2A_SHARE_SAVE_cache" id="A2A_SHARE_SAVE_cache"
1230
- type="checkbox"<?php if($options['cache']=='1') echo ' checked="checked"'; ?> value="1"/>
1231
- <?php _e('Cache AddToAny locally with daily cache updates', 'add-to-any'); ?> <strong>**</strong>
1232
  </label>
1233
  <br/><br/>
1234
- <div class="setting-description">
1235
  <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"); ?>
1236
  </div>
1237
- </fieldset></td>
1238
- </tr>
1239
- </table>
1240
-
1241
- <p class="submit">
1242
- <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Changes', 'add-to-any' ) ?>" />
1243
- <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' ) ?>" />
1244
- </p>
1245
-
1246
- </form>
1247
-
1248
- <h2><?php _e('Like this plugin?','add-to-any'); ?></h2>
1249
- <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>
1250
- <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>
1251
-
1252
- <h2><?php _e('Need support?','add-to-any'); ?></h2>
1253
- <p><?php _e('See the <a href="http://wordpress.org/extend/plugins/add-to-any/faq/">FAQs</a>.','add-to-any'); ?></p>
1254
- <p><?php _e('Search the <a href="http://wordpress.org/tags/add-to-any">support forums</a>.','add-to-any'); ?></p>
1255
- </div>
1256
-
1257
- <script type="text/javascript" src="http<?php if ( is_ssl() ) echo 's'; ?>://static.addtoany.com/menu/page.js"></script>
1258
- <script type="text/javascript">if ( a2a && a2a.svg_css ) a2a.svg_css();</script>
1259
 
1260
  <?php
1261
-
1262
  }
1263
 
1264
  // Admin page header
1265
  function A2A_SHARE_SAVE_admin_head() {
1266
  if (isset($_GET['page']) && $_GET['page'] == 'add-to-any.php') {
1267
-
1268
  $options = get_option('addtoany_options');
1269
-
1270
  ?>
1271
  <script type="text/javascript"><!--
1272
  jQuery(document).ready(function(){
@@ -1454,12 +1431,12 @@ function A2A_SHARE_SAVE_admin_head() {
1454
 
1455
  // Service click = move to sortable list
1456
  jQuery('#addtoany_services_selectable li').bind('click', moveToSortableList);
1457
-
1458
- // Form submit = get sortable list
1459
- jQuery('#addtoany_admin_form').submit(function(){to_input('#addtoany_services_sortable')});
1460
-
1461
- // Auto-select active services
1462
- <?php
1463
  $admin_services_saved = isset($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1464
  $active_services = ( $admin_services_saved )
1465
  ? @$_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
@@ -1477,10 +1454,10 @@ function A2A_SHARE_SAVE_admin_head() {
1477
  $active_services_quoted .= ',';
1478
  }
1479
  ?>
1480
- var services = [<?php echo $active_services_quoted; ?>],
1481
- service_options = {};
1482
-
1483
- <?php
1484
  // Special service options
1485
  if ( isset($_POST['addtoany_facebook_like_verb']) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
1486
  || ! isset($_POST['addtoany_facebook_like_verb']) && $options['special_facebook_like_options']['verb'] == 'recommend') {
@@ -1499,9 +1476,9 @@ function A2A_SHARE_SAVE_admin_head() {
1499
  ?>service_options.google_plus_share = {show_count: 1};<?php
1500
  }
1501
  ?>
1502
-
1503
- jQuery.each(services, function(i, val){
1504
- jQuery('#a2a_wp_'+val).click();
1505
  });
1506
 
1507
  // Add/Remove Services button
@@ -1571,7 +1548,7 @@ function A2A_SHARE_SAVE_admin_head() {
1571
  #addtoany_template_button_code, #addtoany_css_code{display:none;}
1572
 
1573
  #A2A_SHARE_SAVE_reset_options{color:red;margin-left: 15px;}
1574
- </style>
1575
  <?php
1576
 
1577
  }
@@ -1591,7 +1568,7 @@ function A2A_SHARE_SAVE_add_menu_link() {
1591
  );
1592
 
1593
  /* Using registered $page handle to hook script load, to only load in AddToAny admin */
1594
- add_filter('admin_print_scripts-' . $page, 'A2A_SHARE_SAVE_scripts');
1595
  }
1596
  }
1597
 
@@ -1603,8 +1580,8 @@ function A2A_SHARE_SAVE_scripts() {
1603
  function A2A_SHARE_SAVE_widget_init() {
1604
  global $A2A_SHARE_SAVE_plugin_dir;
1605
 
1606
- include_once($A2A_SHARE_SAVE_plugin_dir . '/add-to-any-wp-widget.php');
1607
- register_widget('A2A_SHARE_SAVE_Widget');
1608
  }
1609
 
1610
  add_action('widgets_init', 'A2A_SHARE_SAVE_widget_init');
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.2
7
  Author: micropat
8
  Author URI: http://www.addtoany.com/
9
  */
45
  $A2A_SHARE_SAVE_options;
46
 
47
  if (get_option('A2A_SHARE_SAVE_button')) {
48
+ A2A_SHARE_SAVE_migrate_options();
49
+ $A2A_SHARE_SAVE_options = get_option('addtoany_options');
50
  }
51
+
52
  load_plugin_textdomain('add-to-any',
53
  $A2A_SHARE_SAVE_plugin_url_path.'/languages',
54
  $A2A_SHARE_SAVE_plugin_basename.'/languages');
115
  if ( ! isset($args['html_wrap_close']))
116
  $args['html_wrap_close'] = "";
117
 
118
+ $kit_html = ADDTOANY_SHARE_SAVE_ICONS($args);
119
 
120
  $args['html_container_close'] = $html_container_close; // Re-set because unset above for _ICONS
121
+ unset($args['html_container_open']); // Avoid passing to ADDTOANY_SHARE_SAVE_BUTTON since set in _ICONS
122
+
123
  $kit_html .= ADDTOANY_SHARE_SAVE_BUTTON($args);
124
 
125
  if (isset($args['output_later']) && $args['output_later'])
166
 
167
  // True only if "icon_size" option is set and it is not '16'
168
  $large_icons = ( isset($options['icon_size']) && $options['icon_size'] != '16' ) ? TRUE : FALSE;
169
+
170
  $active_services = $options['active_services'];
171
 
172
  $ind_html = "" . $html_container_open;
274
 
275
  $is_feed = is_feed();
276
  $button_target = '';
277
+ $button_href_querystring = ($is_feed) ? '#url=' . $linkurl_enc . '&amp;title=' . $linkname_enc : '';
278
  $options = get_option('addtoany_options');
279
 
280
  if( ! $options['button'] ) {
366
  $custom_attributes = '';
367
 
368
  if ($special_service_code == 'facebook_like') {
369
+ $custom_attributes .= ($options['special_facebook_like_options']['verb'] == 'recommend') ? ' data-action="recommend"' : '';
370
  $custom_attributes .= ' data-href="' . $linkurl . '"';
371
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
372
  }
373
 
374
  elseif ($special_service_code == 'twitter_tweet') {
375
+ $custom_attributes .= ($options['special_twitter_tweet_options']['show_count'] == '1') ? ' data-count="horizontal"' : ' data-count="none"';
376
  $custom_attributes .= ' data-url="' . $linkurl . '"';
377
  $custom_attributes .= ' data-text="' . $linkname . '"';
378
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
379
  }
380
 
381
  elseif ($special_service_code == 'google_plusone') {
382
+ $custom_attributes .= ($options['special_google_plusone_options']['show_count'] == '1') ? '' : ' data-annotation="none"';
383
  $custom_attributes .= ' data-href="' . $linkurl . '"';
384
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
385
  }
386
 
387
  elseif ($special_service_code == 'google_plus_share') {
388
+ $custom_attributes .= ($options['special_google_plus_share_options']['show_count'] == '1') ? '' : ' data-annotation="none"';
389
  $custom_attributes .= ' data-href="' . $linkurl . '"';
390
  $special_html = sprintf($special_anchor_template, $special_service_code, $custom_attributes);
391
  }
400
  function A2A_menu_locale() {
401
  global $A2A_locale;
402
  $locale = get_locale();
403
+ if($locale == 'en_US' || $locale == 'en' || $A2A_locale != '' )
404
  return false;
405
 
406
  $A2A_locale = 'a2a_localize = {
407
  Share: "' . __("Share", "add-to-any") . '",
408
  Save: "' . __("Save", "add-to-any") . '",
409
  Subscribe: "' . __("Subscribe", "add-to-any") . '",
410
+ Email: "' . __("Email", "add-to-any") . '",
411
+ Bookmark: "' . __("Bookmark", "add-to-any") . '",
412
  ShowAll: "' . __("Show all", "add-to-any") . '",
413
  ShowLess: "' . __("Show less", "add-to-any") . '",
414
  FindServices: "' . __("Find service(s)", "add-to-any") . '",
415
  FindAnyServiceToAddTo: "' . __("Instantly find any service to add to", "add-to-any") . '",
416
  PoweredBy: "' . __("Powered by", "add-to-any") . '",
417
+ ShareViaEmail: "' . __("Share via email", "add-to-any") . '",
418
+ SubscribeViaEmail: "' . __("Subscribe via email", "add-to-any") . '",
419
  BookmarkInYourBrowser: "' . __("Bookmark in your browser", "add-to-any") . '",
420
  BookmarkInstructions: "' . __("Press Ctrl+D or \u2318+D to bookmark this page", "add-to-any") . '",
421
  AddToYourFavorites: "' . __("Add to your favorites", "add-to-any") . '",
422
+ SendFromWebOrProgram: "' . __("Send from any email address or email program", "add-to-any") . '",
423
+ EmailProgram: "' . __("Email program", "add-to-any") . '"
424
  };
425
  ';
426
  return $A2A_locale;
448
  $script_configs = (($cache) ? "\n" . 'a2a_config.static_server="' . $static_server . '";' : '' )
449
  . (($options['onclick']=='1') ? "\n" . 'a2a_config.onclick=1;' : '')
450
  . (($options['show_title']=='1') ? "\n" . 'a2a_config.show_title=1;' : '')
451
+ . (($additional_js) ? "\n" . stripslashes($additional_js) : '');
452
  $A2A_SHARE_SAVE_external_script_called = true;
453
  }
454
  else {
589
  $is_feed = is_feed();
590
  $options = get_option('addtoany_options');
591
  $sharing_disabled = get_post_meta( get_the_ID(), 'sharing_disabled', false );
592
+
593
  if( ! $A2A_SHARE_SAVE_auto_placement_ready)
594
  return $content;
595
 
788
  }
789
  }
790
 
791
+ return $post_id;
792
  }
793
 
794
  add_action( 'admin_init', 'A2A_SHARE_SAVE_add_meta_box' );
816
  );
817
 
818
  $namespace = 'A2A_SHARE_SAVE_';
819
+
820
  foreach ($options as $option_name => $option_value) {
821
+ $old_option_name = $namespace . $option_name;
822
  $old_option_value = get_option($old_option_name);
823
 
824
  if($old_option_value === FALSE) {
825
  // Default value
826
+ $options[$option_name] = $option_value;
827
  } else {
828
  // Old value
829
+ $options[$option_name] = $old_option_value;
830
  }
831
 
832
  delete_option($old_option_name);
861
  // Make available services extensible via plugins, themes (functions.php), etc.
862
  $A2A_SHARE_SAVE_services = apply_filters('A2A_SHARE_SAVE_services', $A2A_SHARE_SAVE_services);
863
 
864
+ if (isset($_POST['Submit'])) {
865
 
866
  // Nonce verification
867
  check_admin_referer('add-to-any-update-options');
920
  'show_count' => ((@$_POST['addtoany_google_plus_share_show_count'] == '1') ? '1' : '-1')
921
  );
922
 
923
+ update_option('addtoany_options', $new_options);
924
+
925
  ?>
926
+ <div class="updated fade"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
927
  <?php
928
 
929
+ } else if (isset($_POST['Reset'])) {
930
+ // Nonce verification
931
+ check_admin_referer('add-to-any-update-options');
932
+
933
+ delete_option('addtoany_options');
934
+ }
935
 
936
+ $options = get_option('addtoany_options');
937
 
938
  function position_in_content($options, $option_box = FALSE) {
939
 
959
  if ($option_box) {
960
  $html = '</label>';
961
  $html .= '<label>'; // Label needed to prevent checkmark toggle on SELECT click
962
+ $html .= '<select name="A2A_SHARE_SAVE_position">';
963
+ $html .= '<option value="bottom"' . $positions['bottom']['selected'] . '>' . $positions['bottom']['string'] . '</option>';
964
+ $html .= '<option value="top"' . $positions['top']['selected'] . '>' . $positions['top']['string'] . '</option>';
965
+ $html .= '<option value="both"' . $positions['both']['selected'] . '>' . $positions['both']['string'] . '</option>';
966
  $html .= '</select>';
967
+
968
+ return $html;
969
  } else {
970
  $html = '<span class="A2A_SHARE_SAVE_position">';
971
  $html .= $positions[$options['position']]['string'];
975
  }
976
  }
977
 
978
+ ?>
979
+
980
+ <?php A2A_SHARE_SAVE_theme_hooks_check(); ?>
981
+
982
+ <div class="wrap">
983
 
984
  <div id="icon-options-general" class="icon32"></div>
985
 
986
  <h2><?php _e( 'AddToAny Share Settings', 'add-to-any' ); ?></h2>
987
 
988
+ <form id="addtoany_admin_form" method="post" action="">
989
+
990
  <?php wp_nonce_field('add-to-any-update-options'); ?>
991
+
992
+ <table class="form-table">
993
+
994
+ <tr valign="top">
995
+ <th scope="row"><?php _e("Icon Size", "add-to-any"); ?></th>
996
+ <td><fieldset>
997
+ <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="32"<?php if($options['icon_size']=='32' ) echo ' checked="checked"'; ?>> <?php _e('Large', 'add-to-any'); ?></label>
998
+ <br>
999
+ <label><input type="radio" name="A2A_SHARE_SAVE_icon_size" value="16"<?php if( !$options['icon_size'] || $options['icon_size']=='16') echo ' checked="checked"'; ?>> <?php _e('Small', 'add-to-any'); ?></label>
1000
+ </fieldset></td>
1001
+ </tr>
1002
 
1003
  <tr valign="top">
1004
+ <th scope="row"><?php _e("Standalone Buttons", "add-to-any"); ?></th>
 
 
 
 
 
 
 
 
 
1005
  <td><fieldset>
1006
+ <ul id="addtoany_services_sortable" class="addtoany_admin_list addtoany_override a2a_kit_size_32">
1007
+ <li class="dummy"><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/transparent.gif" width="16" height="16" alt="" /></li>
1008
+ </ul>
1009
+ <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>
1010
+ <ul id="addtoany_services_selectable" class="addtoany_admin_list">
1011
+ <li id="a2a_wp_facebook_like" class="addtoany_special_service" title="Facebook Like button">
1012
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like.png'; ?>" width="50" height="20" alt="Facebook Like" /></span>
1013
+ </li>
1014
  <li id="a2a_wp_twitter_tweet" class="addtoany_special_service" title="Twitter Tweet button">
1015
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet.png'; ?>" width="55" height="20" alt="Twitter Tweet" /></span>
1016
+ </li>
1017
+ <li id="a2a_wp_google_plusone" class="addtoany_special_service" title="Google +1 button">
1018
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone.png'; ?>" width="32" height="20" alt="Google +1" /></span>
1019
+ </li>
1020
+ <li id="a2a_wp_google_plus_share" class="addtoany_special_service" title="Google+ Share button">
1021
+ <span><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share.png'; ?>" width="57" height="20" alt="Google+ Share Button" /></span>
1022
+ </li>
1023
  <?php
1024
  // Show all services
1025
  $active_services = $options['active_services'];
1026
  if( !$active_services )
1027
  $active_services = Array();
1028
 
1029
+ foreach ($A2A_SHARE_SAVE_services as $service_safe_name=>$site) {
1030
  if (isset($site['href']))
1031
  $custom_service = TRUE;
1032
  else
1034
  if ( ! isset($site['icon']))
1035
  $site['icon'] = 'default';
1036
  ?>
1037
+ <li data-addtoany-icon-name="<?php echo $site['icon']; ?>" id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
1038
+ <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>
1039
+ </li>
1040
  <?php
1041
+ } ?>
1042
+ </ul>
1043
+ </fieldset></td>
1044
+ </tr>
1045
+
1046
+ <tr valign="top">
1047
+ <th scope="row"><?php _e("Universal Button", "add-to-any"); ?></th>
1048
+ <td><fieldset>
1049
+ <div class="addtoany_icon_size_large">
1050
+ <label class="addtoany_override a2a_kit_size_32">
1051
+ <input name="A2A_SHARE_SAVE_button" value="A2A_SVG_32" type="radio"<?php if($options['button']=='A2A_SVG_32') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1052
+ <span class="a2a_svg a2a_s_a2a" onclick="this.parentNode.firstChild.checked=true" style="margin-left:9px"></span>
1053
+ </label>
1054
+ <br>
1055
+ </div>
1056
+
1057
+ <div class="addtoany_icon_size_small">
1058
+ <label>
1059
+ <input name="A2A_SHARE_SAVE_button" value="favicon.png|16|16" type="radio"<?php if($options['button']=='favicon.png|16|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1060
+ <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"/>
1061
+ </label>
1062
+ <input name="A2A_SHARE_SAVE_button_favicon_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-7].checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1063
+ <label style="padding-left:9px">
1064
+ <input name="A2A_SHARE_SAVE_button" value="share_16_16.png|16|16" type="radio"<?php if($options['button']=='share_16_16.png|16|16') echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1065
+ <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"/>
1066
+ </label>
1067
+ <input name="A2A_SHARE_SAVE_button_share_16_16_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-6].checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1068
+ <br>
1069
+ <label>
1070
+ <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">
1071
+ <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"/>
1072
+ </label>
1073
+ <br>
1074
+ <label>
1075
+ <input name="A2A_SHARE_SAVE_button" value="share_save_171_16.png|171|16" type="radio"<?php if( !$options['button'] || $options['button']=='share_save_171_16.png|171|16' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1076
+ <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"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1077
  </label>
1078
  <br>
1079
+ <label>
1080
+ <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">
1081
+ <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"/>
1082
+ </label>
1083
+ <br>
1084
+ </div>
1085
+
1086
+ <label>
1087
+ <input name="A2A_SHARE_SAVE_button" value="CUSTOM" type="radio"<?php if( $options['button'] == 'CUSTOM' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
1088
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Image URL"); ?>:</span>
1089
  </label>
1090
+ <input name="A2A_SHARE_SAVE_button_custom" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-2].checked=true" style="vertical-align:middle" value="<?php echo $options['button_custom']; ?>" />
1091
+ <br>
 
1092
  <label>
1093
+ <input name="A2A_SHARE_SAVE_button" value="TEXT" type="radio"<?php if( $options['button'] == 'TEXT' ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
 
1094
  <span style="margin:0 9px;vertical-align:middle"><?php _e("Text only"); ?>:</span>
1095
  </label>
1096
+ <input name="A2A_SHARE_SAVE_button_text" type="text" class="code" size="50" onclick="e=document.getElementsByName('A2A_SHARE_SAVE_button');e[e.length-1].checked=true" style="vertical-align:middle;width:150px" value="<?php echo ( trim($options['button_text']) != '' ) ? stripslashes($options['button_text']) : __('Share','add-to-any'); ?>" />
1097
+
1098
+ </fieldset></td>
1099
+ </tr>
1100
+ <tr valign="top">
1101
+ <th scope="row"><?php _e('Placement', 'add-to-any'); ?></th>
1102
+ <td><fieldset>
1103
+ <label>
1104
+ <input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
 
1105
  if($options['display_in_posts']!='-1') echo ' checked="checked"'; ?> value="1"/>
1106
+ <?php printf(__('Display at the %s of posts', 'add-to-any'), position_in_content($options, TRUE)); ?> <strong>*</strong>
1107
+ </label>
1108
+ <br/>
1109
+ <label>
1110
+ &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
1111
  if($options['display_in_excerpts']!='-1') echo ' checked="checked"';
1112
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1113
  ?> value="1"/>
1115
  </label>
1116
  <br/>
1117
  <label>
1118
+ &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
1119
  if($options['display_in_posts_on_front_page']!='-1') echo ' checked="checked"';
1120
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1121
  ?> value="1"/>
1122
+ <?php printf(__('Display at the %s of posts on the front page', 'add-to-any'), position_in_content($options)); ?>
1123
  </label>
1124
  <br/>
1125
  <label>
1126
+ &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
1127
  if($options['display_in_posts_on_archive_pages']!='-1') echo ' checked="checked"';
1128
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1129
  ?> value="1"/>
1130
+ <?php printf(__('Display at the %s of posts on archive pages', 'add-to-any'), position_in_content($options)); ?>
1131
  </label>
1132
  <br/>
1133
  <label>
1134
+ &nbsp; &nbsp; &nbsp; <input class="A2A_SHARE_SAVE_child_of_display_in_posts" name="A2A_SHARE_SAVE_display_in_feed" type="checkbox"<?php
1135
  if($options['display_in_feed']!='-1') echo ' checked="checked"';
1136
  if($options['display_in_posts']=='-1') echo ' disabled="disabled"';
1137
  ?> value="1"/>
1138
  <?php printf(__('Display at the %s of posts in the feed', 'add-to-any'), position_in_content($options)); ?>
1139
  </label>
1140
  <br/>
1141
+ <label>
1142
+ <input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if($options['display_in_pages']!='-1') echo ' checked="checked"'; ?> value="1"/>
1143
+ <?php printf(__('Display at the %s of pages', 'add-to-any'), position_in_content($options, TRUE)); ?>
1144
  </label>
1145
+ <br/><br/>
1146
+ <div class="setting-description">
1147
+ <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>
1148
+ <div id="addtoany_template_button_code">
1149
+ <code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code>
1150
+ </div>
1151
+ <noscript><code>&lt;?php if( function_exists('ADDTOANY_SHARE_SAVE_KIT') ) { ADDTOANY_SHARE_SAVE_KIT(); } ?&gt;</code></noscript>
1152
+ </div>
1153
+ </fieldset></td>
1154
+ </tr>
1155
+ <tr valign="top">
1156
+ <th scope="row"><?php _e('Menu Style', 'add-to-any'); ?></th>
1157
+ <td><fieldset>
1158
  <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>
1159
+ <p>
1160
+ <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>
 
 
1161
  </p>
1162
+ </fieldset></td>
1163
+ </tr>
1164
+ <tr valign="top">
1165
+ <th scope="row"><?php _e('Menu Options', 'add-to-any'); ?></th>
1166
+ <td><fieldset>
 
 
 
 
 
 
1167
  <label>
1168
+ <input name="A2A_SHARE_SAVE_onclick" type="checkbox"<?php if($options['onclick']=='1') echo ' checked="checked"'; ?> value="1"/>
1169
+ <?php _e('Only show the menu when the user clicks the Share/Save button', 'add-to-any'); ?>
1170
+ </label>
1171
+ <br />
1172
+ <label>
1173
+ <input name="A2A_SHARE_SAVE_show_title" type="checkbox"<?php if($options['show_title']=='1') echo ' checked="checked"'; ?> value="1"/>
1174
+ <?php _e('Show the title of the post (or page) within the menu', 'add-to-any'); ?>
1175
+ </label>
1176
+ </fieldset></td>
1177
+ </tr>
1178
+ <tr valign="top">
1179
+ <th scope="row"><?php _e('Additional Options', 'add-to-any'); ?></th>
1180
+ <td><fieldset>
1181
+ <p id="A2A_SHARE_SAVE_menu_styler_note" style="display:none">
1182
+ <label for="A2A_SHARE_SAVE_additional_js_variables" class="updated">
1183
+ <strong><?php _e("Paste the code from AddToAny's Menu Styler in the box below!", 'add-to-any'); ?></strong>
 
1184
  </label>
1185
+ </p>
1186
+ <label for="A2A_SHARE_SAVE_additional_js_variables">
1187
+ <p><?php _e('Below you can set special JavaScript variables to apply to each Share/Save menu.', 'add-to-any'); ?>
1188
+ <?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>
1189
+ </label>
1190
+ <p>
1191
+ <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>
1192
+ </p>
1193
+ <?php if( $options['additional_js_variables']!='' ) { ?>
1194
+ <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'); ?>
1195
+ <?php } ?>
1196
  </fieldset></td>
1197
+ </tr>
1198
  <tr valign="top">
1199
+ <th scope="row"><?php _e('Advanced Options', 'add-to-any'); ?></th>
1200
+ <td><fieldset>
1201
+ <label for="A2A_SHARE_SAVE_inline_css">
1202
+ <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"/>
1203
+ <?php _e('Use CSS stylesheet', 'add-to-any'); ?>
 
1204
  </label>
1205
  <br/>
1206
  <label for="A2A_SHARE_SAVE_cache">
1207
+ <input name="A2A_SHARE_SAVE_cache" id="A2A_SHARE_SAVE_cache" type="checkbox"<?php if($options['cache']=='1') echo ' checked="checked"'; ?> value="1"/>
1208
+ <?php _e('Cache AddToAny locally with daily cache updates', 'add-to-any'); ?> <strong>**</strong>
 
1209
  </label>
1210
  <br/><br/>
1211
+ <div class="setting-description">
1212
  <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"); ?>
1213
  </div>
1214
+ </fieldset></td>
1215
+ </tr>
1216
+ </table>
1217
+
1218
+ <p class="submit">
1219
+ <input class="button-primary" type="submit" name="Submit" value="<?php _e('Save Changes', 'add-to-any' ) ?>" />
1220
+ <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' ) ?>" />
1221
+ </p>
1222
+
1223
+ </form>
1224
+
1225
+ <h2><?php _e('Like this plugin?','add-to-any'); ?></h2>
1226
+ <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>
1227
+ <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>
1228
+
1229
+ <h2><?php _e('Need support?','add-to-any'); ?></h2>
1230
+ <p><?php _e('See the <a href="http://wordpress.org/extend/plugins/add-to-any/faq/">FAQs</a>.','add-to-any'); ?></p>
1231
+ <p><?php _e('Search the <a href="http://wordpress.org/tags/add-to-any">support forums</a>.','add-to-any'); ?></p>
1232
+ </div>
1233
+
1234
+ <script type="text/javascript" src="http<?php if ( is_ssl() ) echo 's'; ?>://static.addtoany.com/menu/page.js"></script>
1235
+ <script type="text/javascript">if ( a2a && a2a.svg_css ) a2a.svg_css();</script>
1236
 
1237
  <?php
1238
+
1239
  }
1240
 
1241
  // Admin page header
1242
  function A2A_SHARE_SAVE_admin_head() {
1243
  if (isset($_GET['page']) && $_GET['page'] == 'add-to-any.php') {
1244
+
1245
  $options = get_option('addtoany_options');
1246
+
1247
  ?>
1248
  <script type="text/javascript"><!--
1249
  jQuery(document).ready(function(){
1431
 
1432
  // Service click = move to sortable list
1433
  jQuery('#addtoany_services_selectable li').bind('click', moveToSortableList);
1434
+
1435
+ // Form submit = get sortable list
1436
+ jQuery('#addtoany_admin_form').submit(function(){to_input('#addtoany_services_sortable')});
1437
+
1438
+ // Auto-select active services
1439
+ <?php
1440
  $admin_services_saved = isset($_POST['A2A_SHARE_SAVE_active_services']) || isset($_POST['Submit']);
1441
  $active_services = ( $admin_services_saved )
1442
  ? @$_POST['A2A_SHARE_SAVE_active_services'] : $options['active_services'];
1454
  $active_services_quoted .= ',';
1455
  }
1456
  ?>
1457
+ var services = [<?php echo $active_services_quoted; ?>],
1458
+ service_options = {};
1459
+
1460
+ <?php
1461
  // Special service options
1462
  if ( isset($_POST['addtoany_facebook_like_verb']) && $_POST['addtoany_facebook_like_verb'] == 'recommend'
1463
  || ! isset($_POST['addtoany_facebook_like_verb']) && $options['special_facebook_like_options']['verb'] == 'recommend') {
1476
  ?>service_options.google_plus_share = {show_count: 1};<?php
1477
  }
1478
  ?>
1479
+
1480
+ jQuery.each(services, function(i, val){
1481
+ jQuery('#a2a_wp_'+val).click();
1482
  });
1483
 
1484
  // Add/Remove Services button
1548
  #addtoany_template_button_code, #addtoany_css_code{display:none;}
1549
 
1550
  #A2A_SHARE_SAVE_reset_options{color:red;margin-left: 15px;}
1551
+ </style>
1552
  <?php
1553
 
1554
  }
1568
  );
1569
 
1570
  /* Using registered $page handle to hook script load, to only load in AddToAny admin */
1571
+ add_filter('admin_print_scripts-' . $page, 'A2A_SHARE_SAVE_scripts');
1572
  }
1573
  }
1574
 
1580
  function A2A_SHARE_SAVE_widget_init() {
1581
  global $A2A_SHARE_SAVE_plugin_dir;
1582
 
1583
+ include_once($A2A_SHARE_SAVE_plugin_dir . '/add-to-any-wp-widget.php');
1584
+ register_widget('A2A_SHARE_SAVE_Widget');
1585
  }
1586
 
1587
  add_action('widgets_init', 'A2A_SHARE_SAVE_widget_init');