/* Are we currently in "print" mode? */
static public $printMode = false;
+ /* Storage place for an altered version of the current URL. */
+ static public $newUrl = null;
+
/* displayFolder() cache. */
static private $_displaycache = array();
return $cache;
}
- /**
+ /**
* Generate the JS code necessary to open a passphrase dialog. Adds the
* necessary JS files to open the dialog.
*
return 'IMPDialog.display(\'' . IMP::escapeJSON($js_params) . '\')';
}
+
+ /**
+ * Return a selfURL that has had index/mailbox/actionID information
+ * removed/altered based on an action that has occurred on the present
+ * page.
+ *
+ * @return string The self URL.
+ */
+ static public function selfUrl()
+ {
+ return self::$newUrl ? self::$newUrl : Horde::selfUrl(true);
+ }
+
}
preg_match($this->_img_regex, $data)) {
/* Make sure the URL parameters are correct for the current
* message. */
- $url = Util::removeParameter(Horde::selfUrl(true), array('actionID', 'index'));
+ $url = Util::removeParameter(IMP::selfUrl(), array('actionID', 'index'));
$url = Util::addParameter($url, 'index', $this->_params['contents']->getIndex());
$view_img = Util::getFormData('view_html_images');
*/
protected function _popupImageWindow()
{
- $self_url = Util::addParameter(Horde::selfUrl(true), array('imp_img_view' => ((Util::getFormData('imp_img_view') == 'load_convert') ? 'view_convert' : 'data')));
+ $self_url = Util::addParameter(IMP::selfUrl(), array('imp_img_view' => ((Util::getFormData('imp_img_view') == 'load_convert') ? 'view_convert' : 'data')));
$title = $this->_mimepart->getName(true);
$str = <<<EOD
// Create the HTML to display the iCal file.
$html = '';
if ($_SESSION['imp']['view'] == 'imp') {
- $html .= '<form method="post" name="iCal" action="' . Horde::selfUrl(true) . '">';
+ $html .= '<form method="post" name="iCal" action="' . (IMP::selfUrl()) . '">';
}
foreach ($components as $key => $component) {
} else {
switch ($_SESSION['imp']['view']) {
case 'imp':
- $status[] = Horde::link(Util::addParameter(Horde::selfUrl(true), array('pgp_verify_msg' => 1))) . _("Click HERE to verify the message.") . '</a>';
+ $status[] = Horde::link(Util::addParameter(IMP::selfUrl(), array('pgp_verify_msg' => 1))) . _("Click HERE to verify the message.") . '</a>';
break;
case 'dimp':
} else {
switch ($_SESSION['imp']['view']) {
case 'imp':
- $status[] = Horde::link(Util::addParameter(Horde::selfUrl(true), 'smime_verify_msg', 1)) . _("Click HERE to verify the message.") . '</a>';
+ $status[] = Horde::link(Util::addParameter(IMP::selfUrl(), 'smime_verify_msg', 1)) . _("Click HERE to verify the message.") . '</a>';
break;
case 'dimp':
* stuff in the query string, so we need to do an add/remove of 'index'. */
$selfURL = Util::removeParameter(Horde::selfUrl(true), array('index', 'actionID', 'mailbox', 'thismailbox'));
$selfURL = IMP::generateIMPUrl($selfURL, $imp_mbox['mailbox'], $index, $mailbox_name);
-$selfURL = html_entity_decode(Util::addParameter($selfURL, 'message_token', $message_token));
+IMP::$newUrl = $selfURL = html_entity_decode(Util::addParameter($selfURL, 'message_token', $message_token));
$headersURL = htmlspecialchars(Util::removeParameter($selfURL, array('show_all_headers', 'show_list_headers')));
/* Generate previous/next links. */