forked from nuvoleweb/ui_patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui_patterns.module
More file actions
32 lines (29 loc) · 847 Bytes
/
ui_patterns.module
File metadata and controls
32 lines (29 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* @file
* Contains ui_patterns.module.
*/
/**
* Implements hook_theme().
*/
function ui_patterns_theme() {
return [
'patterns_overview_page' => [
'variables' => ['patterns' => NULL],
],
'patterns_single_page' => [
'variables' => ['pattern' => NULL],
],
'patterns_meta_information' => [
'variables' => ['pattern' => NULL],
],
] + \Drupal::service('plugin.manager.ui_patterns')->hookTheme();
}
/**
* Implements hook_theme_suggestions_HOOK_alter()
*/
function ui_patterns_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
if (\Drupal::service('plugin.manager.ui_patterns')->isPatternHook($hook) && !empty($variables['context'])) {
\Drupal::service('module_handler')->alter('ui_patterns_suggestions', $suggestions, $variables, $variables['context']);
}
}