You are here

function template_preprocess_faq_questions_inline in Frequently Asked Questions 7.2

Same name and namespace in other branches
  1. 8 includes/faq.questions_inline.inc \template_preprocess_faq_questions_inline()
  2. 6 includes/faq.questions_inline.inc \template_preprocess_faq_questions_inline()
  3. 7 includes/faq.questions_inline.inc \template_preprocess_faq_questions_inline()

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

Parameters

&$variables: Array reference of arguments given to the theme() function.

File

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

Code

function template_preprocess_faq_questions_inline(&$variables) {
  $data = $variables['data'];

  // Fetch configuration.
  $disable_node_links = variable_get('faq_disable_node_links', FALSE);
  $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 labels.
  $variables['question_label'] = '';
  $variables['answer_label'] = '';
  if (variable_get('faq_qa_mark', FALSE)) {
    $variables['question_label'] = check_plain(variable_get('faq_question_label', "Q:"));
    $variables['answer_label'] = check_plain(variable_get('faq_answer_label', "A:"));
  }
  $nodes = array();
  $count = 0;
  foreach ($data as $node) {
    $anchor = 'n' . $node->nid;
    faq_view_question($nodes[$count], $node, NULL, $anchor);
    faq_view_answer($nodes[$count], $node, $back_to_top, $teaser, $links);
    $count++;
  }
  $variables['use_teaser'] = $teaser;
  $variables['nodes'] = $nodes;
}