Allow timezone to be set on call to new IMP_Application()
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 24 Nov 2009 06:35:26 +0000 (23:35 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 24 Nov 2009 06:35:26 +0000 (23:35 -0700)
imp/compose-dimp.php
imp/compose-mimp.php
imp/compose.php
imp/lib/Application.php
imp/mailbox-mimp.php
imp/mailbox.php
imp/message-mimp.php
imp/message.php
imp/thread.php

index 04615b2..3dbb9a4 100644 (file)
@@ -26,7 +26,7 @@ function _removeAutoSaveDraft($uid)
 }
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* Determine if compose mode is disabled. */
 $compose_disable = !IMP::canCompose();
@@ -49,9 +49,6 @@ if (!$prefs->isLocked('default_identity')) {
     }
 }
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Initialize the IMP_Compose:: object. */
 $imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
 
index c31dfa6..8fee695 100644 (file)
@@ -27,7 +27,7 @@ function _getIMPContents($uid, $mailbox)
 }
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* The message text and headers. */
 $msg = '';
@@ -58,9 +58,6 @@ if ($imp_imap->isReadOnly($sent_mail_folder)) {
 /* Determine if compose mode is disabled. */
 $compose_disable = !IMP::canCompose();
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Initialize the IMP_Compose:: object. */
 $imp_compose = IMP_Compose::singleton(Horde_Util::getFormData('composeCache'));
 
index fea1ae2..7d4dace 100644 (file)
@@ -57,7 +57,7 @@ function _getIMPContents($uid, $mailbox)
 
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => array('session_control' => 'netscape')));
+new IMP_Application(array('init' => array('session_control' => 'netscape'), 'tz' => true));
 
 /* The message headers and text. */
 $header = array();
@@ -133,9 +133,6 @@ if ($token = Horde_Util::getFormData('compose_formToken')) {
     }
 }
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Determine if compose mode is disabled. */
 $compose_disable = !IMP::canCompose();
 
index 39142f6..aedc47c 100644 (file)
@@ -74,6 +74,7 @@ class IMP_Application extends Horde_Registry_Application
      * <pre>
      * 'init' - (boolean|array) If true, perform application init. If an
      *          array, perform application init and pass the array to init().
+     * 'tz' - (boolean) If true, sets the current time zone on the server.
      * </pre>
      */
     public function __construct($args = array())
@@ -82,6 +83,10 @@ class IMP_Application extends Horde_Registry_Application
             $this->init(is_array($args['init']) ? $args['init'] : array());
         }
 
+        if (!empty($args['tz'])) {
+            Horde_Nls::setTimeZone();
+        }
+
         /* Only available if admin config is set for this server/login. */
         $this->disabled = array('init');
         if (empty($_SESSION['imp']['admin'])) {
index b7a9f86..1521cf8 100644 (file)
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* Determine if mailbox is readonly. */
 $readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']);
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Need Horde_Mobile init here for autoloading purposes. */
 $mimp_render = new Horde_Mobile();
 
index 31a95da..dd792e8 100644 (file)
@@ -39,7 +39,7 @@ function _outputSummaries($msgs)
 
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* Call the mailbox redirection hook, if requested. */
 try {
@@ -72,9 +72,6 @@ if (!is_array(($indices = Horde_Util::getFormData('indices')))) {
     $indices = array($indices);
 }
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 $do_filter = false;
 $imp_flags = IMP_Imap_Flags::singleton();
 $open_compose_window = null;
index 5511408..cc53f9f 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* Make sure we have a valid index. */
 $imp_mailbox = IMP_Mailbox::singleton($imp_mbox['mailbox'], $imp_mbox['uid']);
@@ -34,9 +34,6 @@ $imp_ui = new IMP_UI_Message();
 /* Determine if mailbox is readonly. */
 $readonly = $imp_imap->isReadOnly($imp_mbox['mailbox']);
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Run through action handlers */
 $actionID = Horde_Util::getFormData('a');
 $msg_delete = false;
index 6b9dc72..d709970 100644 (file)
@@ -20,7 +20,7 @@ function _returnToMailbox($startIndex = null, $actID = null)
 }
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* We know we are going to be exclusively dealing with this mailbox, so
  * select it on the IMAP server (saves some STATUS calls). Open R/W to clear
@@ -40,9 +40,6 @@ if (!$imp_mailbox->isValidIndex(false)) {
 /* Initialize IMP_Message object. */
 $imp_message = IMP_Message::singleton();
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Initialize the user's identities. */
 $user_identity = Horde_Prefs_Identity::singleton(array('imp', 'imp'));
 
index 3854c07..20f2386 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 require_once dirname(__FILE__) . '/lib/Application.php';
-new IMP_Application(array('init' => true));
+new IMP_Application(array('init' => true, 'tz' => true));
 
 /* What mode are we in?
  * DEFAULT/'thread' - Thread mode
@@ -42,9 +42,6 @@ if ($error) {
     exit;
 }
 
-/* Set the current time zone. */
-Horde_Nls::setTimeZone();
-
 /* Run through action handlers. */
 $actionID = Horde_Util::getFormData('actionID');
 switch ($actionID) {