transliteration.install in Transliteration 7.3
Same filename and directory in other branches
Install, update, and uninstall functions for the transliteration module.
File
transliteration.installView source
<?php
/**
* @file
* Install, update, and uninstall functions for the transliteration module.
*/
/**
* Implements hook_install().
*/
function transliteration_install() {
module_load_include('inc', 'transliteration', 'transliteration.admin');
if (!($query = transliteration_file_query())) {
// Database not supported.
return;
}
if (!$query
->countQuery()
->execute()
->fetchColumn()) {
// Don't bother if no files need to be fixed.
return;
}
$t = get_t();
drupal_set_message($t('Transliteration has been installed. <a href="@transliteration-url">Fix existing file names</a>.', array(
'@transliteration-url' => url('admin/config/media/file-system/transliteration'),
)));
}
/**
* Implements hook_uninstall().
*/
function transliteration_uninstall() {
variable_del('transliteration_file_uploads');
variable_del('transliteration_file_lowercase');
variable_del('transliteration_file_underscore_replacement_option');
variable_del('transliteration_file_underscore_replacement');
variable_del('transliteration_search');
}
/**
* Remove unnecessary Drupal 6 variables.
*/
function transliteration_update_7300() {
// Delete all the transliteration_filter_no_known_transliteration_* variables
// and then clear the variable cache.
db_delete('variable')
->condition('name', 'transliteration_filter_no_known_transliteration_%', 'like')
->execute();
cache_clear_all('variables', 'cache');
}
Functions
Name | Description |
---|---|
transliteration_install | Implements hook_install(). |
transliteration_uninstall | Implements hook_uninstall(). |
transliteration_update_7300 | Remove unnecessary Drupal 6 variables. |