From: Michael M Slusarz Date: Mon, 30 Mar 2009 07:09:28 +0000 (-0600) Subject: Use global utils object X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=74d25ed5e98773df84edea74c1f054d58f4f5e63;p=horde.git Use global utils object --- diff --git a/imp/ajax.php b/imp/ajax.php index 877be79cb..df0739894 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -17,7 +17,7 @@ function _generateDeleteResult($mbox, $indices, $change, $nothread = false) $result = new stdClass; $result->folder = $mbox; - $result->uids = $GLOBALS['imap_utils']->toSequenceString($indices, array('mailbox' => true)); + $result->uids = $GLOBALS['imap_imap']->ob->utils->toSequenceString($indices, array('mailbox' => true)); $result->remove = ($GLOBALS['prefs']->getValue('hide_deleted') || $GLOBALS['prefs']->getValue('use_trash')); $result->cacheid = $imp_mailbox->getCacheID($mbox); @@ -172,11 +172,9 @@ $dimp_logout = ($action == 'LogOut'); $session_timeout = 'json'; require_once $imp_dir . '/lib/base.php'; -$imap_utils = new Horde_Imap_Client_Utils(); - // Process common request variables. $mbox = Util::getPost('view'); -$indices = $imap_utils->fromSequenceString(Util::getPost('uid')); +$indices = $imap_imap->ob->utils->fromSequenceString(Util::getPost('uid')); $cacheid = Util::getPost('cacheid'); // Open an output buffer to ensure that we catch errors that might break JSON diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index d557e11ca..ef3dffefa 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -1183,7 +1183,7 @@ class IMP_Compose $subject = $h->getValue('subject'); $header['subject'] = empty($subject) ? 'Re: ' - : 'Re: ' . $GLOBALS['imp_imap']->utils->getBaseSubject($subject, array('keepblob' => true)); + : 'Re: ' . $GLOBALS['imp_imap']->ob->utils->getBaseSubject($subject, array('keepblob' => true)); if (in_array($actionID, array('reply', '*'))) { ($header['to'] = $to) || @@ -1357,7 +1357,7 @@ class IMP_Compose $header['subject'] = $h->getValue('subject'); if (!empty($header['subject'])) { $header['title'] = _("Forward") . ': ' . $header['subject']; - $header['subject'] = 'Fwd: ' . $GLOBALS['imp_imap']->utils->getBaseSubject($header['subject'], array('keepblob' => true)); + $header['subject'] = 'Fwd: ' . $GLOBALS['imp_imap']->ob->utils->getBaseSubject($header['subject'], array('keepblob' => true)); } else { $header['title'] = _("Forward"); $header['subject'] = 'Fwd:'; @@ -1459,7 +1459,7 @@ class IMP_Compose } elseif (String::length($name) > 80) { $name = String::substr($name, 0, 80) . '...'; } - return 'Fwd: ' . $GLOBALS['imp_imap']->utils->getBaseSubject($name, array('keepblob' => true)); + return 'Fwd: ' . $GLOBALS['imp_imap']->ob->utils->getBaseSubject($name, array('keepblob' => true)); } else { return 'Fwd: ' . sprintf(_("%u Forwarded Messages"), $attached); } diff --git a/imp/lib/Imap.php b/imp/lib/Imap.php index 63bdd3776..c5540c166 100644 --- a/imp/lib/Imap.php +++ b/imp/lib/Imap.php @@ -21,13 +21,6 @@ class IMP_Imap public $ob = null; /** - * The Horde_Imap_Client_Utils object. - * - * @var Horde_Imap_Client_Utils - */ - public $utils = null; - - /** * Is connection read-only? * * @var array @@ -65,8 +58,6 @@ class IMP_Imap /* Rebuild the Horde_Imap_Client object. */ $this->_loadImapObject(); - - $this->utils = new Horde_Imap_Client_Utils(); } /** diff --git a/imp/lib/Mime/Viewer/Pgp.php b/imp/lib/Mime/Viewer/Pgp.php index d5e78fd2c..b11db05ff 100644 --- a/imp/lib/Mime/Viewer/Pgp.php +++ b/imp/lib/Mime/Viewer/Pgp.php @@ -337,7 +337,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver if ($GLOBALS['prefs']->getValue('pgp_verify') || Util::getFormData('pgp_verify_msg')) { - $signed_data = $GLOBALS['imp_imap']->utils->removeBareNewlines($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true))); + $signed_data = $GLOBALS['imp_imap']->ob->utils->removeBareNewlines($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true))); $sig_part = $this->_params['contents']->getMIMEPart($sig_id); /* Check for the 'x-imp-pgp-signature' param. This is set by the diff --git a/imp/lib/Mime/Viewer/Smime.php b/imp/lib/Mime/Viewer/Smime.php index 448cd5e08..dcd0e0399 100644 --- a/imp/lib/Mime/Viewer/Smime.php +++ b/imp/lib/Mime/Viewer/Smime.php @@ -152,7 +152,7 @@ class IMP_Horde_Mime_Viewer_Smime extends Horde_Mime_Viewer_Driver return null; } - $raw_text = $GLOBALS['imp_imap']->utils->removeBareNewlines($this->_params['contents']->getBodyPart($this->_mimepart->getMimeId(), array('mimeheaders' => true))); + $raw_text = $GLOBALS['imp_imap']->ob->utils->removeBareNewlines($this->_params['contents']->getBodyPart($this->_mimepart->getMimeId(), array('mimeheaders' => true))); try { $decrypted_data = $this->_impsmime->decryptMessage($raw_text); @@ -175,7 +175,7 @@ class IMP_Horde_Mime_Viewer_Smime extends Horde_Mime_Viewer_Driver return array(); } - $raw_text = $GLOBALS['imp_imap']->utils->removeBareNewlines($this->_params['contents']->getBodyPart($this->_mimepart->getMimeId(), array('mimeheaders' => true))); + $raw_text = $GLOBALS['imp_imap']->ob->utils->removeBareNewlines($this->_params['contents']->getBodyPart($this->_mimepart->getMimeId(), array('mimeheaders' => true))); try { $sig_result = $this->_impsmime->verifySignature($raw_text); @@ -240,7 +240,7 @@ class IMP_Horde_Mime_Viewer_Smime extends Horde_Mime_Viewer_Driver $raw_text = $base_id ? $this->_params['contents']->getBodyPart($base_id, array('mimeheaders' => true)) : $this->_params['contents']->fullMessageText(); - $raw_text = $GLOBALS['imp_imap']->utils->removeBareNewlines($raw_text); + $raw_text = $GLOBALS['imp_imap']->ob->utils->removeBareNewlines($raw_text); $sig_result = null; diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index ee4f3f703..5a724fd2c 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -184,7 +184,7 @@ class IMP_Views_ListMessages if (isset($md->search)) { $cached = Horde_Serialize::unserialize($args['cached'], Horde_Serialize::JSON); } else { - $cached = $GLOBALS['imp_imap']->utils->fromSequenceString($args['cached']); + $cached = $GLOBALS['imp_imap']->ob->utils->fromSequenceString($args['cached']); $cached = reset($cached); } $cached = array_flip($cached); diff --git a/imp/mailbox.php b/imp/mailbox.php index 2a68a5a2e..9e78b3950 100644 --- a/imp/mailbox.php +++ b/imp/mailbox.php @@ -218,7 +218,7 @@ case 'empty_mailbox': break; case 'view_messages': - $redirect = Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], null, null, false), array('mode' => 'msgview', 'msglist' => $GLOBALS['imp_imap']->utils->toSequenceString(IMP::parseIndicesList($indices), array('mailbox' => true))), null, false); + $redirect = Util::addParameter(IMP::generateIMPUrl('thread.php', $imp_mbox['mailbox'], null, null, false), array('mode' => 'msgview', 'msglist' => $GLOBALS['imp_imap']->ob->utils->toSequenceString(IMP::parseIndicesList($indices), array('mailbox' => true))), null, false); header('Location: ' . $redirect); exit; diff --git a/imp/thread.php b/imp/thread.php index 9a93e065b..b4dee4077 100644 --- a/imp/thread.php +++ b/imp/thread.php @@ -27,7 +27,7 @@ if ($mode == 'thread') { } } else { /* MSGVIEW MODE: Make sure we have a valid list of messages. */ - $msglist = $GLOBALS['imp_imap']->utils->fromSequenceString(Util::getFormData('msglist')); + $msglist = $GLOBALS['imp_imap']->ob->utils->fromSequenceString(Util::getFormData('msglist')); if (empty($msglist)) { $error = true; }