You are here

function theme_glossify_links in Glossify 7.4

Render a glossify link.

1 theme call to theme_glossify_links()
_glossify_to_links in ./glossify.module
Convert terms in text to links.

File

./glossify.module, line 351
Glossify module.

Code

function theme_glossify_links($vars) {
  global $base_url;
  drupal_add_css(drupal_get_path('module', 'glossify') . '/glossify.css');
  if ($vars['type'] == 'taxonomy') {
    $path = 'taxonomy/term/' . $vars['id'];
  }
  else {
    $path = 'node/' . $vars['id'];
  }
  if ($vars['tip']) {
    return l(check_plain($vars['text']) . '<img alt="info-icon" src = "' . $base_url . '/' . drupal_get_path('module', 'glossify') . '/info.png" />', $path, array(
      'html' => true,
      'attributes' => array(
        'class' => array(
          'glossify-link',
        ),
        'title' => $vars['tip'],
      ),
    ));
  }
  else {
    return l(check_plain($vars['text']) . '<img alt="info-icon" src = "' . $base_url . '/' . drupal_get_path('module', 'glossify') . '/info.png" />', $path, array(
      'html' => true,
      'attributes' => array(
        'class' => array(
          'glossify-link',
        ),
      ),
    ));
  }
}