You are here

function socbutt_tokens in Bootstrap Social Sharing Buttons 7

Same name and namespace in other branches
  1. 8 socbutt.module \socbutt_tokens()

Implements hook_tokens().

File

./socbutt.module, line 34

Code

function socbutt_tokens($type, $tokens, $data = array(), $options = array()) {
  $replacements = array();
  if ($type == 'socbutt') {
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'vertical':
          $replacements[$original] = theme('socbutt_buttons', array(
            'layout' => SOCBUTT_LAYOUT_VERTICAL,
          ));
          break;
        case 'horizontal':
          $replacements[$original] = theme('socbutt_buttons', array(
            'layout' => SOCBUTT_LAYOUT_HORIZONTAL,
          ));
          break;
      }
    }
  }
  return $replacements;
}