From ba3858bd12afd901328705f7c37d373d72f19afe Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 3 Feb 2010 14:13:11 -0700 Subject: [PATCH] Add ability to return Csstidy object. --- framework/Text_Filter_Csstidy/lib/Horde/Text/Filter/Csstidy.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/Text_Filter_Csstidy/lib/Horde/Text/Filter/Csstidy.php b/framework/Text_Filter_Csstidy/lib/Horde/Text/Filter/Csstidy.php index 004a96613..086fdc35c 100644 --- a/framework/Text_Filter_Csstidy/lib/Horde/Text/Filter/Csstidy.php +++ b/framework/Text_Filter_Csstidy/lib/Horde/Text/Filter/Csstidy.php @@ -9,6 +9,8 @@ *
  * level - (string) Level of compression.
  *         DEFAULT: 'highest_compression'
+ * ob - (boolean) If true, return Csstidy object instead of string.
+ *      DEFAULT: false
  * 
* * Copyright 2009-2010 The Horde Project (http://www.horde.org/) @@ -35,7 +37,8 @@ class Horde_Text_Filter_Csstidy extends Horde_Text_Filter * * @param string $text The text after the filtering. * - * @return string The modified text. + * @return mixed The modified text, or the Csstidy object if + * the 'ob' parameter is true. */ public function postProcess($text) { @@ -47,7 +50,9 @@ class Horde_Text_Filter_Csstidy extends Horde_Text_Filter $css_tidy->load_template($this->_params['level']); $css_tidy->parse($text); - return $css_tidy->print->plain(); + return empty($this->_params['ob']) + ? $css_tidy->print->plain() + : $css_tidy; } } -- 2.11.0