You are here

function theme_advanced_forum_reply_link in Advanced Forum 6.2

Same name and namespace in other branches
  1. 5 advanced_forum.module \theme_advanced_forum_reply_link()
  2. 6 advanced_forum.module \theme_advanced_forum_reply_link()
  3. 7.2 includes/theme.inc \theme_advanced_forum_reply_link()

Theme function to format the reply link at the top/bottom of topic.

3 theme calls to theme_advanced_forum_reply_link()
advanced_forum_preprocess_advanced_forum_topic_header in includes/theme.inc
Preprocesses template variables for the topic header template.
advanced_forum_preprocess_comment_wrapper in includes/theme.inc
_advanced_forum_preprocess_node in includes/advanced_forum_preprocess_node.inc
@file Holds the contents of a preprocess function moved into its own file to ease memory requirements and having too much code in one file.

File

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

Code

function theme_advanced_forum_reply_link($node) {

  // Get the information about whether the user can reply and the link to do
  // so if the user is allowed to.
  $reply_link = advanced_forum_get_reply_link($node);
  if (is_array($reply_link)) {

    // Reply is allowed. Variable contains the link information.
    $output = '<div class="topic-reply-allowed">';
    $output .= theme('advanced_forum_l', $reply_link['title'], $reply_link['href'], $reply_link['options'], 'large');
    $output .= '</div>';
    return $output;
  }
  elseif ($reply_link == 'reply-locked') {

    // @TODO: The double span here is icky but I don't know how else to get
    // around the fact that there's no "a" to put the button class on.
    return '<div class="topic-reply-locked"><span class="af-button-large"><span>' . t('Topic locked') . '</span></span></div>';
  }
  elseif ($reply_link == 'reply-forbidden') {

    // User is not allowed to reply to this topic.
    return theme('comment_post_forbidden', $node);
  }
}