You are here

function theme_faq_questions_inline in Frequently Asked Questions 5.2

Create the code of the FAQ page if set to show the questions inline.

Parameters

$nodes: Array of node objects to display.

Return value

A variable holding the HTML formatted page.

1 theme call to theme_faq_questions_inline()
faq_page in ./faq.module
Function to display the faq page.

File

includes/faq.questions_inline.inc, line 16
FAQ page callbacks for the "questions inline" layouts.

Code

function theme_faq_questions_inline($nodes) {

  // Fetch configuration.
  $teaser = variable_get('faq_use_teaser', FALSE);
  $links = variable_get('faq_show_node_links', FALSE);

  // Configure "back to top" link.
  $this_page = $_GET['q'];
  $back_to_top = faq_init_back_to_top($this_page);

  // Configure question and answer labels.
  $question_label = '';
  $answer_label = '';
  if (variable_get('faq_qa_mark', FALSE)) {
    $question_label .= variable_get('faq_question_label', "Q:") . ' ';
    $answer_label = variable_get('faq_answer_label', "A:");
  }
  $output = '<a name="top"></a>';
  $output .= "<div>\n";
  foreach ($nodes as $node) {
    $output .= theme('faq_format_question', $node, NULL, NULL, $question_label);
    $output .= faq_view_answer($node, $back_to_top, $teaser, $links, $answer_label);
  }
  $output .= "</div>\n";
  return $output;
}