From: Michael M Slusarz Date: Wed, 3 Feb 2010 23:25:06 +0000 (-0700) Subject: Add noJS option to highlightquotes filter X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=93f6f0d92be3eb46728fa563082666b399f4e1bb;p=horde.git Add noJS option to highlightquotes filter --- 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; }