You are here

protected function ShareMessage::getAddthisStyleClass in Share Message 7

Getter for the style category class of addthis widgets.

Parameters

string $icon_style: The icon style to find the style class for.

Return value

string The addthis style category CSS class.

1 call to ShareMessage::getAddthisStyleClass()
ShareMessage::buildAttributes in includes/sharemessage.entity.inc
Function that adds icon style as part of addThis widget.

File

includes/sharemessage.entity.inc, line 382
Definition of ShareMessage entity class.

Class

ShareMessage

Code

protected function getAddthisStyleClass($icon_style) {

  // @todo there are more styles to cover in this map.
  $styles_map = array(
    'addthis_default_style' => array(
      'addthis_16x16_style',
      'addthis_32x32_style',
    ),
    'addthis_floating_style' => array(
      'addthis_counter_style',
    ),
  );

  // Find the match for the given icon style.
  foreach ($styles_map as $addthis_style_class => $styles) {
    if (in_array($icon_style, $styles)) {
      return $addthis_style_class;
    }
  }

  // Fallback to the default if no class in the map was matched.
  return 'addthis_default_style';
}