-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhelfi_node_landing_page.module
More file actions
94 lines (87 loc) · 2.49 KB
/
helfi_node_landing_page.module
File metadata and controls
94 lines (87 loc) · 2.49 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* @file
* Contains hooks for 'helfi_node_landing_page' module.
*/
declare(strict_types=1);
use Drupal\helfi_platform_config\DTO\ParagraphTypeCollection;
/**
* Implements hook_platform_config_grant_permissions().
*/
function helfi_node_landing_page_platform_config_grant_permissions() : array {
return [
'admin' => [
'create landing_page content',
'delete any landing_page content',
'delete landing_page revisions',
'delete own landing_page content',
'edit any landing_page content',
'edit own landing_page content',
'revert landing_page revisions',
'set landing_page published on date',
'translate landing_page node',
'view landing_page revisions',
],
'content_producer' => [
'create landing_page content',
'delete own landing_page content',
'edit any landing_page content',
'edit own landing_page content',
'revert landing_page revisions',
'set landing_page published on date',
'translate landing_page node',
'view any unpublished landing_page content',
'view landing_page revisions',
],
'editor' => [
'create landing_page content',
'delete any landing_page content',
'delete landing_page revisions',
'delete own landing_page content',
'edit any landing_page content',
'edit own landing_page content',
'revert landing_page revisions',
'set landing_page published on date',
'translate landing_page node',
'view landing_page revisions',
],
'read_only' => [
'view any unpublished landing_page content',
],
];
}
/**
* Implements hook_helfi_paragraph_types().
*/
function helfi_node_landing_page_helfi_paragraph_types() : array {
$types = [
'field_hero' => [
'hero' => 0,
],
'field_content' => [
'list_of_links' => 0,
'content_cards' => 1,
'banner' => 2,
'liftup_with_image' => 3,
'popular_services' => 4,
'from_library' => 5,
'columns' => 6,
'phasing' => 7,
'map' => 8,
'remote_video' => 9,
'chart' => 10,
'target_group_links' => 12,
'event_list' => 13,
'news_list' => 14,
'image_gallery' => 15,
'number_highlights' => 16,
],
];
$enabled = [];
foreach ($types as $field => $paragraphTypes) {
foreach ($paragraphTypes as $paragraphType => $weight) {
$enabled[] = new ParagraphTypeCollection('node', 'landing_page', $field, $paragraphType, $weight);
}
}
return $enabled;
}