diff --git a/core/includes/theme.inc b/core/includes/theme.inc index b6078ed79a1caf5ae4965fd3a8133ba93854c8c2..c7dff02ed2af7d25fbe42f59f7dfe48ba902e651 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -70,28 +70,6 @@ * @} End of "defgroup content_flags". */ -/** - * Determines if a theme is available to use. - * - * @param string|\Drupal\Core\Extension\Extension $theme - * Either the name of a theme or a full theme object. - * - * @return bool - * Boolean TRUE if the theme is installed or is the site administration theme; - * FALSE otherwise. - * - * @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0. - * Use \Drupal::service('access_check.theme')->checkAccess(). - * - * @see \Drupal\Core\Theme\ThemeAccessCheck::checkAccess(). - */ -function drupal_theme_access($theme) { - if ($theme instanceof Extension) { - $theme = $theme->getName(); - } - return \Drupal::service('access_check.theme')->checkAccess($theme); -} - /** * Gets the theme registry. * diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php index 4573d01c8aaadaf1fc51e851dc6abe29e21a4473..0cd4e4ebef2dfba01d85236f50d7cf7d3e61183e 100644 --- a/core/modules/system/src/Tests/Theme/ThemeTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeTest.php @@ -207,12 +207,9 @@ function testListThemes() { $theme_handler->install(array('test_subtheme')); $themes = $theme_handler->listInfo(); - $themes = \Drupal::service('theme_handler')->listInfo(); - // Check if drupal_theme_access() retrieves enabled themes properly from - // ThemeHandlerInterface::listInfo(). - $this->assertTrue(drupal_theme_access('test_theme'), 'Installed theme detected'); + // Check if ThemeHandlerInterface::listInfo() retrieves enabled themes. + $this->assertIdentical(1, $themes['test_theme']->status, 'Installed theme detected'); - $this->assertTrue(drupal_theme_access('test_theme'), 'Enabled theme detected'); // Check if ThemeHandlerInterface::listInfo() returns disabled themes. // Check for base theme and subtheme lists. $base_theme_list = array('test_basetheme' => 'Theme test base theme'); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index a0fa679c19efbe49ec665a80a20a3aa683152ede..cf175ca251c00fe8195ddcea280c3e6ef7572330 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -314,13 +314,6 @@ function system_theme_suggestions_field(array $variables) { return $suggestions; } -/** - * Menu item access callback - only installed themes can be accessed. - */ -function _system_themes_access($theme) { - return \Drupal::currentUser()->hasPermission('administer themes') && drupal_theme_access($theme); -} - /** * @defgroup authorize Authorized operations * @{