Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
e748ee2a
Commit
e748ee2a
authored
Mar 6, 2015
by
catch
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2443817
by andypost, a_thakur: Remove usage and the function drupal_theme_access()
parent
a0b26339
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/includes/theme.inc
+0
-22
0 additions, 22 deletions
core/includes/theme.inc
core/modules/system/src/Tests/Theme/ThemeTest.php
+2
-5
2 additions, 5 deletions
core/modules/system/src/Tests/Theme/ThemeTest.php
core/modules/system/system.module
+0
-7
0 additions, 7 deletions
core/modules/system/system.module
with
2 additions
and
34 deletions
core/includes/theme.inc
+
0
−
22
View file @
e748ee2a
...
...
@@ -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.
*
...
...
This diff is collapsed.
Click to expand it.
core/modules/system/src/Tests/Theme/ThemeTest.php
+
2
−
5
View file @
e748ee2a
...
...
@@ -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'
);
...
...
This diff is collapsed.
Click to expand it.
core/modules/system/system.module
+
0
−
7
View file @
e748ee2a
...
...
@@ -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
* @{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment