function advanced_forum_add_template_suggestions in Advanced Forum 6.2
Same name and namespace in other branches
- 7.2 includes/style.inc \advanced_forum_add_template_suggestions()
Manipulate the template suggestions to add in one for each style as well as the default.
23 calls to advanced_forum_add_template_suggestions()
- advanced_forum_preprocess_advanced_forum_active_poster in includes/
theme.inc - Preprocesses template variables for the active poster template.
- advanced_forum_preprocess_advanced_forum_forum_legend in includes/
theme.inc - Preprocesses template variables for the forum legend template.
- advanced_forum_preprocess_advanced_forum_search_forum in includes/
theme.inc - Preprocesses template variables for the forum search form template.
- advanced_forum_preprocess_advanced_forum_search_topic in includes/
theme.inc - advanced_forum_preprocess_advanced_forum_statistics in includes/
theme.inc - Preprocesses template variables for the forum statistics template.
File
- includes/
style.inc, line 286 - Functions relating to the style system, not including core hooks and preprocess / theme functions.
Code
function advanced_forum_add_template_suggestions($template, &$template_suggestions) {
// We only need to calculate the style lineage once per page load.
static $lineage;
if (empty($lineage)) {
$lineage = advanced_forum_style_lineage();
$lineage = array_reverse($lineage, TRUE);
}
// Add a suggestion for each style in the lineage.
foreach ($lineage as $key => $path) {
$template_suggestions[] = "advanced_forum.{$key}.{$template}";
}
// Add in a version without any style name at the end. The order will be
// reversed when drupal_discover_template() looks for the first matching
// file so adding this at the end means it will be found first.
$template_suggestions[] = "advanced_forum.{$template}";
return;
}