-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdigital_measures.install
134 lines (134 loc) · 3.46 KB
/
digital_measures.install
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
/**
* Implements hook_install() to add Digital Measures checkbox to user profile when the module is first enabled.
*/
function digital_measures_install() {
// Check if our field is not already created,
// add the field to the user account if not
if (!field_info_field('field_display_content_from_dm')) {
field_create_field(array(
'translatable' => '0',
'entity_types' => array(),
'settings' => array(
'allowed_values' => array(
'',
'',
),
'allowed_values_function' => '',
),
'storage' => array(
'type' => 'field_sql_storage',
'settings' => array(),
'module' => 'field_sql_storage',
'active' => '1',
'details' => array(
'sql' => array(
'FIELD_LOAD_CURRENT' => array(
'field_data_field_display_content_from_dm' => array(
'value' => 'field_display_content_from_dm_value',
),
),
'FIELD_LOAD_REVISION' => array(
'field_revision_field_display_content_from_dm' => array(
'value' => 'field_display_content_from_dm_value',
),
),
),
),
),
'foreign keys' => array(),
'indexes' => array(
'value' => array(
'value',
),
),
'field_permissions' => array(
'type' => '0',
),
'field_name' => 'field_display_content_from_dm',
'type' => 'list_boolean',
'module' => 'list',
'active' => '1',
'locked' => '0',
'cardinality' => '1',
'deleted' => '0',
'columns' => array(
'value' => array(
'type' => 'int',
'not null' => FALSE,
),
),
'bundles' => array(
'user' => array(
'user',
),
),
));
field_create_instance(array(
'label' => 'Display Content from Digital Measures',
'widget' => array(
'weight' => '73',
'type' => 'options_onoff',
'module' => 'options',
'active' => 1,
'settings' => array(
'display_label' => 0,
),
),
'settings' => array(
'user_register_form' => 0,
),
'display' => array(
'default' => array(
'label' => 'above',
'type' => 'list_default',
'settings' => array(),
'module' => 'list',
'weight' => 64,
),
'full' => array(
'type' => 'hidden',
'label' => 'above',
'settings' => array(),
'weight' => 0,
),
'directory_entry' => array(
'type' => 'hidden',
'label' => 'above',
'settings' => array(),
'weight' => 0,
),
'user_full_name' => array(
'type' => 'hidden',
'label' => 'above',
'settings' => array(),
'weight' => 0,
),
'token' => array(
'type' => 'hidden',
'label' => 'above',
'settings' => array(),
'weight' => 0,
),
),
'required' => 0,
'description' => 'For faculty members only. Check this box to display your CV content from Digital Measures. Visit the <a href="https://www.purdue.edu/apps/account/cas/login?service=https%3A%2F%2Fwww.purdue.edu%2Fapps%2Fidphs%2FAuthn%2FExtCas%3Fconversation%3De1s1&entityId=https%3A%2F%2Fwww.digitalmeasures.com%2Fshibboleth-sp%2F" target="blank">Digital Measures website</a> to curate your content.',
'default_value' => array(
array(
'value' => 0,
),
),
'field_name' => 'field_display_content_from_dm',
'entity_type' => 'user',
'bundle' => 'user',
'deleted' => '0',
));
}
}
/**
* Implements hook_install() to add Digital Measures checkbox to user profile when the module is first enabled.
*/
function digital_measures_uninstall() {
field_delete_field('field_display_content_from_dm');
field_purge_batch();
}