diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-16 23:57:33 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-16 23:57:33 +0000 |
commit | 574a2e47eea1bc8e2ea13240e407a32e4b728560 (patch) | |
tree | 7c124110e7e71df958fff50b2fb8e0832dd18204 /modules/locale | |
parent | 18d22419f3da39ca4bf92f46d605a25957f311be (diff) | |
download | brdo-574a2e47eea1bc8e2ea13240e407a32e4b728560.tar.gz brdo-574a2e47eea1bc8e2ea13240e407a32e4b728560.tar.bz2 |
- Patch #345866 by alexanderpas, justinrandell, Dave Reid: remove from hook_block().
Diffstat (limited to 'modules/locale')
-rw-r--r-- | modules/locale/locale.module | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module index ee2c4e77f..c44303292 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -570,20 +570,24 @@ function locale_js_alter(&$javascript) { // Language switcher block /** - * Implementation of hook_block(). - * Displays a language switcher. Translation links may be provided by other modules. + * Implementation of hook_block_list(). */ -function locale_block($op = 'list', $delta = '') { - if ($op == 'list') { - $block['language-switcher']['info'] = t('Language switcher'); - // Not worth caching. - $block['language-switcher']['cache'] = BLOCK_NO_CACHE; - return $block; - } +function locale_block_list() { + $block['language-switcher']['info'] = t('Language switcher'); + // Not worth caching. + $block['language-switcher']['cache'] = BLOCK_NO_CACHE; + return $block; +} - // Only show if we have at least two languages and language dependent - // web addresses, so we can actually link to other language versions. - elseif ($op == 'view' && variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) { +/** + * Implementation of hook_block_view(). + * + * Displays a language switcher. Translation links may be provided by other modules. + * Only show if we have at least two languages and language dependent + * web addresses, so we can actually link to other language versions. + */ +function locale_block_view($delta = '') { + if (variable_get('language_count', 1) > 1 && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) { $path = drupal_is_front_page() ? '<front>' : $_GET['q']; $languages = language_list('enabled'); $links = array(); |