You are here

function _fetch_replacement in Glossify 6

Same name and namespace in other branches
  1. 6.3 glossify.module \_fetch_replacement()

Helper function that fetches and returns the styled term depending on the style and term.

1 call to _fetch_replacement()
glossify_filter in ./glossify.module
Implementation of hook_filter().

File

./glossify.module, line 392

Code

function _fetch_replacement($style, $term_title, $target_url) {
  switch ($style) {
    case 'links':
      return $replacement = l($term_title, $target_url, array(
        'attributes' => array(
          'title' => $term_title,
          'class' => 'glossify_term',
        ),
      ));
    case 'hovertip':
      return $replacement = '<span class="glossify_term hovertip_target" hovertip="' . $term_title . '">' . $term_title . '</span>';
    case 'reference':
      return $replacement = '<span class="glossify_term">' . $term_title . '</span>';
  }
}