From: Michael M Slusarz Date: Tue, 17 Aug 2010 04:21:04 +0000 (-0600) Subject: Fix popup compose links in HTML data in IMP X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=df6e12b4ffbb0f87349ecf6cb43fae01baab09e9;p=horde.git Fix popup compose links in HTML data in IMP ...and here is where we can't use popup links that depend on Horde.popup - since this script file is not loaded in the IFRAME. --- diff --git a/imp/lib/Mime/Viewer/Html.php b/imp/lib/Mime/Viewer/Html.php index bf91ca8a1..8ecb058db 100644 --- a/imp/lib/Mime/Viewer/Html.php +++ b/imp/lib/Mime/Viewer/Html.php @@ -221,11 +221,13 @@ class IMP_Mime_Viewer_Html extends Horde_Mime_Viewer_Html } if ($inline) { - $filters['emails'] = array(); + $filters['emails'] = array( + 'callback' => array($this, 'emailsCallback') + ); } if (!empty($filters)) { - $data = $this->_textFilter($data, array_keys($filters), array(array_values($filters))); + $data = $this->_textFilter($data, array_keys($filters), array_values($filters)); } /* Filter bad language. */ @@ -267,6 +269,20 @@ class IMP_Mime_Viewer_Html extends Horde_Mime_Viewer_Html } /** + * Process emails text filter callback. + * + * @param array $args List of arguments to pass to the compose script. + * @param array $extra Hash of extra, non-standard arguments to pass to + * compose script. + * + * @return Horde_Url The link to the message composition script. + */ + public function emailsCallback($args, $extra) + { + return IMP::composeLink($args, $extra, true); + } + + /** * Process DOM node (callback). * * @param DOMDocument $doc Document node. @@ -290,7 +306,9 @@ class IMP_Mime_Viewer_Html extends Horde_Mime_Viewer_Html if ($node->hasAttribute('href')) { $url = parse_url($node->getAttribute('href')); if (isset($url['scheme']) && ($url['scheme'] == 'mailto')) { - $node->setAttribute('href', IMP::composeLink($node->getAttribute('href'))); + /* We don't include Horde.popup() in IFRAME, so need + * to use 'simple' links. */ + $node->setAttribute('href', IMP::composeLink($node->getAttribute('href'), array(), true)); } elseif (!$node->hasAttribute('target') && empty($url['fragment'])) { $node->setAttribute('target', $this->_imptmp['target']);