From: Michael M Slusarz Date: Fri, 8 Jan 2010 21:01:14 +0000 (-0700) Subject: Horde::selfUrl() cleanups X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=56c3d7925d59651bd9f040d9151aeb8d40b3872c;p=horde.git Horde::selfUrl() cleanups --- diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index bca8e1b34..dacd3fc0a 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -1359,7 +1359,7 @@ HTML; * @param boolean $force_ssl Ignore $conf['use_ssl'] and force creation * of a SSL URL? * - * @return string The requested URI. + * @return Horde_Url The requested URL. */ static public function selfUrl($script_params = false, $nocache = true, $full = false, $force_ssl = false) diff --git a/imp/attachment.php b/imp/attachment.php index e5e86361f..921ae58b8 100644 --- a/imp/attachment.php +++ b/imp/attachment.php @@ -19,8 +19,6 @@ require_once dirname(__FILE__) . '/lib/Application.php'; new IMP_Application(array('init' => array('authentication' => 'none', 'session_control' => 'none'))); -$self_url = Horde::selfUrl(false, true, true); - // Lets see if we are even able to send the user an attachment. if (!$conf['compose']['link_attachments']) { throw new IMP_Exception(_("Linked attachments are forbidden.")); diff --git a/imp/compose.php b/imp/compose.php index 7e07d7be5..229a844ac 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -602,8 +602,7 @@ if ($isPopup) { /* If the attachments cache is not empty, we must reload this page * and delete the attachments. */ if ($imp_compose->numberOfAttachments()) { - $cancel_url = new Horde_Url(Horde::selfUrl(), true); - $cancel_url->add(array( + $cancel_url = Horde::selfUrl()->setRaw(true)->add(array( 'actionID' => 'cancel_compose', 'composeCache' => $composeCacheID, 'popup' => 1 @@ -613,7 +612,7 @@ if ($isPopup) { /* If the attachments cache is not empty, we must reload this page and delete the attachments. */ if ($imp_compose->numberOfAttachments()) { - $cancel_url = _mailboxReturnURL(new Horde_Url(Horde::selfUrl(), true))->add(array( + $cancel_url = _mailboxReturnURL(Horde::selfUrl()->setRaw(true))->add(array( 'actionID' => 'cancel_compose', 'composeCache' => $composeCacheID )); diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 57792b666..0a24fe6e4 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -702,8 +702,7 @@ class IMP_Contents ($id != 0) && (intval($id) != 1) && (strpos($id, '.') === false)) { - $url = new Horde_Url(Horde::selfUrl(true)); - $url->remove(array('actionID', 'imapid', 'uid'))->add(array('actionID' => 'strip_attachment', 'imapid' => $id, 'uid' => $this->_uid, 'message_token' => Horde::getRequestToken('imp.impcontents'))); + $url = Horde::selfUrl(true)->remove(array('actionID', 'imapid', 'uid'))->add(array('actionID' => 'strip_attachment', 'imapid' => $id, 'uid' => $this->_uid, 'message_token' => Horde::getRequestToken('imp.impcontents'))); $part['strip'] = Horde::link($url, _("Strip Attachment"), 'deleteImg', null, "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete this attachment?")) . "');") . ''; } diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 1707745d2..d347a0cd1 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -1120,8 +1120,8 @@ class IMP static public function selfUrl() { return self::$newUrl - ? clone self::$newUrl - : new Horde_Url(Horde::selfUrl(true)); + ? self::$newUrl->copy() + : Horde::selfUrl(true); } /** diff --git a/imp/message.php b/imp/message.php index 4548121d2..9709699c9 100644 --- a/imp/message.php +++ b/imp/message.php @@ -605,8 +605,7 @@ if ($show_parts == 'all') { if (count($inlineout['display_ids']) > 2) { $a_template->set('download_all', Horde::widget($imp_contents->urlView($imp_contents->getMIMEMessage(), 'download_all'), _("Download All Attachments (in .zip file)"), 'widget', '', '', _("Download All Attachments (in .zip file)"), true)); if ($strip_atc) { - $strip_url = new Horde_Url(Horde::selfUrl(true)); - $a_template->set('strip_all', Horde::widget($strip_url->remove(array('actionID'))->add(array('actionID' => 'strip_all', 'message_token' => $message_token)), _("Strip All Attachments"), 'widget', '', "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete all attachments?")) . "');", _("Strip All Attachments"), true)); + $a_template->set('strip_all', Horde::widget(Horde::selfUrl(true)->remove(array('actionID'))->add(array('actionID' => 'strip_all', 'message_token' => $message_token)), _("Strip All Attachments"), 'widget', '', "return window.confirm('" . addslashes(_("Are you sure you wish to PERMANENTLY delete all attachments?")) . "');", _("Strip All Attachments"), true)); } } diff --git a/imp/thread.php b/imp/thread.php index 8b7a6db12..8ec9c4f09 100644 --- a/imp/thread.php +++ b/imp/thread.php @@ -100,15 +100,13 @@ foreach ($loop_array as $mbox => $idxlist) { /* Get headers for the message. */ $curr_msg['date'] = $imp_ui->getLocalTime($envelope['date']); - $selfurl = new Horde_Url(Horde::selfUrl(true)); - if (IMP::isSpecialFolder($mbox)) { $curr_msg['addr_to'] = true; - $curr_msg['addr'] = _("To:") . ' ' . $imp_ui->buildAddressLinks($envelope['to'], $selfurl); + $curr_msg['addr'] = _("To:") . ' ' . $imp_ui->buildAddressLinks($envelope['to'], Horde::selfUrl(true)); $addr = _("To:") . ' ' . htmlspecialchars(Horde_Mime_Address::addrObject2String(reset($envelope['to'])), ENT_COMPAT, $charset); } else { $curr_msg['addr_to'] = false; - $curr_msg['addr'] = $imp_ui->buildAddressLinks($envelope['from'], $selfurl); + $curr_msg['addr'] = $imp_ui->buildAddressLinks($envelope['from'], Horde::selfUrl(true)); $addr = htmlspecialchars(Horde_Mime_Address::addrObject2String(reset($envelope['from'])), ENT_COMPAT, $charset); }