function domain_theme_set_variables in Domain Access 6.2
Same name and namespace in other branches
- 7.3 domain_theme/domain_theme.module \domain_theme_set_variables()
- 7.2 domain_theme/domain_theme.module \domain_theme_set_variables()
2 calls to domain_theme_set_variables()
- domain_theme_init in domain_theme/
domain_theme.module - Implement hook_init()
- domain_theme_settings in domain_theme/
domain_theme.admin.inc - The domain theme page callback router.
File
- domain_theme/
domain_theme.module, line 41 - Domain Theme module for the Domain Access module group.
Code
function domain_theme_set_variables($theme) {
global $conf;
if (!empty($theme['settings'])) {
$settings = domain_unserialize($theme['settings']);
$conf['theme_' . $theme['theme'] . '_settings'] = $settings;
// Account for color module.
$vars = array(
'palette',
'stylesheets',
'logo',
'files',
'screenshot',
);
// In some cases, where the domain uses the default color palette
// and the primary theme does not, we may only have the palette
// stored, in which case, we have to load that data and ignore the rest.
$palette_var = 'color_' . $theme['theme'] . '_palette';
if (!isset($settings[$palette_var])) {
if (isset($settings['palette'])) {
$conf[$palette_var] = $settings['palette'];
}
}
else {
foreach ($vars as $variable) {
$name = 'color_' . $theme['theme'] . '_' . $variable;
if (isset($settings[$name])) {
$conf[$name] = $settings[$name];
}
}
}
}
}