You are here

function theme_advanced_forum_l in Advanced Forum 7.2

Same name and namespace in other branches
  1. 6.2 includes/theme.inc \theme_advanced_forum_l()

Theme function to display a link, optionally buttonized.

4 theme calls to theme_advanced_forum_l()
advanced_forum_first_new_post_link in ./advanced_forum.module
Returns a link directly to the first new post in a topic.
advanced_forum_last_post_link in ./advanced_forum.module
Get a link to the last post in a topic.
theme_advanced_forum_node_type_create_list in includes/theme.inc
Theme function to show list of types that can be posted in forum.
theme_advanced_forum_reply_link in includes/theme.inc
Theme function to format the reply link at the top/bottom of topic.

File

includes/theme.inc, line 12
Holds theme functions and template preprocesses. Other style related functions are in style.inc

Code

function theme_advanced_forum_l(&$variables) {
  $text = $variables['text'];
  $path = empty($variables['path']) ? NULL : $variables['path'];
  $options = empty($variables['options']) ? array() : $variables['options'];
  $button_class = empty($variables['button_class']) ? NULL : $variables['button_class'];
  $l = '';
  if (!isset($options['attributes'])) {
    $options['attributes'] = array();
  }
  if (!is_null($button_class)) {

    // Buttonized link: add our button class and the span.
    if (!isset($options['attributes']['class'])) {
      $options['attributes']['class'] = array(
        "af-button-{$button_class}",
      );
    }
    else {
      $options['attributes']['class'][] = "af-button-{$button_class}";
    }
    $options['html'] = TRUE;

    // @codingStandardsIgnoreStart
    $l = l('<span>' . $text . '</span>', $path, $options);

    // @codingStandardsIgnoreEnd
  }
  else {

    // Standard link: just send it through l().
    $l = l($text, $path, $options);
  }
  return $l;
}