You are here

function _i18n_init in Internationalization 6

Same name and namespace in other branches
  1. 5 i18n.module \_i18n_init()
  2. 5.2 i18n.module \_i18n_init()

Initialize multilingual variables and use them for site_frontpage

Special fix for site_frontpage, that may have been used before the language variables are loaded.

2 calls to _i18n_init()
i18n_boot in ./i18n.module
Implementation of hook_boot()
i18n_init in ./i18n.module
Implementation of hook_init().

File

./i18n.module, line 49
Internationalization (i18n) module.

Code

function _i18n_init($check_frontpage = FALSE) {
  static $done, $default_frontpage;

  // Prevent this function from running twice;
  if (!isset($done)) {
    $done = TRUE;
    $default_frontpage = variable_get('site_frontpage', 'node');
    i18n_variable_init();
  }

  // We do aditional frontpage check if this has run after first bootstrap phase.
  // But if this runs in hook_boot we should be ok
  if ($check_frontpage && $default_frontpage != variable_get('site_frontpage', 'node') && $_GET['q'] == drupal_get_normal_path($default_frontpage)) {
    $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node'));
  }
}