You are here

function template_preprocess_faq_hide_answer in Frequently Asked Questions 7

Same name and namespace in other branches
  1. 8 includes/faq.hide_answer.inc \template_preprocess_faq_hide_answer()
  2. 6 includes/faq.hide_answer.inc \template_preprocess_faq_hide_answer()
  3. 7.2 includes/faq.hide_answer.inc \template_preprocess_faq_hide_answer()

Create FAQ page if set to show/hide answer when question is clicked.

Parameters

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

File

includes/faq.hide_answer.inc, line 14
FAQ page callbacks for the "hide answer" layouts.

Code

function template_preprocess_faq_hide_answer(&$variables) {
  $data = $variables['data'];
  $this_page = $_GET['q'];

  // Fetch configuration.
  $teaser = variable_get('faq_use_teaser', FALSE);
  $links = variable_get('faq_show_node_links', FALSE);
  $disable_node_links = variable_get('faq_disable_node_links', FALSE);
  $nodes = array();
  $count = 0;
  foreach ($data as $node) {
    $anchor = 'n' . $node->nid;
    faq_view_question($nodes[$count], $node, $this_page, $anchor);
    faq_view_answer($nodes[$count], $node, array(), $teaser, $links);
    $count++;
  }
  $variables['use_teaser'] = $teaser;
  $variables['nodes'] = $nodes;
}