function _faq_faq_page_filter_replacer in Frequently Asked Questions 7.2
Same name and namespace in other branches
- 6 faq.module \_faq_faq_page_filter_replacer()
- 7 faq.module \_faq_faq_page_filter_replacer()
Helper function for faq input filter.
1 string reference to '_faq_faq_page_filter_replacer'
File
- ./
faq.module, line 1530 - The FAQ module allows users to create a FAQ page, with questions and answers displayed in different styles, according to the settings.
Code
function _faq_faq_page_filter_replacer($matches) {
$tid = 0;
$faq_display = '';
$category_display = '';
if (drupal_strlen($matches[1])) {
list($tid, $faq_display, $category_display) = explode(',', $matches[1] . ',,');
$tid = (int) trim($tid);
$faq_display = trim($faq_display);
$category_display = trim($category_display);
// These two checks ensure that a typo in the faq_display or
// category_display string still results in the FAQ showing.
if ($faq_display && !in_array($faq_display, array(
'questions_top',
'hide_answer',
'questions_inline',
'new_page',
))) {
$faq_display = '';
}
if ($category_display && !in_array($category_display, array(
'hide_qa',
'new_page',
'categories_inline',
))) {
$category_display = '';
}
}
return faq_page($tid, $faq_display, $category_display);
}