From 3608e2bb39e79845c942b01cb712051546ed5b77 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 25 Aug 2010 13:32:06 -0600 Subject: [PATCH] Move Domhtml lib from Support to Util --- framework/Support/package.xml | 10 +--------- framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php | 2 +- framework/Text_Filter/lib/Horde/Text/Filter/Xss.php | 11 +++++------ framework/Text_Filter/package.xml | 4 ---- .../{Support/lib/Horde/Support => Util/lib/Horde}/Domhtml.php | 10 +++++----- framework/Util/package.xml | 9 +++++++-- imp/lib/tests/mime_viewer_html.phpt | 2 +- imp/view.php | 2 +- 8 files changed, 21 insertions(+), 29 deletions(-) rename framework/{Support/lib/Horde/Support => Util/lib/Horde}/Domhtml.php (90%) diff --git a/framework/Support/package.xml b/framework/Support/package.xml index 2e9fc1eb4..d10adda6b 100644 --- a/framework/Support/package.xml +++ b/framework/Support/package.xml @@ -21,8 +21,7 @@ beta BSD - * Add Horde_Support_Domhtml::. - * Add Horde_Support_Randomid::. + * Add Horde_Support_Randomid::. * Add Portuguese numerizer. @@ -41,7 +40,6 @@ - @@ -92,11 +90,6 @@ pear.horde.org - - - dom - - @@ -104,7 +97,6 @@ - diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php index 3351bc59d..47babf402 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Html2text.php @@ -107,7 +107,7 @@ class Horde_Text_Filter_Html2text extends Horde_Text_Filter_Base public function postProcess($text) { try { - $dom = new Horde_Support_Domhtml($text, $this->_params['charset']); + $dom = new Horde_Domhtml($text, $this->_params['charset']); $text = Horde_String::convertCharset($this->_node($dom->dom, $dom->dom), null, $this->_params['charset']); } catch (Exception $e) { $text = strip_tags(preg_replace("/\/i", "\n", $text)); diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php b/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php index d24e42f9f..08d274843 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Xss.php @@ -15,8 +15,8 @@ * the document. * DEFAULT: false (returns the contents contained inside * the BODY tag) - * 'return_dom' - (boolean) If true, return a Horde_Support_Domhtml object - * instead of HTML text (overrides return_document). + * 'return_dom' - (boolean) If true, return a Horde_Domhtml object instead of + * HTML text (overrides return_document). * DEFAULT: false * 'strip_styles' - (boolean) Strip style tags? * DEFAULT: true @@ -94,14 +94,13 @@ class Horde_Text_Filter_Xss extends Horde_Text_Filter_Base * * @param string $text The text after the filtering. * - * @return string|Horde_Support_Domhtml The modified text or a Domhtml - * object if the 'return_dom' - * parameter is set. + * @return string|Horde_Domhtml The modified text or a Domhtml object if + * the 'return_dom' parameter is set. */ public function postProcess($text) { try { - $dom = new Horde_Support_Domhtml($text, $this->_params['charset']); + $dom = new Horde_Domhtml($text, $this->_params['charset']); } catch (Exception $e) { return $text; } diff --git a/framework/Text_Filter/package.xml b/framework/Text_Filter/package.xml index 688c546ec..a5d26df71 100644 --- a/framework/Text_Filter/package.xml +++ b/framework/Text_Filter/package.xml @@ -113,10 +113,6 @@ pear.horde.org - Support - pear.horde.org - - Util pear.horde.org diff --git a/framework/Support/lib/Horde/Support/Domhtml.php b/framework/Util/lib/Horde/Domhtml.php similarity index 90% rename from framework/Support/lib/Horde/Support/Domhtml.php rename to framework/Util/lib/Horde/Domhtml.php index 060e58b9a..82b4ab40e 100644 --- a/framework/Support/lib/Horde/Support/Domhtml.php +++ b/framework/Util/lib/Horde/Domhtml.php @@ -1,9 +1,9 @@ * @category Horde - * @package Support + * @package Util * @copyright 2010 The Horde Project (http://www.horde.org/) - * @license http://opensource.org/licenses/bsd-license.php + * @license http://www.fsf.org/copyleft/lgpl.html LGPL */ -class Horde_Support_Domhtml +class Horde_Domhtml { /** * DOM object. diff --git a/framework/Util/package.xml b/framework/Util/package.xml index e56a3c7f5..61a5aaf27 100644 --- a/framework/Util/package.xml +++ b/framework/Util/package.xml @@ -27,8 +27,8 @@ beta LGPL - -* Removed Horde_Util::assertDriverConfig(). + * Added Horde_Domhtml::. + * Removed Horde_Util::assertDriverConfig(). * Removed Horde_Util::bufferOutput(). * Removed Horde_Util::uriB64Encode() and Horde_Util::uriB64Decode(). * Removed Horde_Util::strftime2date() and Horde_Util::date2strftime(). @@ -48,6 +48,7 @@ + @@ -85,6 +86,9 @@ pear.horde.org + dom + + iconv @@ -98,6 +102,7 @@ + diff --git a/imp/lib/tests/mime_viewer_html.phpt b/imp/lib/tests/mime_viewer_html.phpt index 2a7a1f861..87722ea3f 100644 --- a/imp/lib/tests/mime_viewer_html.phpt +++ b/imp/lib/tests/mime_viewer_html.phpt @@ -22,7 +22,7 @@ class IMP_Html_Viewer_Test extends IMP_Horde_Mime_Viewer_Html 'target' => '_blank' ); - $dom = new Horde_Support_Domhtml($html); + $dom = new Horde_Domhtml($html); $this->_node($dom->dom, $dom->dom); return $dom->dom->saveXML($dom->dom->getElementsByTagName('body')->item(0)->firstChild) . "\n"; diff --git a/imp/view.php b/imp/view.php index 6557a8b37..998abc27d 100644 --- a/imp/view.php +++ b/imp/view.php @@ -291,7 +291,7 @@ case 'print_attach': if ($browser->isBrowser('mozilla')) { $pstring = Horde_Mime::decodeParam('content-type', $render[$key]['type']); - $doc = new Horde_Support_Domhtml($render[$key]['data'], $pstring['params']['charset']); + $doc = new Horde_Domhtml($render[$key]['data'], $pstring['params']['charset']); $bodyelt = $doc->dom->getElementsByTagName('body')->item(0); $bodyelt->insertBefore($doc->dom->importNode($div, true), $bodyelt->firstChild); -- 2.11.0