From 63ef6bdb8366f8f3601d514cacf3c0d5fbd80c5e Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Sat, 30 Jan 2010 19:20:44 -0700 Subject: [PATCH] Remove some unneeded code --- framework/Prefs/lib/Horde/Prefs/Ui.php | 16 +++------------- imp/lib/Application.php | 13 ++++--------- imp/lib/Auth.php | 8 +++----- imp/lib/Crypt/Pgp.php | 3 +-- imp/lib/Crypt/Smime.php | 3 +-- imp/lib/IMP.php | 3 +-- imp/lib/Imap.php | 3 +-- 7 files changed, 14 insertions(+), 35 deletions(-) diff --git a/framework/Prefs/lib/Horde/Prefs/Ui.php b/framework/Prefs/lib/Horde/Prefs/Ui.php index 1a7a4b2bb..cad2301d2 100644 --- a/framework/Prefs/lib/Horde/Prefs/Ui.php +++ b/framework/Prefs/lib/Horde/Prefs/Ui.php @@ -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')) { diff --git a/imp/lib/Application.php b/imp/lib/Application.php index a897af146..8f0a4569d 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -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'); } /** diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index 86135ff09..471c95320 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -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); diff --git a/imp/lib/Crypt/Pgp.php b/imp/lib/Crypt/Pgp.php index 5a5a3cf03..c995eee65 100644 --- a/imp/lib/Crypt/Pgp.php +++ b/imp/lib/Crypt/Pgp.php @@ -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'; diff --git a/imp/lib/Crypt/Smime.php b/imp/lib/Crypt/Smime.php index 52631c88b..f2bcb1303 100644 --- a/imp/lib/Crypt/Smime.php +++ b/imp/lib/Crypt/Smime.php @@ -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'; diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 9f2a85fd0..1207b3edd 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -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'))); } /** diff --git a/imp/lib/Imap.php b/imp/lib/Imap.php index abbaf0399..516afcdf2 100644 --- a/imp/lib/Imap.php +++ b/imp/lib/Imap.php @@ -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); -- 2.11.0