function context_theme_registry_alter in Context 6.2
Same name and namespace in other branches
- 6.3 context.core.inc \context_theme_registry_alter()
- 6 context.core.inc \context_theme_registry_alter()
- 7.3 context.core.inc \context_theme_registry_alter()
Implementation of hook_theme_registry_alter().
File
- ./
context.core.inc, line 17
Code
function context_theme_registry_alter(&$theme_registry) {
// Push theme_page() through a context_preprocess to provide
// context-sensitive menus and variables.
if (!in_array('context_preprocess_page', $theme_registry['page']['preprocess functions'])) {
$theme_registry['page']['preprocess functions'][] = 'context_preprocess_page';
}
// Add a page preprocess function to the very top of the theme_page()
// stack so that we can actually set contexts *before* the page theming
// is executed.
if (!in_array('context_page_alter', $theme_registry['page']['preprocess functions'])) {
array_unshift($theme_registry['page']['preprocess functions'], 'context_page_alter');
}
// Reroute theme_blocks() through context_blocks to determine block
// visibility by context. Only override theme_blocks() if a theme
// has not overridden it. It is the responsibility of any themes
// implementing theme_blocks() to take advantage of context block
// visibility on their own.
if (!isset($theme_registry['blocks']['type']) || !in_array($theme_registry['blocks']['type'], array(
'base_theme_engine',
'theme_engine',
)) && !isset($theme_registry['blocks']['file'])) {
unset($theme_registry['blocks']['preprocess functions']);
$theme_registry['blocks']['function'] = 'context_blocks';
}
}