Author: Jonathan.Wage
Date: 2010-02-10 23:16:37 +0100 (Wed, 10 Feb 2010)
New Revision: 27861

Modified:
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
Log:
[1.4][sfSympalPlugin][1.0] Fixing change language menu from showing when i18n 
is off


Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
      2010-02-10 22:12:50 UTC (rev 27860)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/config/sfSympalAdminPluginConfiguration.class.php
      2010-02-10 22:16:37 UTC (rev 27861)
@@ -56,21 +56,24 @@
   {
     $menu = $event->getSubject();
 
-    $changeLanguage = $menu->getChild('Change Language');
-    $currentCulture = 
strtolower(sfContext::getInstance()->getUser()->getCulture());
-    $codes = sfSympalConfig::getLanguageCodes();
-    foreach ($codes as $code)
+    if (sfSympalConfig::isI18nEnabled())
     {
-      $code = strtolower($code);
-      $formatted = format_language($code);
-      if (!$formatted)
+      $changeLanguage = $menu->getChild('Change Language');
+      $currentCulture = 
strtolower(sfContext::getInstance()->getUser()->getCulture());
+      $codes = sfSympalConfig::getLanguageCodes();
+      foreach ($codes as $code)
       {
-        $formatted = format_language($code, 'en');
+        $code = strtolower($code);
+        $formatted = format_language($code);
+        if (!$formatted)
+        {
+          $formatted = format_language($code, 'en');
+        }
+        if ($formatted)
+        {
+          
$changeLanguage->addChild(image_tag('/sfSympalPlugin/images/flags/'.$code.'.png').'
 '.$formatted, '@sympal_change_language?language='.$code, 'title=Switch to 
'.$formatted);
+        }
       }
-      if ($formatted)
-      {
-        
$changeLanguage->addChild(image_tag('/sfSympalPlugin/images/flags/'.$code.'.png').'
 '.$formatted, '@sympal_change_language?language='.$code, 'title=Switch to 
'.$formatted);
-      }
     }
 
     $manageContent = $menu->getChild('Content');
@@ -234,7 +237,7 @@
       {
         if (sfContext::getInstance()->getUser()->getEditCulture() != $code)
         {
-          
$contentEditor->addChild(image_tag('/sfSympalPlugin/images/flags/'.strtolower($code).'.png').'
 Change to '.format_language($code), 
'@sympal_change_edit_language?language='.$code, 'title=Switch to 
'.format_language($code));
+          
$contentEditor->addChild(image_tag('/sfSympalPlugin/images/flags/'.strtolower($code).'.png').'
 Edit '.format_language($code), '@sympal_change_edit_language?language='.$code, 
'title=Switch to '.format_language($code));
         }
       }
     }

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to