You are here

function _shariff_get_settings in Shariff Social Media Buttons 7

Same name and namespace in other branches
  1. 8 shariff.module \_shariff_get_settings()

Helper function to get the module settings.

4 calls to _shariff_get_settings()
shariff_block_view in ./shariff.module
Implements hook_block_view().
shariff_field_formatter_view in ./shariff.module
Implements hook_field_formatter_view().
shariff_settings_form in ./shariff.module
Admin settings menu callback.
shariff_sharing_buttons_content_type_render in plugins/content_types/sharing_buttons.inc
Output function for the 'shariff_buttons' content type.

File

./shariff.module, line 591
Integrating Shariff library, providing settings form and block.

Code

function _shariff_get_settings() {
  global $language;
  $lang = $language->language;
  $supported_languages = _shariff_supported_languages();
  $services = variable_get('shariff_services', array(
    'twitter' => 'twitter',
    'facebook' => 'facebook',
  ));
  foreach ($services as $key => $service) {
    if (!$service) {
      unset($services[$key]);
    }
  }
  $settings = array(
    'services' => $services,
    'shariff_theme' => variable_get('shariff_theme', 'colored'),
    'orientation' => variable_get('shariff_orientation', 'horizontal'),
    'twitter_via' => variable_get('shariff_twitter_via', NULL),
    'mail_url' => variable_get('shariff_mail_url', NULL),
    'mail_subject' => variable_get('shariff_mail_subject', NULL),
    'mail_body' => variable_get('shariff_mail_body', NULL),
    'referrer_track' => variable_get('shariff_referrer_track', NULL),
    'backend_url' => variable_get('shariff_backend_url', NULL),
    'flattr_category' => variable_get('shariff_flattr_category', NULL),
    'flattr_user' => variable_get('shariff_flattr_user', NULL),
    'media_url' => variable_get('shariff_media_url', NULL),
    'lang' => in_array($lang, $supported_languages) ? $lang : 'en',
  );
  return $settings;
}