You are here

function template_preprocess_sharerich_buttons in Sharerich 7.3

Same name and namespace in other branches
  1. 7.2 sharerich.module \template_preprocess_sharerich_buttons()

Preprocess the sharerich buttons.

File

./sharerich.module, line 277

Code

function template_preprocess_sharerich_buttons(&$variables) {
  $element = $variables['element'];

  // Provide default template suggestions.
  $variables['theme_hook_suggestions'][] = 'sharerich_buttons__' . $element['#sharerich_set']->machinename;

  // Configure default template variables.
  $variables['title'] = $element['#title'];
  $variables['buttons'] = $element['buttons'];
  $attributes = array(
    'class' => array(
      'sharerich-wrapper',
      drupal_html_class('sharerich-' . $element['#sharerich_set']->machinename . '-wrapper'),
    ),
  );

  // Merge incoming attributes with default ones.
  $variables['attributes_array'] = array_merge_recursive($attributes, !empty($element['attributes_array']) ? $element['attributes_array'] : array());
}