forked from CornellCustomDev/CD-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
finder.module
56 lines (43 loc) · 1.22 KB
/
finder.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
<?PHP
function finder_theme($existing, $type, $theme, $path) {
return [
'finder' => [
'variables' => [],
'template' => 'finder',
],
];
}
// see https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-from-custom-module
// the template => was found on
// https://www.drupal.org/node/2878499
/**
* Implements hook_mail().
*/
function finder_mail($key, &$message, $params) {
$options = array(
'langcode' => $message['langcode'],
);
switch ($key) {
case 'complete_form':
$message['from'] = \Drupal::config('system.site')->get('mail');
// removed from following array: '@title' => $params['node_title']
$message['subject'] = t('Finder email', array(), $options);
$message['body'][] = $params['message'];
break;
}
}
/**
* this gets the configuration page to show up
*/
function finder_menu() {
$items = array();
$items['admin/config/content/finder'] = array(
'title' => 'Finder',
'description' => 'Configuration for Finder module',
'page callback' => 'drupal_get_form',
'page arguments' => array('finder_admin_settings'),
'access arguments' => array('access administration pages'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}