commit 73fe0691a32a375799c5633099441bf0c7024c8b Author: Joel Pittet Date: Thu May 14 14:40:25 2015 -0700 leaving variables for install and maintenance and other uses diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 62c0b60..2382748 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1371,6 +1371,9 @@ function template_preprocess_page(&$variables) { $variables['base_path'] = base_path(); $variables['front_page'] = \Drupal::url(''); $variables['language'] = $language_interface; + $variables['logo'] = theme_get_setting('logo.url'); + $variables['site_name'] = (theme_get_setting('features.name') ? $site_config->get('name') : ''); + $variables['site_slogan'] = (theme_get_setting('features.slogan') ? $site_config->get('slogan') : ''); // An exception might be thrown. try { diff --git a/core/modules/color/color.module b/core/modules/color/color.module index 6fdaac5..8f615dd 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -106,6 +106,21 @@ function color_library_info_alter(&$libraries, $extension) { } /** + * Implements hook_preprocess_page(). + * + * Replace the logo with the colored version if available. + */ +function color_preprocess_page(&$variables) { + $theme_key = \Drupal::theme()->getActiveTheme()->getName(); + + // Override logo. + $logo = \Drupal::config('color.theme.' . $theme_key)->get('logo'); + if ($logo && $variables['logo'] && preg_match('!' . $theme_key . '/logo.svg$!', $variables['logo'])) { + $variables['logo'] = file_create_url($logo); + } +} + +/** * Implements hook_block_view_BASE_BLOCK_ID_alter(). */ function color_block_view_system_branding_block_alter(array &$build, BlockPluginInterface $block) { @@ -115,7 +130,7 @@ function color_block_view_system_branding_block_alter(array &$build, BlockPlugin /** * #pre_render callback: Sets color preset logo. */ -function color_block_view_pre_render(array $build) { +function color_block_view_pre_render(array &$build) { $theme_key = \Drupal::theme()->getActiveTheme()->getName(); // Override logo. diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 15ac31e..6aa8baa 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -146,20 +146,16 @@ function seven_element_info_alter(&$type) { * Implements hook_preprocess_install_page(). */ function seven_preprocess_install_page(&$variables) { - $site_config = \Drupal::config('system.site'); // Seven has custom styling for the install page. $variables['#attached']['library'][] = 'seven/install-page'; - $variables['site_name'] = $site_config->get('name'); } /** * Implements hook_preprocess_maintenance_page(). */ function seven_preprocess_maintenance_page(&$variables) { - $site_config = \Drupal::config('system.site'); // Seven has custom styling for the maintenance page. $variables['#attached']['library'][] = 'seven/maintenance-page'; - $variables['site_name'] = $site_config->get('name'); } /**