From 93f6f0d92be3eb46728fa563082666b399f4e1bb Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 3 Feb 2010 16:25:06 -0700 Subject: [PATCH] Add noJS option to highlightquotes filter --- framework/Text_Filter/lib/Horde/Text/Filter/Highlightquotes.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/framework/Text_Filter/lib/Horde/Text/Filter/Highlightquotes.php b/framework/Text_Filter/lib/Horde/Text/Filter/Highlightquotes.php index b8bb891bf..17d34a2d1 100644 --- a/framework/Text_Filter/lib/Horde/Text/Filter/Highlightquotes.php +++ b/framework/Text_Filter/lib/Horde/Text/Filter/Highlightquotes.php @@ -15,6 +15,7 @@ * 'citeblock' -- Display cite blocks? (DEFAULT: true) * 'cssLevels' -- Number of defined CSS class names. (DEFAULT: 5) * 'hideBlocks' -- Hide quoted text blocks by default? (DEFAULT: false) + * 'noJS' - -- Don't add javscript toggle code (DEFAULT: false) * 'outputJS' -- Add necessary JS files? (DEFAULT: true) * * @@ -38,6 +39,7 @@ class Horde_Text_Filter_Highlightquotes extends Horde_Text_Filter 'citeblock' => true, 'cssLevels' => 5, 'hideBlocks' => false, + 'noJS' => true, 'outputJS' => true ); @@ -154,7 +156,7 @@ class Horde_Text_Filter_Highlightquotes extends Horde_Text_Filter $curr = reset($lines); $out = implode("\n", $this->_removeBr($curr['lines'])); - if ($qcount > 8) { + if (!$this->_params['noJS'] && ($qcount > 8)) { if ($this->_params['outputJS']) { Horde::addScriptFile('prototype.js', 'horde'); } @@ -193,7 +195,7 @@ class Horde_Text_Filter_Highlightquotes extends Horde_Text_Filter $out .= $this->_params['citeblock'] ? '' : ''; } - return ($qcount > 8) + return (!$this->_params['noJS'] && ($qcount > 8)) ? $out . '' : $out; } -- 2.11.0