Newer
Older
<?php
/**
* Installation script for i18ncontent module
*/
function i18ncontent_install() {
// Create strings in the extended localization system
Jose Antonio Reyero del Prado
committed
// There seems to be some issue with module loading on install/update
}
Jose Antonio Reyero del Prado
committed
/**
* Implementatin of hook_enable()
*/
function i18ncontent_enable() {
i18ncontent_locale_refresh();
}
Jose Antonio Reyero del Prado
committed
/**
Jose Antonio Reyero del Prado
committed
* Implementation of hook_disable()
Jose Antonio Reyero del Prado
committed
* This function depends on i18nstrings, so it must be run on _disable() better than uninstall()
*/
Jose Antonio Reyero del Prado
committed
function i18ncontent_disable() {
// Remove and restore help texts
Jose Antonio Reyero del Prado
committed
$langcode = language_default('language');
foreach (node_get_types() as $type) {
Jose Antonio Reyero del Prado
committed
if (!$type->help && ($help = ts("nodetype:$type->type:help", $langcode))) {
$type->help = $help;
node_type_save($type);
}
}
// @ TODO Some more clean up for strings
}
/**
* The old module with the same name had a different approach, so the update will be full install
*/
function i18ncontent_update_1() {
$ret = array();
drupal_load('module', 'i18ncontent');
Jose Antonio Reyero del Prado
committed
i18ncontent_locale_refresh();
return $ret;
}