You are here

public static function ShareaholicPublicJS::get_base_settings in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 public_js.php \ShareaholicPublicJS::get_base_settings()

Get _SHR_SETTINGS config for shareaholic js

1 call to ShareaholicPublicJS::get_base_settings()
ShareaholicPublic::js_snippet in ./public.php
The actual text for the JS snippet because drupal doesn't seem to be able to add JS from template like Wordpress does... Using heredocs for now

File

./public_js.php, line 19

Class

ShareaholicPublicJS
This class gets the necessary components ready for rendering the shareaholic js code for the template

Code

public static function get_base_settings() {
  $base_settings = array();
  $disable_share_counts_api = ShareaholicUtilities::get_option('disable_internal_share_counts_api');
  $share_counts_connect_check = ShareaholicUtilities::get_option('share_counts_connect_check');
  if (isset($disable_share_counts_api)) {
    if (isset($share_counts_connect_check) && $share_counts_connect_check == 'SUCCESS' && $disable_share_counts_api != 'on') {
      $base_settings['endpoints'] = array(
        'share_counts_url' => url('shareaholic/api/share_counts/v1', array(
          'absolute' => TRUE,
        )),
      );
    }
  }
  return $base_settings;
}