Set the theme to Bootstrap by defualt during installation.

This commit is contained in:
Michael Stenta 2014-12-05 13:03:18 -05:00
parent 165a329e5c
commit fe7aadb0c7
1 changed files with 39 additions and 0 deletions

View File

@ -4,3 +4,42 @@
* @file
* FarmOS installation profile
*/
/**
* Implements hook_install_tasks().
*/
function farm_install_tasks($install_state) {
$tasks = array();
$tasks['farm_configure_themes'] = array(
'display_name' => st('Farm: configure themes'),
'display' => FALSE,
'type' => 'normal',
'run' => INSTALL_TASK_RUN_IF_NOT_COMPLETED,
'function' => 'farm_configure_themes',
);
return $tasks;
}
/**
* Set default themes. Disable Bartik.
*/
function farm_configure_themes() {
// Any themes without keys here will get numeric keys and so will be enabled,
// but not placed into variables.
$enable = array(
'theme_default' => 'bootstrap',
'admin_theme' => 'bootstrap',
);
theme_enable($enable);
// Create variables for each theme.
foreach ($enable as $var => $theme) {
if (!is_numeric($var)) {
variable_set($var, $theme);
}
}
// Disable the default Bartik theme
theme_disable(array('bartik'));
}