Author: Jonathan.Wage
Date: 2010-01-17 22:01:31 +0100 (Sun, 17 Jan 2010)
New Revision: 26783

Modified:
   
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/templates/admin.php
   
plugins/sfSympalPlugin/trunk/modules/sympal_default/lib/Basesympal_defaultActions.class.php
Log:
[1.4][sfSympalPlugin][1.0] Adding change language form to admin theme


Modified: 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/templates/admin.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/templates/admin.php
    2010-01-17 20:46:39 UTC (rev 26782)
+++ 
plugins/sfSympalPlugin/trunk/lib/plugins/sfSympalAdminPlugin/templates/admin.php
    2010-01-17 21:01:31 UTC (rev 26783)
@@ -31,6 +31,23 @@
           Signed in as <?php echo $sf_user->getUsername() ?> [<?php echo 
link_to('signout', '@sympal_signout', 'confirm=Are you sure you wish to 
signout?') ?>]
         </strong>
       </p>
+
+      <?php if (sfSympalConfig::isI18nEnabled()): ?>
+        <?php
+        $user = sfContext::getInstance()->getUser();
+        $form = new sfFormLanguage($user, array('languages' => 
sfSympalConfig::get('language_codes', null, array($user->getCulture()))));
+        unset($form[$form->getCSRFFieldName()]);
+        $widgetSchema = $form->getWidgetSchema();
+        $widgetSchema['language']->setAttribute('onChange', 
"this.form.submit();");
+        ?>
+
+        <?php echo 
$form->renderFormTag(url_for('@sympal_change_language_form')) ?>
+          <?php echo $form ?>
+        </form>
+
+        <br/>
+      <?php endif; ?>
+
       <?php echo get_sympal_admin_menu() ?>
     </div>
 

Modified: 
plugins/sfSympalPlugin/trunk/modules/sympal_default/lib/Basesympal_defaultActions.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/modules/sympal_default/lib/Basesympal_defaultActions.class.php
 2010-01-17 20:46:39 UTC (rev 26782)
+++ 
plugins/sfSympalPlugin/trunk/modules/sympal_default/lib/Basesympal_defaultActions.class.php
 2010-01-17 21:01:31 UTC (rev 26783)
@@ -25,7 +25,7 @@
 
     $this->getUser()->setFlash('notice', 'Changed language successfully!');
 
-    return $this->redirect(str_replace('/'.$oldCulture.'/', 
'/'.$newCulture.'/', $this->getUser()->getReferer('@homepage')));
+    return $this->redirect(str_replace('/'.$oldCulture.'/', 
'/'.$newCulture.'/', 
$this->getRequest()->getReferer($this->getUser()->getReferer('@homepage'))));
   }
 
   public function executeAsk_confirmation(sfWebRequest $request)

-- 
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