Move changeLanguage() into Horde_Registry_Application
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 20:55:52 +0000 (14:55 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 11 Aug 2009 20:55:52 +0000 (14:55 -0600)
imp/lib/Api.php
imp/lib/Application.php

index d78651a..cfc2911 100644 (file)
@@ -46,26 +46,6 @@ class IMP_Api extends Horde_Registry_Api
     }
 
     /**
-     * Performs tasks necessary when the language is changed during the
-     * session.
-     */
-    public function changeLanguage()
-    {
-        require_once dirname(__FILE__) . '/Application.php';
-        try {
-            new IMP_Application(array('init' => array('authentication' => 'throw')));
-        } catch (Horde_Exception $e) {
-            return;
-        }
-
-        $imp_folder = IMP_Folder::singleton();
-        $imp_folder->clearFlistCache();
-        $imaptree = IMP_Imap_Tree::singleton();
-        $imaptree->init();
-        $GLOBALS['imp_search']->initialize(true);
-    }
-
-    /**
      * Returns a list of authentication credentials, i.e. server settings that
      * can be specified by the user on the login screen.
      *
index d26f853..ad9887d 100644 (file)
@@ -725,4 +725,25 @@ class IMP_Application extends Horde_Registry_Application
         }
     }
 
+    /* Language change callback. */
+
+    /**
+     * Performs tasks necessary when the language is changed during the
+     * session.
+     */
+    public function changeLanguage()
+    {
+        try {
+            $this->init(array('authentication' => 'throw'));
+        } catch (Horde_Exception $e) {
+            return;
+        }
+
+        $imp_folder = IMP_Folder::singleton();
+        $imp_folder->clearFlistCache();
+        $imaptree = IMP_Imap_Tree::singleton();
+        $imaptree->init();
+        $GLOBALS['imp_search']->initialize(true);
+    }
+
 }