[Svn] r2873 - in trunk/roundcubemail/program: js steps/settings

trac at roundcube.net trac at roundcube.net
Thu Aug 27 08:18:55 CEST 2009


Author: thomasb
Date: 2009-08-27 01:18:54 -0500 (Thu, 27 Aug 2009)
New Revision: 2873

Modified:
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/steps/settings/save_prefs.inc
Log:
Reload settings page if language was changed

Modified: trunk/roundcubemail/program/js/app.js
===================================================================
--- trunk/roundcubemail/program/js/app.js	2009-08-26 19:15:55 UTC (rev 2872)
+++ trunk/roundcubemail/program/js/app.js	2009-08-27 06:18:54 UTC (rev 2873)
@@ -697,9 +697,9 @@
         else if (this.task=='settings' && props)
           this.load_identity(props, 'edit-identity');
         else if (this.task=='mail' && (cid = this.get_single_uid())) {
-	  var url = (this.env.mailbox == this.env.drafts_mailbox) ? '_draft_uid=' : '_uid=';
+          var url = (this.env.mailbox == this.env.drafts_mailbox) ? '_draft_uid=' : '_uid=';
           this.goto_url('compose', url+cid+'&_mbox='+urlencode(this.env.mailbox), true);
-	}
+        }
         break;
 
       case 'save-identity':
@@ -837,7 +837,7 @@
       case 'select-all':
         if (props == 'invert')
           this.message_list.invert_selection();
-	else
+        else
           this.message_list.select_all(props);
         break;
 
@@ -1214,6 +1214,16 @@
     this.set_busy(false);
     this.display_message('Request timed out!', 'error');
     };
+  
+  this.reload = function(delay)
+  {
+    if (this.env.framed && parent.rcmail)
+      parent.rcmail.reload(delay);
+    else if (delay)
+      window.setTimeout(function(){ rcmail.reload(); }, delay);
+    else if (window.location)
+      location.href = this.env.comm_path;
+  };
 
 
   /*********************************************************/

Modified: trunk/roundcubemail/program/steps/settings/save_prefs.inc
===================================================================
--- trunk/roundcubemail/program/steps/settings/save_prefs.inc	2009-08-26 19:15:55 UTC (rev 2872)
+++ trunk/roundcubemail/program/steps/settings/save_prefs.inc	2009-08-27 06:18:54 UTC (rev 2873)
@@ -102,8 +102,9 @@
   case 'general':
 
     // switch UI language
-    if (isset($_POST['_language'])) {
+    if (isset($_POST['_language']) && $a_user_prefs['language'] != $_SESSION['language']) {
       $RCMAIL->load_language($a_user_prefs['language']);
+      $OUTPUT->command('reload', 500);
     }
 
     // switch skin
@@ -132,13 +133,13 @@
     // special handling for 'default_imap_folders'
     if (in_array('default_imap_folders', (array)$CONFIG['dont_override'])) {
       foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p)
-	$a_user_prefs[$p] = $CONFIG[$p];
+        $a_user_prefs[$p] = $CONFIG[$p];
     } else {
       $a_user_prefs['default_imap_folders'] = array('INBOX');
       foreach (array('drafts_mbox','sent_mbox','junk_mbox','trash_mbox') as $p) {
-	if ($a_user_prefs[$p])
+        if ($a_user_prefs[$p])
           $a_user_prefs['default_imap_folders'][] = $a_user_prefs[$p];
-	}
+      }
     }
   
   break;

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list