summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-13 13:56:44 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-13 13:56:44 -0700
commitb46346aab6df6272c9b1106783ea9b3006519ecf (patch)
tree7b9d780ced2667475fc368f0fe5979290bba8072 /modules
parent14e14003de0ae5dfe1886bec5bec435d15c7554f (diff)
Optimize the creation of the language block
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/gallery_block.php8
1 files changed, 4 insertions, 4 deletions
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");