diff options
Diffstat (limited to 'modules/user/helpers/user_theme.php')
-rw-r--r-- | modules/user/helpers/user_theme.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 8de2d248..5b973ef3 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -18,6 +18,14 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class user_theme_Core { + static function head($theme) { + if (count(locales::installed())) { + // Needed by the languages block + $theme->script("jquery.cookie.js"); + } + return ""; + } + static function header_top($theme) { if ($theme->page_type != "login") { $view = new View("login.html"); @@ -25,4 +33,20 @@ class user_theme_Core { return $view->render(); } } + + static function sidebar_blocks($theme) { + $locales = locales::installed(); + foreach ($locales as $locale => $display_name) { + $locales[$locale] = SafeString::of_safe_html($display_name); + } + if (count($locales) > 1) { + $block = new Block(); + $block->css_id = "gUserLanguageBlock"; + $block->title = t("Select Language Preference"); + $block->content = new View("user_languages_block.html"); + $block->content->installed_locales = array_merge(array("" => t("« none »")), $locales); + $block->content->selected = (string) user::cookie_locale(); + return $block; + } + } } |