-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathding_user_consent.admin.inc
More file actions
107 lines (102 loc) · 4.13 KB
/
ding_user_consent.admin.inc
File metadata and controls
107 lines (102 loc) · 4.13 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
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
/**
* @file
* Ding user pages.
*/
/**
* Form builder, user authentication.
*
* This copies the regular user login form on purpose. By making it
* look like the regular login form, modules wanting to make changes
* can just form_alter them both.
*
* @ingroup forms
*/
function ding_user_consent_admin_form($form, &$form_state) {
$consents = ding_provider_invoke('user_consent', 'info');
foreach ($consents as $id => $values) {
$form[$id] = array(
'#type' => 'fieldset',
'#title' => t('Consent'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
// Consent description link
$form[$id][$id . '_description_link'] = array(
'#type' => 'textfield',
'#title' => t('Link to consent description'),
'#description' => t('Write a link to the page containing a description of user consent. Use wither the format node/$nid or a path alias.'),
'#default_value' => variable_get($id . '_description_link', ''),
);
// First time message
$form[$id]['first_time'] = array(
'#type' => 'fieldset',
'#title' => t('First time'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form[$id]['first_time'][$id . '_title_first_time'] = array(
'#type' => 'textfield',
'#title' => t('First login message title'),
'#description' => t('Write a title for the message which a first time user will receive'),
'#default_value' => variable_get($id . '_title_first_time', ''),
);
$description = variable_get($id . '_description_first_time', '');
$description = (is_array($description)) ? $description['value'] : $description;
$form[$id]['first_time'][$id . '_description_first_time'] = array(
'#type' => 'text_format',
'#title' => t('First login message description'),
'#description' => t('Write a message for a first time user'),
'#default_value' => $description,
'#format' => 'ding_wysiwyg',
);
// User consent request message
$form[$id]['request'] = array(
'#type' => 'fieldset',
'#title' => t('Request'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form[$id]['request'][$id . '_title'] = array(
'#type' => 'textfield',
'#title' => t('Consent title'),
'#description' => t('Write a title for the message which the user will see when requested to give consent'),
'#default_value' => variable_get($id . '_title', $values['title']),
);
$description = variable_get($id . '_description', $values['description']);
$description = (is_array($description)) ? $description['value'] : $description;
$form[$id]['request'][$id . '_description'] = array(
'#type' => 'text_format',
'#title' => t('Consent description'),
'#description' => t('Write a message for the user when requested to give consent'),
'#default_value' => $description,
'#format' => 'ding_wysiwyg',
);
// Token message
$form[$id]['token'] = array(
'#type' => 'fieldset',
'#title' => t('Token'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$description = variable_get($id . '_description_token', $values['description']);
$description = (is_array($description)) ? $description['value'] : $description;
$form[$id]['token'][$id . '_description_token'] = array(
'#type' => 'text_format',
'#title' => t('Consent description'),
'#description' => t('Write a message to display in the form which is inserted into a text area'),
'#default_value' => $description,
'#format' => 'ding_wysiwyg',
);
$description = variable_get($id . '_description_token_given', $values['description']);
$description = (is_array($description)) ? $description['value'] : $description;
$form[$id]['token'][$id . '_description_token_given'] = array(
'#type' => 'text_format',
'#title' => t('Consent description'),
'#description' => t('Write a message to display in the form which is inserted into a text area but the user has already given consent'),
'#default_value' => $description,
'#format' => 'ding_wysiwyg',
);
}
return system_settings_form($form);
}