Remove some unneeded code
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 31 Jan 2010 02:20:44 +0000 (19:20 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 31 Jan 2010 04:21:36 +0000 (21:21 -0700)
framework/Prefs/lib/Horde/Prefs/Ui.php
imp/lib/Application.php
imp/lib/Auth.php
imp/lib/Crypt/Pgp.php
imp/lib/Crypt/Smime.php
imp/lib/IMP.php
imp/lib/Imap.php

index 1a7a4b2..cad2301 100644 (file)
@@ -81,10 +81,7 @@ class Horde_Prefs_Ui
     static public function handleForm($group, $save, $app, $prefGroups,
                                       $_prefs)
     {
-        global $prefs;
-
-        $notification = Horde_Notification::singleton();
-        $registry = Horde_Registry::singleton();
+        global $notification, $prefs, $registry;
 
         $updated = false;
 
@@ -218,11 +215,7 @@ class Horde_Prefs_Ui
     static public function generateUI($app, $prefGroups, $_prefs,
                                       $group = null, $chunk = false)
     {
-        global $conf, $prefs;
-
-        $browser = Horde_Browser::singleton();
-        $notification = Horde_Notification::singleton();
-        $registry = Horde_Registry::singleton();
+        global $browser, $conf, $notification, $prefs, $registry;
 
         /* Check if any options are actually available. */
         if (is_null($prefGroups)) {
@@ -300,10 +293,7 @@ class Horde_Prefs_Ui
     static public function generateHeader($app, $prefGroups = null,
                                           $group = null, $chunk = false)
     {
-        global $perms, $prefs;
-
-        $notification = Horde_Notification::singleton();
-        $registry = Horde_Registry::singleton();
+        global $notification, $perms, $prefs, $registry;
 
         $title = _("User Options");
         if ($group == 'identities' && !$prefs->isLocked('default_identity')) {
index a897af1..8f0a456 100644 (file)
@@ -102,9 +102,7 @@ class IMP_Application extends Horde_Registry_Application
         }
 
         // Initialize global $imp_imap object.
-        if (!isset($GLOBALS['imp_imap'])) {
-            $GLOBALS['imp_imap'] = new IMP_Imap();
-        }
+        $GLOBALS['imp_imap'] = new IMP_Imap();
 
         // Set default message character set.
         if ($def_charset = $GLOBALS['prefs']->getValue('default_msg_charset')) {
@@ -607,8 +605,7 @@ class IMP_Application extends Horde_Registry_Application
 
         case 'delmove':
             if ($prefs->isDirty('use_vtrash')) {
-                $imp_search = new IMP_Search();
-                $imp_search->initialize(true);
+                $GLOBALS['imp_search']->initialize(true);
             }
             break;
 
@@ -620,8 +617,7 @@ class IMP_Application extends Horde_Registry_Application
 
         case 'server':
             if ($prefs->isDirty('use_vinbox')) {
-                $imp_search = new IMP_Search();
-                $imp_search->initialize(true);
+                $GLOBALS['imp_search']->initialize(true);
             }
 
             if ($prefs->isDirty('subscribe')) {
@@ -647,8 +643,7 @@ class IMP_Application extends Horde_Registry_Application
      */
     public function prefsStatus()
     {
-        $notification = Horde_Notification::singleton();
-        $notification->replace('status', array('prefs' => true, 'viewmode' => 'dimp'), 'IMP_Notification_Listener_Status');
+        $GLOBALS['notification']->replace('status', array('prefs' => true, 'viewmode' => 'dimp'), 'IMP_Notification_Listener_Status');
     }
 
     /**
index 86135ff..471c953 100644 (file)
@@ -337,13 +337,11 @@ class IMP_Auth
                 ? 'INBOX'
                 : $GLOBALS['prefs']->getValue('initial_page');
 
-            $imp_search = new IMP_Search();
-
             if (!$GLOBALS['prefs']->getValue('use_vinbox') &&
-                $imp_search->isVINBOXFolder($init_url)) {
+                $GLOBALS['imp_search']->isVINBOXFolder($init_url)) {
                 $init_url = 'folders.php';
-            } elseif (($imp_search->createSearchID($init_url) == $init_url) &&
-                      !$imp_search->isVFolder($init_url)) {
+            } elseif (($GLOBALS['imp_search']->createSearchID($init_url) == $init_url) &&
+                      !$GLOBALS['imp_search']->isVFolder($init_url)) {
                 $init_url = 'INBOX';
                 if (!$GLOBALS['prefs']->isLocked('initial_page')) {
                     $GLOBALS['prefs']->setValue('initial_page', $init_url);
index 5a5a3cf..c995eee 100644 (file)
@@ -632,8 +632,7 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp
     {
         /* Need to handle notifications inline, and need to set explicitly
          * since the popup window is not part of the preferences framework. */
-        $notification = Horde_Notification::singleton();
-        $notification->replace('status', array('prefs' => true, 'viewmode' => 'imp'), 'IMP_Notification_Listener_Status');
+        $GLOBALS['notification']->replace('status', array('prefs' => true, 'viewmode' => 'imp'), 'IMP_Notification_Listener_Status');
 
         $title = _("Import PGP Key");
         require IMP_TEMPLATES . '/common-header.inc';
index 52631c8..f2bcb13 100644 (file)
@@ -468,8 +468,7 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime
     {
         /* Need to handle notifications inline, and need to set explicitly
          * since the popup window is not part of the preferences framework. */
-        $notification = Horde_Notification::singleton();
-        $notification->replace('status', array('prefs' => true, 'viewmode' => 'imp'), 'IMP_Notification_Listener_Status');
+        $GLOBALS['notification']->replace('status', array('prefs' => true, 'viewmode' => 'imp'), 'IMP_Notification_Listener_Status');
 
         $title = _("Import S/MIME Key");
         require IMP_TEMPLATES . '/common-header.inc';
index 9f2a85f..1207b3e 100644 (file)
@@ -554,8 +554,7 @@ class IMP
      */
     static public function status()
     {
-        $notification = Horde_Notification::singleton();
-        $notification->notify(array('listeners' => array('status', 'audio')));
+        $GLOBALS['notification']->notify(array('listeners' => array('status', 'audio')));
     }
 
     /**
index abbaf03..516afcd 100644 (file)
@@ -72,9 +72,8 @@ class IMP_Imap
              * any login alerts received should be displayed to the user at
              * some point. We need to do an explicit grab of the alarms
              * right now. */
-            $notification = Horde_Notification::singleton();
             foreach ($this->_ob->alerts() as $alert) {
-                $notification->push($alert, 'horde.warning');
+                $GLOBALS['notification']->push($alert, 'horde.warning');
             }
 
             $_SESSION['imp']['imap_ob'][$_SESSION['imp']['server_key']] = serialize($this->_ob);