function faq_init_back_to_top in Frequently Asked Questions 5.2
Same name and namespace in other branches
- 6 faq.module \faq_init_back_to_top()
- 7.2 faq.module \faq_init_back_to_top()
- 7 faq.module \faq_init_back_to_top()
Helper function to setup the "back to top" link.
Parameters
$path: The path/url where the "back to top" link should bring the user too. This could be the 'faq' page or one of the categorized faq pages, e.g 'faq/123' where 123 is the tid.
Return value
An array containing the "back to top" link.
5 calls to faq_init_back_to_top()
- theme_faq_category_questions_inline in includes/
faq.questions_inline.inc - Create the code of the FAQ page if set to show/hide the category-sorted questions inline.
- theme_faq_category_questions_top in includes/
faq.questions_top.inc - Create the layout of the FAQ page if set to show the questions on top, all sorted by categories.
- theme_faq_category_questions_top_answers in includes/
faq.questions_top.inc - Create the layout of the answers if set to show the questions on top, all sorted by categories.
- theme_faq_questions_inline in includes/
faq.questions_inline.inc - Create the code of the FAQ page if set to show the questions inline.
- theme_faq_questions_top in includes/
faq.questions_top.inc - Create the structure of the page, when the questions are to be shown on top.
File
- ./
faq.module, line 1614 - 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_init_back_to_top($path) {
$back_to_top_text = trim(variable_get('faq_back_to_top', 'Back to Top'));
if (!empty($back_to_top_text)) {
$back_to_top = array(
'title' => check_plain($back_to_top_text),
'href' => $path,
'attributes' => array(
'title' => t('Go back to the top of the page.'),
),
'fragment' => 'top',
'html' => TRUE,
);
}
return $back_to_top;
}