forked from nuvoleweb/ui_patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui_patterns.module
42 lines (36 loc) · 984 Bytes
/
ui_patterns.module
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
33
34
35
36
37
38
39
40
41
<?php
/**
* @file
* Contains ui_patterns.module.
*/
use Drupal\ui_patterns\UiPatterns;
/**
* 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],
],
] + UiPatterns::getManager()->hookTheme();
}
/**
* Implements hook_theme_suggestions_HOOK_alter()
*/
function ui_patterns_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
if (UiPatterns::getManager()->isPatternHook($hook) && !empty($variables['context'])) {
\Drupal::moduleHandler()->alter('ui_patterns_suggestions', $suggestions, $variables, $variables['context']);
}
}
/**
* Implements hook_library_info_build()
*/
function ui_patterns_library_info_build() {
return UiPatterns::getManager()->hookLibraryInfoBuild();
}