-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeslib.install
193 lines (188 loc) · 7.75 KB
/
geslib.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
<?php
// $Id: geslib.install
/**
* Implements hook_install().
*/
function geslib_install() {
# Configure default geslib vars
variable_set('geslib_link_content_field', NULL);
variable_set('geslib_upload_path', NULL);
variable_set('geslib_delete_imported_files', NULL);
variable_set('geslib_upload_cover_path', NULL);
variable_set('geslib_delete_original_covers', NULL);
variable_set('geslib_dilve_user', NULL);
variable_set('geslib_dilve_pass', NULL);
variable_set('geslib_category_node_type', "materias");
variable_set('geslib_category_default_name', "NULL");
variable_set('geslib_publisher_node_type', "editorial");
variable_set('geslib_music_publisher_node_type', NULL);
variable_set('geslib_collection_node_type', NULL);
variable_set('geslib_collection_link_to_publisher', NULL);
variable_set('geslib_collection_default_name', NULL);
variable_set('geslib_author_node_type', "autor");
variable_set('geslib_publisher_reference_node_type', NULL);
variable_set('geslib_library_reference_node_type', NULL);
variable_set('geslib_index_node_type', NULL);
variable_del('geslib_index_node_body_format', '2');
variable_set('geslib_book_node_type', "product");
variable_set('geslib_book_geslib_type', "L0");
variable_set('geslib_book_attribute_type', NULL);
variable_set('geslib_book_download_info', NULL);
variable_set('geslib_book_default_image', NULL);
variable_set('geslib_book_file_cover_field', 'field_image_cache');
variable_set('geslib_book_file_preview_field', 'field_image_cache');
variable_set('geslib_book_body_from', 'publisher_reference');
variable_set('geslib_book_link_to_category', 'field_materia');
variable_set('geslib_book_link_to_author', 'field_autor');
variable_set('geslib_book_link_to_illustrator', 'field_autor');
variable_set('geslib_book_link_to_translator', NULL);
variable_set('geslib_book_create_fake_author', NULL);
variable_set('geslib_book_link_to_publisher', 'field_editorial');
variable_set('geslib_book_link_to_collection', 'field_coleccion');
variable_set('geslib_book_attribute_subtitle', NULL);
variable_set('geslib_book_attribute_isbn', NULL);
variable_set('geslib_book_attribute_ean', NULL);
variable_set('geslib_book_link_to_index', NULL);
variable_set('geslib_book_link_to_library_reference', NULL);
variable_set('geslib_book_link_to_publisher_reference', NULL);
variable_set('geslib_book_attribute_external_description', 'field_descripcion_externa');
variable_set('geslib_book_attribute_pages', 'field_paginas');
variable_set('geslib_book_attribute_language', 'field_idioma');
variable_set('geslib_book_attribute_year', 'field_anno_publicacion');
variable_set('geslib_book_attribute_edition', 'field_numero_edicion');
variable_set('geslib_book_attribute_edition_date', NULL);
variable_set('geslib_book_attribute_registration_date', NULL);
variable_set('geslib_book_attribute_status', NULL);
variable_set('geslib_book_attribute_format', 'field_formato');
variable_set('geslib_book_attribute_alt_location', NULL);
variable_set('geslib_book_attribute_location', NULL);
variable_set('geslib_book_attribute_classification', NULL);
variable_set('geslib_book_attribute_vat', NULL);
variable_set('geslib_other_node_type', "varios");
variable_set('geslib_other_body_from', 'publisher_reference');
variable_set('geslib_other_default_image', NULL);
variable_set('geslib_other_file_cover_field', 'field_image_cache');
variable_set('geslib_other_file_preview_field', 'field_image_cache');
}
/**
* Implements hook_uninstall().
*/
function geslib_uninstall() {
# Clear geslib vars
variable_del('geslib_link_content_field');
variable_del('geslib_upload_path');
variable_del('geslib_delete_imported_files');
variable_del('geslib_upload_cover_path');
variable_del('geslib_delete_original_covers');
variable_del('geslib_dilve_user');
variable_del('geslib_dilve_pass');
variable_del('geslib_category_node_type');
variable_del('geslib_category_default_name');
variable_del('geslib_publisher_node_type');
variable_del('geslib_music_publisher_node_type');
variable_del('geslib_collection_node_type');
variable_del('geslib_collection_link_to_publisher');
variable_del('geslib_collection_default_name');
variable_del('geslib_author_node_type');
variable_del('geslib_publisher_reference_node_type');
variable_del('geslib_library_reference_node_type');
variable_del('geslib_index_node_type');
variable_del('geslib_index_node_body_format');
variable_del('geslib_book_node_type');
variable_del('geslib_book_geslib_type');
variable_del('geslib_book_attribute_type');
variable_del('geslib_book_download_info');
variable_del('geslib_book_default_image');
variable_del('geslib_book_file_cover_field');
variable_del('geslib_book_file_preview_field');
variable_del('geslib_book_body_from');
variable_del('geslib_book_link_to_category');
variable_del('geslib_book_link_to_author');
variable_del('geslib_book_link_to_illustrator');
variable_del('geslib_book_link_to_translator');
variable_del('geslib_book_create_fake_author');
variable_del('geslib_book_link_only_authors');
variable_del('geslib_book_link_to_publisher');
variable_del('geslib_book_link_to_collection');
variable_del('geslib_book_attribute_subtitle');
variable_del('geslib_book_attribute_isbn');
variable_del('geslib_book_attribute_ean');
variable_del('geslib_book_link_to_index');
variable_del('geslib_book_link_to_library_reference');
variable_del('geslib_book_link_to_publisher_reference');
variable_del('geslib_book_attribute_external_description');
variable_del('geslib_book_attribute_pages');
variable_del('geslib_book_attribute_language');
variable_del('geslib_book_attribute_year');
variable_del('geslib_book_attribute_edition');
variable_del('geslib_book_attribute_edition_date');
variable_del('geslib_book_attribute_registration_date');
variable_del('geslib_book_attribute_status');
variable_del('geslib_book_attribute_format');
variable_del('geslib_book_attribute_alt_location');
variable_del('geslib_book_attribute_location');
variable_del('geslib_book_attribute_classification');
variable_del('geslib_book_attribute_vat');
variable_del('geslib_other_node_type');
variable_del('geslib_other_body_from');
variable_del('geslib_other_default_image');
variable_del('geslib_other_file_cover_field');
variable_del('geslib_other_file_preview_field');
}
/**
* Implements hook_schema().
*/
function geslib_schema() {
$schema = array();
$schema['geslib_log'] = array(
'description' => 'Store geslib import activity.',
'fields' => array(
'id' => array(
'description' => 'ID of import',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'start_date' => array(
'description' => 'Importing beginning date',
'type' => 'int',
'not null' => TRUE,
),
'end_date' => array(
'description' => 'Importing ending date',
'type' => 'int',
),
'imported_file' => array(
'description' => 'Imported file',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'component' => array(
'description' => 'Element imported.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
),
'count' => array(
'description' => 'Number of imported elements.',
'type' => 'int',
'unsigned' => TRUE,
),
'status' => array(
'description' => 'Import status',
'type' => 'varchar',
'length' => 32,
),
'uid' => array(
'description' => 'User id.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('id'),
);
return $schema;
}