Commit e748ee2a authored by catch's avatar catch

Issue #2443817 by andypost, a_thakur: Remove usage and the function drupal_theme_access()

parent a0b26339
...@@ -70,28 +70,6 @@ ...@@ -70,28 +70,6 @@
* @} End of "defgroup content_flags". * @} 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. * Gets the theme registry.
* *
......
...@@ -207,12 +207,9 @@ function testListThemes() { ...@@ -207,12 +207,9 @@ function testListThemes() {
$theme_handler->install(array('test_subtheme')); $theme_handler->install(array('test_subtheme'));
$themes = $theme_handler->listInfo(); $themes = $theme_handler->listInfo();
$themes = \Drupal::service('theme_handler')->listInfo(); // Check if ThemeHandlerInterface::listInfo() retrieves enabled themes.
// Check if drupal_theme_access() retrieves enabled themes properly from $this->assertIdentical(1, $themes['test_theme']->status, 'Installed theme detected');
// ThemeHandlerInterface::listInfo().
$this->assertTrue(drupal_theme_access('test_theme'), 'Installed theme detected');
$this->assertTrue(drupal_theme_access('test_theme'), 'Enabled theme detected');
// Check if ThemeHandlerInterface::listInfo() returns disabled themes. // Check if ThemeHandlerInterface::listInfo() returns disabled themes.
// Check for base theme and subtheme lists. // Check for base theme and subtheme lists.
$base_theme_list = array('test_basetheme' => 'Theme test base theme'); $base_theme_list = array('test_basetheme' => 'Theme test base theme');
......
...@@ -314,13 +314,6 @@ function system_theme_suggestions_field(array $variables) { ...@@ -314,13 +314,6 @@ function system_theme_suggestions_field(array $variables) {
return $suggestions; 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 * @defgroup authorize Authorized operations
* @{ * @{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment