You are here

function template_preprocess_responsive_share_buttons in Responsive Share Buttons 7

Theme preprocess function for theme_responsive_share_buttons().

File

./responsive_share_buttons.module, line 150
Module to enable CSS responsive share buttons.

Code

function template_preprocess_responsive_share_buttons(&$vars) {
  $networks = variable_get('responsive_share_buttons', NULL);
  $url = urlencode(url(current_path(), array(
    'absolute' => TRUE,
  )));
  $title = urlencode(drupal_get_title());

  // Sort the network order by weight.
  uasort($networks, 'drupal_sort_weight');
  foreach ($networks as $name => $network) {
    if (!empty($network['active'])) {
      $links[] = _prepare_share_link($name, $url, $title);
    }
  }
  drupal_alter('responsive_share_buttons_links', $links);
  $vars['buttons'] = theme('item_list', array(
    'items' => $links,
    'attributes' => array(
      'class' => array(
        'share-inner-wrp',
      ),
    ),
  ));
}