You are here

function i18n_block in Internationalization 5.2

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

Language block

This is a simple language switcher which knows nothing about translations

File

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

Code

function i18n_block($op = 'list', $delta = 0) {
  if ($op == 'list') {
    $blocks[0]['info'] = t('Language switcher (Interface only)');
  }
  elseif ($op == 'view') {
    $blocks['subject'] = t('Languages');
    $query = drupal_query_string_encode($_GET, array(
      'q',
    ));
    $blocks['content'] = theme('item_list', i18n_get_links($_GET['q'], empty($query) ? NULL : $query));
  }
  return $blocks;
}