admin_language.install in Administration Language 6
Same filename and directory in other branches
Update functions for Administration language.
File
admin_language.installView source
<?php
/**
 * @file
 * Update functions for Administration language.
 */
/* --- HOOKS ---------------------------------------------------------------- */
/**
 * Implementation of hook_install().
 */
function admin_language_install() {
  db_query("UPDATE {system} SET weight = -1 WHERE name = 'admin_language'");
}
/**
 * Implementation of hook_uninstall().
 */
function admin_language_uninstall() {
  variable_del('admin_language_default');
  variable_del('admin_language_force_default');
  variable_del('admin_language_force_neutral');
  variable_del('admin_language_hide_node');
  variable_del('admin_language_hide_user');
  variable_del('admin_language_pages');
  variable_del('admin_language_translate_admin_menu');
  variable_del('admin_language_visibility');
}
/* --- UPDATES -------------------------------------------------------------- */
/**
 * Implementation of hook_update_N().
 */
function admin_language_update_6100() {
  $ret = array();
  $result = db_query('SELECT pid, perm FROM {permission}');
  while ($perm = db_fetch_object($result)) {
    $perm->perm = str_replace('display admin pages in english', 'display admin pages in another language', $perm->perm);
    $ret[] = update_sql("UPDATE {permission} SET perm = '{$perm->perm}' WHERE pid = {$perm->pid}");
  }
  return $ret;
}
/**
 * Implementation of hook_update_N().
 */
function admin_language_update_6101() {
  $ret = array();
  variable_del('admin_language_sections');
  return $ret;
}
/**
 * Implementation of hook_update_N().
 */
function admin_language_update_6102() {
  $ret = array();
  $ret[] = update_sql("UPDATE {system} SET weight = -1 WHERE name = 'admin_language'");
  return $ret;
}
/**
 * Implementation of hook_update_N().
 */
function admin_language_update_6103() {
  $ret = array();
  $hide = variable_get('admin_language_hide', 0);
  variable_del('admin_language_hide');
  variable_set('admin_language_hide_node', $hide);
  return $ret;
}Functions
| Name   | Description | 
|---|---|
| admin_language_install | Implementation of hook_install(). | 
| admin_language_uninstall | Implementation of hook_uninstall(). | 
| admin_language_update_6100 | Implementation of hook_update_N(). | 
| admin_language_update_6101 | Implementation of hook_update_N(). | 
| admin_language_update_6102 | Implementation of hook_update_N(). | 
| admin_language_update_6103 | Implementation of hook_update_N(). | 
