function theme_tableofcontents_back_to_top in Table of Contents 7.2
Same name and namespace in other branches
- 6.3 tableofcontents.pages.inc \theme_tableofcontents_back_to_top()
- 7 tableofcontents.pages.inc \theme_tableofcontents_back_to_top()
Theme the output of the Back to Top link.
This way users can easily add an image instead of using the CSS arrow up as we have in the module.
Parameters
$toc A TOC object with the options and levels.:
Return value
Rendered HTML to be displayed.
2 theme calls to theme_tableofcontents_back_to_top()
- _tableofcontents_headers in ./
tableofcontents.inc - This function goes through all the headers found in the text.
- _tableofcontents_process_text in ./
tableofcontents.module - Developer function to apply TOC to any text $body has two assumptions for this function to work 1. It must have [toc] located somewhere in the text 2. It has already been processed by an input filter with toc enabled
File
- ./
tableofcontents.themes.inc, line 232 - Table of Contents - Versatile system for generating Tables of Contents for fields - themes.
Code
function theme_tableofcontents_back_to_top($variables) {
$toc = $variables['toc'];
$label = check_plain($toc['back_to_top']['label']);
$anchor = check_plain($toc['back_to_top']['anchor']);
return "<div class='toc-back-to-top'><a href='#{$anchor}'>{$label}</a></div>";
}