Overview

Packages

  • Text
    • Filter

Classes

  • Horde_Text_Filter
  • Horde_Text_Filter_Base
  • Horde_Text_Filter_Bbcode
  • Horde_Text_Filter_Cleanascii
  • Horde_Text_Filter_Cleanhtml
  • Horde_Text_Filter_Dimsignature
  • Horde_Text_Filter_Emails
  • Horde_Text_Filter_Emoticons
  • Horde_Text_Filter_Environment
  • Horde_Text_Filter_Exception
  • Horde_Text_Filter_Highlightquotes
  • Horde_Text_Filter_Html2text
  • Horde_Text_Filter_JavascriptMinify
  • Horde_Text_Filter_JavascriptMinify_JsMin
  • Horde_Text_Filter_Linkurls
  • Horde_Text_Filter_Simplemarkup
  • Horde_Text_Filter_Space2html
  • Horde_Text_Filter_Tabs2spaces
  • Horde_Text_Filter_Text2html
  • Horde_Text_Filter_Translation
  • Horde_Text_Filter_Words
  • Horde_Text_Filter_Xss
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Displays message signatures marked by a '-- ' in the style of the CSS class
 4:  * "signature".
 5:  *
 6:  * Copyright 2004-2012 Horde LLC (http://www.horde.org/)
 7:  *
 8:  * See the enclosed file COPYING for license information (LGPL). If you
 9:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
10:  *
11:  * @author   Jan Schneider <jan@horde.org>
12:  * @category Horde
13:  * @license  http://www.horde.org/licenses/lgpl21 LGPL 2.1
14:  * @package  Text_Filter
15:  */
16: class Horde_Text_Filter_Dimsignature extends Horde_Text_Filter_Base
17: {
18:     /**
19:      * Executes any code necessary after applying the filter patterns.
20:      *
21:      * @param string $text  The text after the filtering.
22:      *
23:      * @return string  The modified text.
24:      */
25:     public function postProcess($text)
26:     {
27:         $parts = preg_split('/(\n--\s*(?:<br \/>)?\r?\n.*?)(?=<\/?(?:div|span)|$\s)/is', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
28:         $text = '';
29: 
30:         while (count($parts)) {
31:             $text .= array_shift($parts);
32:             if (count($parts)) {
33:                 $text .= '<span class="signature">' . array_shift($parts) . '</span>';
34:             }
35:         }
36: 
37:         return $text;
38:     }
39: 
40: }
41: 
API documentation generated by ApiGen