You are here

l10n_client.install in Localization client 7

Same filename and directory in other branches
  1. 6.2 l10n_client.install
  2. 6 l10n_client.install

Install, uninstall and update functions for localization client.

File

l10n_client.install
View source
<?php

/**
 * @file
 *   Install, uninstall and update functions for localization client.
 */

/**
 * Update for new l10n_client_server default value.
 */
function l10n_client_update_7001() {
  $server_setting = variable_get('l10n_client_server', NULL);
  if (!variable_get('l10n_client_use_server', FALSE) && empty($server_setting) && !is_null($server_setting)) {

    // User saved empty translation server setting, and has sharing disabled now.
    // Drop the setting to fall back on the new localize.drupal.org default.
    // User will get new default when she enables sharing.
    variable_del('l10n_client_server');
  }
}

/**
 * Clear the menu cache.
 */
function l10n_client_update_7002() {

  // Clear the menu cache
  menu_cache_clear_all();
}

/**
 * Update http based localize.drupal.org address to https.
 */
function l10n_client_update_7003() {
  $server_setting = variable_get('l10n_client_server', NULL);
  if (!empty($server_setting) && $server_setting == 'http://localize.drupal.org') {
    variable_set('l10n_client_server', 'https://localize.drupal.org/');
  }
}

/**
 * Implements hook_uninstall().
 */
function l10n_client_uninstall() {
  variable_del('l10n_client_server');
  variable_del('l10n_client_use_server');
}

Functions

Namesort descending Description
l10n_client_uninstall Implements hook_uninstall().
l10n_client_update_7001 Update for new l10n_client_server default value.
l10n_client_update_7002 Clear the menu cache.
l10n_client_update_7003 Update http based localize.drupal.org address to https.