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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!10614
convert and move remaining core hook implementations
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
convert and move remaining core hook implementations
issue/drupal-3494908:3494908-pp-1-mark-several
into
11.x
Overview
7
Commits
9
Pipelines
9
Changes
48
3 unresolved threads
Hide all comments
Open
nicxvan
requested to merge
issue/drupal-3494908:3494908-pp-1-mark-several
into
11.x
4 months ago
Overview
7
Commits
9
Pipelines
9
Changes
48
3 unresolved threads
Hide all comments
Expand
Closes
#3494908
0
0
Merge request reports
Compare
11.x
version 8
12fd7b5b
4 months ago
version 7
6e9433fd
4 months ago
version 6
8e33110d
4 months ago
version 5
5440b370
4 months ago
version 4
1e8745ad
4 months ago
version 3
b5029f2b
4 months ago
version 2
969c2e06
4 months ago
version 1
573421e1
4 months ago
11.x (base)
and
latest version
latest version
073ae94b
9 commits,
4 months ago
version 8
12fd7b5b
8 commits,
4 months ago
version 7
6e9433fd
8 commits,
4 months ago
version 6
8e33110d
7 commits,
4 months ago
version 5
5440b370
6 commits,
4 months ago
version 4
1e8745ad
3 commits,
4 months ago
version 3
b5029f2b
2 commits,
4 months ago
version 2
969c2e06
1 commit,
4 months ago
version 1
573421e1
1 commit,
4 months ago
48 files
+
542
−
415
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
48
Search (e.g. *.vue) (Ctrl+P)
core/modules/big_pipe/src/Hook/BigPipeThemeSuggestionsHooks.php
0 → 100644
+
52
−
0
Options
<?php
namespace
Drupal\big_pipe\Hook
;
use
Drupal\Core\Hook\Attribute\Hook
;
/**
* Theme suggestions for big_pipe.
*/
class
BigPipeThemeSuggestionsHooks
{
/**
* Implements hook_theme_suggestions_HOOK().
*/
#[Hook('theme_suggestions_big_pipe_interface_preview')]
public
function
themeSuggestionsBigPipeInterfacePreview
(
array
$variables
)
:
array
{
$common_callbacks_simplified_suggestions
=
[
'Drupal_block_BlockViewBuilder__lazyBuilder'
=>
'block'
,
];
$suggestions
=
[];
$suggestion
=
'big_pipe_interface_preview'
;
if
(
$variables
[
'callback'
])
{
$callback
=
preg_replace
(
'/[^a-zA-Z0-9]/'
,
'_'
,
$variables
[
'callback'
]);
if
(
is_array
(
$callback
))
{
$callback
=
implode
(
'__'
,
$callback
);
}
// Use simplified template suggestion, if any.
// For example, this simplifies
// big-pipe-interface-preview--Drupal-block-BlockViewBuilder--lazyBuilder--<BLOCK ID>.html.twig
// to
// big-pipe-interface-preview--block--<BLOCK ID>.html.twig
if
(
isset
(
$common_callbacks_simplified_suggestions
[
$callback
]))
{
$callback
=
$common_callbacks_simplified_suggestions
[
$callback
];
}
$suggestions
[]
=
$suggestion
.
=
'__'
.
$callback
;
if
(
is_array
(
$variables
[
'arguments'
]))
{
$arguments
=
preg_replace
(
'/[^a-zA-Z0-9]/'
,
'_'
,
$variables
[
'arguments'
]);
foreach
(
$arguments
as
$argument
)
{
if
(
empty
(
$argument
))
{
continue
;
}
$suggestions
[]
=
$suggestion
.
'__'
.
$argument
;
}
}
}
return
$suggestions
;
}
}
Loading