-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcapable.module
More file actions
40 lines (36 loc) · 1015 Bytes
/
Copy pathcapable.module
File metadata and controls
40 lines (36 loc) · 1015 Bytes
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
<?php
/**
* Implements hook_help().
*
* Displays help and module information.
*
* @param path
* Which path of the site we're using to display help
* @param arg
* Array that holds the current path as returned from arg() function
*/
function capable_help($path, $arg) {
switch ($path) {
case "help.page.capable":
return '' . t("You have sucessfully added a hook into your custom Capable module!") . '';
break;
}
}
// Load main library to all pages with hook_page_attachments
function capable_page_attachments(array &$page) {
$page['#attached']['library'][] = 'capable/main';
}
/** To attach a library to a certain existing '#type',
* for all instances of it, we use hook_element_info_alter():
*/
function capable_element_info_alter(array &$types) {
if (isset($types['select'])) {
$types['select']['#attached']['library'][] = 'capable/miscellaneous';
}
}
function capable_theme() {
$theme['welcome_page'] = [
'template' => 'welcome',
];
return $theme;
};