From b46346aab6df6272c9b1106783ea9b3006519ecf Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 13 Oct 2009 13:56:44 -0700 Subject: Optimize the creation of the language block --- modules/gallery/helpers/gallery_block.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index d8812c80..6c08d39a 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -93,10 +93,10 @@ class gallery_block_Core { case "language": $locales = locales::installed(); - foreach ($locales as $locale => $display_name) { - $locales[$locale] = SafeString::of_safe_html($display_name); - } - if (count($locales) > 1) { + if (count($locales)) { + foreach ($locales as $locale => $display_name) { + $locales[$locale] = SafeString::of_safe_html($display_name); + } $block = new Block(); $block->css_id = "g-user-language-block"; $block->title = t("Language Preference"); -- cgit v1.2.3