/[drupal]/contributions/modules/i18n/i18ncontent/i18ncontent.install
ViewVC logotype

Contents of /contributions/modules/i18n/i18ncontent/i18ncontent.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Thu Jun 19 08:40:01 2008 UTC (17 months ago) by drewish
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
File MIME type: text/x-php
#259726 (Xano) Call to ts() instead of st() causes fatal error.
1 <?php
2 /**
3 * Installation script for i18ncontent module
4 */
5 function i18ncontent_install() {
6 // Create strings in the extended localization system
7 foreach (node_get_types() as $type) {
8 tt("nodetype:$type->type:name", $type->name, NULL, TRUE);
9 tt("nodetype:$type->type:title", $type->title_label, NULL, TRUE);
10 tt("nodetype:$type->type:title", $type->body_label, NULL, TRUE);
11 if ($type->help) {
12 ts("nodetype:$type->type:help", $type->help, NULL, TRUE);
13 $type->help = '';
14 node_type_save($type);
15 }
16 }
17 }
18
19 /**
20 * Implementation of hook_uninstall()
21 */
22 function i18ncontent_uninstall() {
23 // Remove and restore help texts
24 $language = language_default('language');
25 foreach (node_get_types() as $type) {
26 if (!$type->help && ($help = st("nodetype:$type->type:help", $language))) {
27 $type->help = $help;
28 node_type_save($type);
29 }
30 }
31 // @ TODO Some more clean up for strings
32 }
33
34 /**
35 * The old module with the same name had a different approach, so the update will be full install
36 */
37 function i18ncontent_update_1() {
38 $ret = array();
39 i18ncontent_install();
40 return $ret;
41 }

  ViewVC Help
Powered by ViewVC 1.1.2