forked from wearewondrous/obfuscate_email
-
Notifications
You must be signed in to change notification settings - Fork 0
/
obfuscate_email.module
45 lines (38 loc) · 941 Bytes
/
obfuscate_email.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
<?php
/**
* @file
* Contains obfuscate_email_field.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function obfuscate_email_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the obfuscate_email_field module.
case 'help.page.obfuscate_email':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Twig Template to obfuscate a <code>field_email</code>.') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function obfuscate_email_theme() {
$theme = [
'field__email' => [
'base hook' => 'field',
'template' => 'field--email',
],
];
return $theme;
}
/**
* Implements hook_page_attachments_alter().
*/
function obfuscate_email_page_attachments_alter(&$page) {
$page['#attached']['library'][] = 'obfuscate_email/default';
}