highschool-1.0.0-alpha1/highschool.install
highschool.install
<?php
/**
* @file
* Install, update and uninstall hooks for the highschool install profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function highschool_install() {
// First, do everything that is done in the standard profile.
include_once DRUPAL_ROOT . '/core/profiles/standard/standard.install';
standard_install();
// Add code here to make nodes, terms, etc.
}
/**
* Implements hook_install_tasks().
*/
function highschool_install_tasks(&$install_state) {
return [
'highschool_theme_setup' => [
'display_name' => t('Install theme'),
'display' => FALSE,
],
];
}
/**
* Set up default front end theme.
*/
function highschool_theme_setup() {
// Install highschool theme.
\Drupal::service('theme_installer')
->install(['highschool_kickstart']);
// Set highschool theme as default & claro as admin.
\Drupal::configFactory()
->getEditable('system.theme')
->set('default', 'highschool_kickstart')
->set('admin', 'claro')
->save();
// Ensure that the install profile's theme is used.
\Drupal::service('theme.manager')->resetActiveTheme();
}
