forked from whikloj/manidora
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanidora.install
264 lines (256 loc) · 6 KB
/
manidora.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?php
/**
* @file
* Holds Manidora install/uninstall hooks.
*/
/**
* Implements hook_schema().
*/
function manidora_schema() {
$schema['manidora_omit_collections'] = [
'description' => 'Collections to skip from displaying on homepage',
'fields' => [
'pid' => [
'description' => 'The object PID to use',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
],
'title' => [
'description' => 'Collection title for reference',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
],
'exclude_object' => [
'description' => 'Whether to exclude the object.',
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 1,
],
'exclude_children' => [
'description' => 'Whether to exclude children of this object.',
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
],
'indexes' => [
'exclude_object' => ['exclude_object'],
'exclude_children' => ['exclude_children'],
],
'primary key' => ['pid'],
];
return $schema;
}
/**
* Implements hook_install().
*/
function manidora_install() {
manidora_add_dental_taxonomy();
}
/**
* Implements hook_uninstall().
*/
function manidora_uninstall() {
// Delete dental taxonomy.
manidora_remove_dental_taxonomy();
// Removing variables.
$variables = array(
'manidora_collection_solr_field',
'manidora_omit_collection_ancestor_field',
'manidora_name_role_search_field',
'manidora_name_role_roles_field',
'manidora_thumbnail_pids',
);
foreach ($variables as $variable) {
variable_del($variable);
}
}
/**
* Implements hook_update_N().
*/
function manidora_update_7100() {
// Add Taxonomy terms if they are not present.
manidora_add_dental_taxonomy();
}
/**
* Creates the Dental taxonomy.
*/
function manidora_add_dental_taxonomy() {
$vocabulary = taxonomy_vocabulary_machine_name_load('manidora_general_dental_tags');
// Create the Vocabulary if it doesn't exist.
if ($vocabulary === FALSE) {
taxonomy_vocabulary_save((object) array(
'name' => 'General Dental Tags',
'machine_name' => 'manidora_general_dental_tags',
'description' => 'General Dental Tags',
)
);
}
$vocabulary = taxonomy_vocabulary_machine_name_load('manidora_general_dental_tags');
// Each tag install.
$tags = array(
'acrylic',
'acrylic retention',
'anatomy',
'attached gingiva',
'beading',
'bolus',
'bone loss',
'bone resorption',
'bone spicules',
'breast vertical dimension',
'buccal contour',
'buccal frena',
'calculus',
'candida',
'candidiasis',
'circumvallate papilla',
'clinical remount',
'combination clasp',
'combination syndrome',
'complete denture',
'composite resin',
'compound',
'coronoid process',
'cyst',
'denture adjustment',
'denture flange',
'denture periphery',
'denture stomatitis',
'dentures',
'disto-buccal space',
'doggie denture',
'early verrucous carcinoma',
'edentulous',
'enlarged tongue',
'enter bolus exit balance',
'epulis fissuratum',
'erthroleukoplakia',
'f sound',
'facial profile',
'festooning',
'fibroma',
'fibromatosis',
'fovea palatini',
'frenal resection',
'fungal',
'gold',
'gold foil',
'half t-clasp',
'hamular notch',
'heavy square ridges',
'horizontal overjet',
'horizontal overlap',
'humour',
'hyperplasia',
'immediate',
'incisal length',
'incisive papilla',
'inflamed incisive papilla',
'inflamed tissue',
'inflammatory fibrous hyperplasia',
'inflammatory papillary hyperplasia',
'infrabulge',
'intaglio',
'interarch records',
'interim partial',
'inuit',
'ivory',
"kelly's syndrome",
'keratinized tissue',
'labial frena',
'labial frenum',
'landmarks',
'lateral border',
'leukoplakia',
'lichen planus',
'lichenoid mucositis',
'lip biting',
'lip irritation',
'lip support',
'mandibular',
'mandibular plane angle',
'mandibular tori',
'maxilla',
'maxillary',
'mid-palatal raphe',
'muco-gingival involvement',
'nasal spine',
'nasolabial line angle',
'neutral zone',
'occlusal relations',
'occlusion',
'oral hygiene',
'overdenture',
'palatal',
'palatal mandibular raphe',
'palatal nerve',
'papillary hyperplasia',
'papilloma',
'parallel ridges',
'pathology',
'peripheries',
'phonetics',
'posterior',
'reduction',
'reline',
'repair',
'resorption pattern',
'rugae',
'short incisors',
'singulum rest',
'square maxilla',
'stabilized base',
'suction cup denture',
'surgery',
'surgical resection',
'sutures',
'tissue conditioning',
'tongue',
'tooth arrangement',
'tooth setup',
'tooth wear',
'tori',
'tori reduction',
'trial denture',
'tuberosity',
'varicose tongue',
'verruca vulgaris',
'verrucous',
'vertical dimension of occlusion',
'vulcanite',
'wax up',
'wrought wire clasp',
);
foreach ($tags as $name) {
$term = taxonomy_get_term_by_name($name, 'manidora_general_dental_tags');
if (empty($term)) {
taxonomy_term_save((object) array(
'vid' => $vocabulary->vid,
'name' => $name,
));
}
}
}
/**
* Delete's the Dental taxonomy.
*/
function manidora_remove_dental_taxonomy() {
$vocabulary = taxonomy_vocabulary_machine_name_load('manidora_general_dental_tags');
taxonomy_vocabulary_delete($vocabulary->vid);
}
/**
* Install the collection limiting database table.
*/
function manidora_update_7101() {
if (!db_table_exists('manidora_omit_collections')) {
$schema = manidora_schema();
db_create_table('manidora_omit_collections', $schema['manidora_omit_collections']);
}
}