You are here

function theme_faq_questions_top in Frequently Asked Questions 5.2

Create the structure of the page, when the questions are to be shown on top.

Parameters

$nodes: Array of node objects to display.

Return value

A variable holding the HTML formatted page.

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

File

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

Code

function theme_faq_questions_top($nodes) {

  // Fetch configuration.
  $teaser = variable_get('faq_use_teaser', FALSE);
  $links = variable_get('faq_show_node_links', FALSE);
  $this_page = $_GET['q'];

  // Configure "back to top" link.
  $back_to_top = faq_init_back_to_top($this_page);

  // Loop through results.
  $questions = array();
  foreach ($nodes as $node) {
    $anchor = "n" . $node->nid;
    $questions[] = l($node->question, $this_page, NULL, NULL, $anchor);
    $answers .= theme('faq_format_question', $node, NULL, $anchor);
    $answers .= faq_view_answer($node, $back_to_top, $teaser, $links);
  }
  $list_style = variable_get('faq_question_listing', 'ul');
  $output = '<a name="top"></a>';
  $output .= theme('item_list', $questions, NULL, $list_style, array(
    "class" => "faq-ul-questions-top",
  ));
  $output .= "<div>\n" . $answers . "</div>\n";
  return $output;
}