Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
views_attachment_tabs
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
views_attachment_tabs
Commits
64073a1d
There was an error fetching the commit references. Please try again later.
Commit
64073a1d
authored
6 months ago
by
Si Hobbs
Committed by
Nia Kathoni
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3423139
: When olivero is the base theme
parent
64724db3
No related branches found
No related tags found
1 merge request
!4
Check if olivero is base theme.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/views_attachment_tabs_olivero/views_attachment_tabs_olivero.module
+22
-2
22 additions, 2 deletions
...achment_tabs_olivero/views_attachment_tabs_olivero.module
with
22 additions
and
2 deletions
modules/views_attachment_tabs_olivero/views_attachment_tabs_olivero.module
+
22
−
2
View file @
64073a1d
...
...
@@ -11,8 +11,7 @@ use Drupal\Component\Utility\Html;
* Implements hook_preprocess_HOOK() for views_view_attachment_tabs.
*/
function
views_attachment_tabs_olivero_preprocess_views_view_attachment_tabs
(
array
&
$variables
)
{
// Check if we should apply olivero customizations.
if
(
\Drupal
::
service
(
'theme.manager'
)
->
getActiveTheme
()
->
getName
()
!==
'olivero'
)
{
if
(
!
_views_attachment_tabs_olivero_theme_is_activated
())
{
return
;
}
...
...
@@ -85,3 +84,24 @@ function views_attachment_tabs_olivero_preprocess_views_view_attachment_tabs(arr
];
}
}
/**
* Checks if olivero theme is activated or it's a base theme.
*
* @return bool
* True when active, False otherwise.
*/
function
_views_attachment_tabs_olivero_theme_is_activated
():
bool
{
$active_theme
=
\Drupal
::
service
(
'theme.manager'
)
->
getActiveTheme
();
if
(
$active_theme
->
getName
()
===
'olivero'
)
{
return
TRUE
;
}
foreach
(
$active_theme
->
getBaseThemeExtensions
()
as
$base_theme
)
{
if
(
$base_theme
->
getName
()
===
'olivero'
)
{
return
TRUE
;
}
}
return
FALSE
;
}
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