1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Installation file for i18n_sync module.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Set module weight.
|
10 |
|
|
*
|
11 |
|
|
* Make sure this runs after taxonomy, i18n and translation modules
|
12 |
|
|
* and ideally after all other modules implementing nodeapi hook.
|
13 |
|
|
*/
|
14 |
|
|
function i18n_sync_install() {
|
15 |
|
|
db_query("UPDATE {system} SET weight = 100 WHERE name = 'i18n_sync' AND type = 'module'");
|
16 |
|
|
// If updating from D6, module changed name
|
17 |
|
|
if (variable_get('i18n_drupal6_update')) {
|
18 |
|
|
i18n_sync_update_7000();
|
19 |
|
|
}
|
20 |
|
|
}
|
21 |
|
|
|
22 |
|
|
/*
|
23 |
|
|
* Update variable names from Drupal 6
|
24 |
|
|
*/
|
25 |
|
|
function i18n_sync_update_7000() {
|
26 |
|
|
foreach (node_type_get_types() as $type => $info) {
|
27 |
|
|
if ($fields = variable_get('i18nsync_nodeapi_' . $type)) {
|
28 |
|
|
variable_set('i18n_sync_node_type_' . $type, $fields);
|
29 |
|
|
variable_del('i18nsync_nodeapi_' . $type);
|
30 |
|
|
}
|
31 |
|
|
}
|
32 |
|
|
} |