diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-12-09 11:36:04 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-12-09 11:36:04 +0000 |
commit | 8ad5cba994367f5b5fe35a2caaae7ec321ecaebd (patch) | |
tree | 1369c05e8399685116fea5939051eb4855017f26 /modules/locale | |
parent | c0cb68abccfa5daa442ad3deb410b81c7da7a52b (diff) | |
download | brdo-8ad5cba994367f5b5fe35a2caaae7ec321ecaebd.tar.gz brdo-8ad5cba994367f5b5fe35a2caaae7ec321ecaebd.tar.bz2 |
- Patch #344661 by Dave Reid: API doc improvements for hook_translation_link_alter.
Diffstat (limited to 'modules/locale')
-rw-r--r-- | modules/locale/locale.api.php | 23 | ||||
-rw-r--r-- | modules/locale/locale.module | 3 |
2 files changed, 23 insertions, 3 deletions
diff --git a/modules/locale/locale.api.php b/modules/locale/locale.api.php index 60ad3b7f1..73edea5c0 100644 --- a/modules/locale/locale.api.php +++ b/modules/locale/locale.api.php @@ -25,5 +25,28 @@ function hook_locale($op = 'groups') { } /** + * Perform alterations on translation links. + * + * A translation link may need to point to a different path or use a translated + * link text before going through l(), which will just handle the path aliases. + * + * @param $links + * Nested array of links keyed by language code. + * @param $path + * The current path. + * @return + * None. + */ +function hook_translation_link_alter(array &$links, $path) { + global $language; + + if (isset($links[$language])) { + foreach ($links[$language] as $link) { + $link['attributes']['class'] .= ' active-language'; + } + } +} + +/** * @} End of "addtogroup hooks". */ diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 99fe894f3..ee2c4e77f 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -597,9 +597,6 @@ function locale_block($op = 'list', $delta = '') { } // Allow modules to provide translations for specific links. - // A translation link may need to point to a different path or use - // a translated link text before going through l(), which will just - // handle the path aliases. drupal_alter('translation_link', $links, $path); $block['subject'] = t('Languages'); |