context_theme.module in Context Reaction: Theme 6
File
context_theme.module
View source
<?php
function context_theme_init() {
global $custom_theme;
$vals = context_active_values();
$custom_theme = $vals['theme'][0];
}
function context_theme_context_reactions() {
$items = array();
$options = array();
$themes = list_themes();
foreach ($themes as $name => $theme) {
if ($theme->status == 1) {
$options[$name] = $name;
}
}
$items['theme'] = array(
'#title' => t('Theme'),
'#description' => t('Activate a given theme when this context is set.'),
'#options' => $options,
'#type' => 'checkboxes',
);
return $items;
}