You are here

admin_language.install in Administration Language 6

Same filename and directory in other branches
  1. 7 admin_language.install

Update functions for Administration language.

File

admin_language.install
View 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