Forked from
project / ui_patterns
630 commits behind the upstream repository.
-
Antonio De Marco authoredAntonio De Marco authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ui_patterns.module 1.26 KiB
<?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],
],
'patterns_destination' => [
'variables' => ['sources' => NULL, 'context' => 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']);
}
if ($hook == 'patterns_destination' && !empty($variables['context'])) {
\Drupal::moduleHandler()->alter('ui_patterns_destination_suggestions', $suggestions, $variables, $variables['context']);
}
}
/**
* Implements hook_library_info_build()
*/
function ui_patterns_library_info_build() {
return UiPatterns::getManager()->hookLibraryInfoBuild();
}