diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 951dce5..8d4dd14 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1366,9 +1366,6 @@ 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'] = String::checkPlain($site_config->get('name')); - $variables['site_slogan'] = Xss::filterAdmin($site_config->get('slogan')); // An exception might be thrown. try { diff --git a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php index 44650dd..b850bf2 100644 --- a/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php +++ b/core/modules/system/src/Plugin/Block/SystemBrandingBlock.php @@ -12,6 +12,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\Component\Utility\String; use Drupal\Component\Utility\Xss; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -165,16 +166,16 @@ public function build() { $build = array(); $site_config = $this->configFactory->get('system.site'); - $logo = theme_get_setting('logo'); + $logo_url = theme_get_setting('logo.url'); $build['site_logo'] = array( '#theme' => 'image', - '#uri' => $logo['url'], + '#uri' => $logo_url, '#alt' => $this->t('Home'), '#access' => $this->configuration['use_site_logo'], ); $build['site_name'] = array( - '#markup' => $site_config->get('name'), + '#markup' => String::checkPlain($site_config->get('name')), '#access' => $this->configuration['use_site_name'], ); diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index 7148e84..0df7389 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -41,9 +41,6 @@ function bartik_preprocess_html(&$variables) { * Implements hook_preprocess_HOOK() for page templates. */ function bartik_preprocess_page(&$variables) { - // Set the options that apply to both page and maintenance page. - _bartik_process_page($variables); - // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { @@ -76,9 +73,6 @@ function bartik_preprocess_maintenance_page(&$variables) { // Bartik has custom styling for the maintenance page. $variables['#attached']['library'][] = 'bartik/maintenance_page'; - - // Set the options that apply to both page and maintenance page. - _bartik_process_page($variables); } /** @@ -108,23 +102,3 @@ function bartik_preprocess_block(&$variables) { function bartik_preprocess_menu(&$variables) { $variables['attributes']['class'][] = 'clearfix'; } - -/** - * Helper function for handling the site name and slogan. - */ -function _bartik_process_page(&$variables) { - $site_config = \Drupal::config('system.site'); - // Always print the site name and slogan, but if they are toggled off, we'll - // just hide them visually. - $variables['hide_site_name'] = theme_get_setting('features.name') ? FALSE : TRUE; - $variables['hide_site_slogan'] = theme_get_setting('features.slogan') ? FALSE : TRUE; - if ($variables['hide_site_name']) { - // If toggle_name is FALSE, the site_name will be empty, so we rebuild it. - $variables['site_name'] = String::checkPlain($site_config->get('name')); - } - if ($variables['hide_site_slogan']) { - // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we - // rebuild it. - $variables['site_slogan'] = Xss::filterAdmin($site_config->get('slogan')); - } -} diff --git a/core/themes/bartik/templates/page.html.twig b/core/themes/bartik/templates/page.html.twig index 231b057..be03746 100644 --- a/core/themes/bartik/templates/page.html.twig +++ b/core/themes/bartik/templates/page.html.twig @@ -20,17 +20,6 @@ * Site identity: * - front_page: The URL of the front page. Use this instead of base_path when * linking to the front page. This includes the language domain or prefix. - * - logo: The url of the logo image, as defined in theme settings. - * - site_name: The name of the site. This is empty when displaying the site - * name has been disabled in the theme settings. - * - site_slogan: The slogan of the site. This is empty when displaying the site - * slogan has been disabled in theme settings. - * - hide_site_name: A flag indicating if the site name has been toggled off on - * the theme settings page. If hidden, the "visually-hidden" class is added - * to make the site name visually hidden, but still accessible. - * - hide_site_slogan: A flag indicating if the site slogan has been toggled off - * on the theme settings page. If hidden, the "visually-hidden" class is - * added to make the site slogan visually hidden, but still accessible. * * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be diff --git a/core/themes/classy/templates/layout/page.html.twig b/core/themes/classy/templates/layout/page.html.twig index 94c90a5..52b05c4 100644 --- a/core/themes/classy/templates/layout/page.html.twig +++ b/core/themes/classy/templates/layout/page.html.twig @@ -19,11 +19,6 @@ * Site identity: * - front_page: The URL of the front page. Use this instead of base_path when * linking to the front page. This includes the language domain or prefix. - * - logo: The url of the logo image, as defined in theme settings. - * - site_name: The name of the site. This is empty when displaying the site - * name has been disabled in the theme settings. - * - site_slogan: The slogan of the site. This is empty when displaying the site - * slogan has been disabled in theme settings. * * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 621cf82..fff9da4 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -148,6 +148,7 @@ function seven_element_info_alter(&$type) { function seven_preprocess_install_page(&$variables) { // Seven has custom styling for the install page. $variables['#attached']['library'][] = 'seven/install-page'; + $variables['site_name'] = String::checkPlain($site_config->get('name')); } /** @@ -156,6 +157,7 @@ function seven_preprocess_install_page(&$variables) { function seven_preprocess_maintenance_page(&$variables) { // Seven has custom styling for the maintenance page. $variables['#attached']['library'][] = 'seven/maintenance-page'; + $variables['site_name'] = String::checkPlain($site_config->get('name')); } /** diff --git a/core/themes/seven/templates/page.html.twig b/core/themes/seven/templates/page.html.twig index 4110987..0cdf4a4 100644 --- a/core/themes/seven/templates/page.html.twig +++ b/core/themes/seven/templates/page.html.twig @@ -20,11 +20,6 @@ * Site identity: * - front_page: The URL of the front page. Use this instead of base_path when * linking to the front page. This includes the language domain or prefix. - * - logo: The url of the logo image, as defined in theme settings. - * - site_name: The name of the site. This is empty when displaying the site - * name has been disabled in the theme settings. - * - site_slogan: The slogan of the site. This is empty when displaying the site - * slogan has been disabled in theme settings. * * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be