-
Notifications
You must be signed in to change notification settings - Fork 9
/
taxonomy_menu.module
50 lines (44 loc) · 1.32 KB
/
taxonomy_menu.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
<?php
/**
* @file
* Contains taxonomy_menu.module.
*/
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_menu_help().
*/
function taxonomy_menu_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.taxonomy_menu':
return t('<p>The Taxonomy Menu module transforms your taxonomy vocabularies into menus.</p>
<p>See the <a href=":project_page">project page on Drupal.org</a> for more details.</p>',
[
':project_page' => 'https://www.drupal.org/project/taxonomy_menu',
]);
}
}
/**
* Implements hook_entity_insert().
*
* Check for taxonomy term insert.
*/
function taxonomy_menu_taxonomy_term_insert(EntityInterface $entity) {
\Drupal::service('taxonomy_menu.helper')->generateTaxonomyMenuEntries($entity, FALSE);
}
/**
* Implements hook_entity_delete().
*
* Check for taxonomy term deletion.
*/
function taxonomy_menu_taxonomy_term_delete(EntityInterface $entity) {
\Drupal::service('taxonomy_menu.helper')->removeTaxonomyMenuEntries($entity, FALSE);
}
/**
* Implements hook_entity_update().
*
* Check for taxonomy term updates.
*/
function taxonomy_menu_taxonomy_term_update(EntityInterface $entity) {
\Drupal::service('taxonomy_menu.helper')->updateTaxonomyMenuEntries($entity, FALSE);
}