1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Installation file for Internationalization (i18n) module.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Implements hook_install().
|
10 |
|
|
*/
|
11 |
|
|
function i18n_node_install() {
|
12 |
|
|
// If updating from D6, module changed name
|
13 |
|
|
if (variable_get('i18n_drupal6_update')) {
|
14 |
|
|
i18n_node_update_7000();
|
15 |
|
|
}
|
16 |
|
|
}
|
17 |
|
|
|
18 |
|
|
/**
|
19 |
|
|
* Implements hook_uninstall().
|
20 |
|
|
*/
|
21 |
|
|
function i18n_node_uninstall() {
|
22 |
|
|
variable_del('i18n_hide_translation_links');
|
23 |
|
|
variable_del('i18n_selection_mode');
|
24 |
|
|
foreach (array_keys(node_type_get_types()) as $type) {
|
25 |
|
|
variable_del('i18n_node_' . $type);
|
26 |
|
|
}
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
/**
|
30 |
|
|
* Implements hook_update_dependencies()
|
31 |
|
|
*/
|
32 |
|
|
function i18n_node_update_dependencies() {
|
33 |
|
|
$dependencies['i18n_node'][7000] = array(
|
34 |
|
|
'i18n_string' => 7001,
|
35 |
|
|
);
|
36 |
|
|
return $dependencies;
|
37 |
|
|
}
|
38 |
|
|
|
39 |
|
|
/**
|
40 |
|
|
* Implements hook_i18n_update_drupal6().
|
41 |
|
|
*
|
42 |
|
|
* Update old string names
|
43 |
|
|
*/
|
44 |
|
|
function i18n_node_update_7000() {
|
45 |
|
|
// @todo Update from D6 i18n
|
46 |
|
|
// Variables:
|
47 |
|
|
// i18n_newnode_current, i18n_required_node, i18n_lock_node => i18n_node_options_[node_type]
|
48 |
|
|
// i18n_node => 'i18n_node_extended_[node_type]'
|
49 |
|
|
// Update string names
|
50 |
|
|
// - nodetype:type:[type]:[property] -> node:type:[type]:[property]
|
51 |
|
|
// - Property names: title -> title_label
|
52 |
|
|
module_load_install('i18n_string');
|
53 |
|
|
i18n_string_install_update_context('nodetype:type:*:*', 'node:type:*:*');
|
54 |
|
|
i18n_string_install_update_context('node:type:*:title', 'node:type:*:title_label');
|
55 |
|
|
}
|
56 |
|
|
|
57 |
|
|
/**
|
58 |
|
|
* Delete obsoleted variable for switch interface for translating.
|
59 |
|
|
*/
|
60 |
|
|
/*
|
61 |
|
|
function i18n_node_update_7001() {
|
62 |
|
|
variable_del('i18n_node_translation_switch');
|
63 |
|
|
}
|
64 |
|
|
*/ |