-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathab_tests.module
57 lines (49 loc) · 1.6 KB
/
ab_tests.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare(strict_types=1);
/**
* @file
* Provides core functionality for the A/B Tests module.
*/
use Drupal\ab_tests\Hook\AbTestsHooks;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Hook\Attribute\LegacyHook;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*
* Provides help content for the A/B Tests module.
*/
#[LegacyHook]
function ab_tests_help(string $route_name, RouteMatchInterface $route_match) {
return \Drupal::service(AbTestsHooks::class)->help($route_name, $route_match);
}
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
#[LegacyHook]
function ab_tests_form_node_type_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
return \Drupal::service(AbTestsHooks::class)->formNodeTypeFormAlter($form, $form_state, $form_id);
}
/**
* Implements hook_entity_view_alter().
*/
#[LegacyHook]
function ab_tests_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
return \Drupal::service(AbTestsHooks::class)->entityViewAlter($build, $entity, $display);
}
/**
* Implements hook_entity_view_mode_alter().
*/
#[LegacyHook]
function ab_tests_entity_view_mode_alter(&$view_mode, EntityInterface $entity) {
return \Drupal::service(AbTestsHooks::class)->entityViewModeAlter($view_mode, $entity);
}
/**
* Implements hook_preprocess_HOOK() for node.html.twig.
*/
#[LegacyHook]
function ab_tests_preprocess_node(&$variables) {
return \Drupal::service(AbTestsHooks::class)->preprocessNode($variables);
}