1: <?php
2: /**
3: * Horde_Text_Filter_Base:: is the parent class for defining a text filter.
4: *
5: * Copyright 1999-2012 Horde LLC (http://www.horde.org/)
6: *
7: * See the enclosed file COPYING for license information (LGPL). If you
8: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
9: *
10: * @author Chuck Hagenbuch <chuck@horde.org>
11: * @author Jan Schneider <jan@horde.org>
12: * @author Michael Slusarz <slusarz@horde.org>
13: * @category Horde
14: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
15: * @package Text_Filter
16: */
17: class Horde_Text_Filter_Base
18: {
19: /**
20: * Filter parameters.
21: *
22: * @var array
23: */
24: protected $_params = array();
25:
26: /**
27: * Constructor.
28: *
29: * @param array $params Any parameters that the filter instance needs.
30: */
31: public function __construct($params = array())
32: {
33: $this->_params = array_merge($this->_params, $params);
34: }
35:
36: /**
37: * Executes any code necessaray before applying the filter patterns.
38: *
39: * @param string $text The text before the filtering.
40: *
41: * @return string The modified text.
42: */
43: public function preProcess($text)
44: {
45: return $text;
46: }
47:
48: /**
49: * Returns a hash with replace patterns.
50: *
51: * @return array Patterns hash.
52: */
53: public function getPatterns()
54: {
55: return array();
56: }
57:
58: /**
59: * Executes any code necessaray after applying the filter patterns.
60: *
61: * @param string $text The text after the filtering.
62: *
63: * @return string The modified text.
64: */
65: public function postProcess($text)
66: {
67: return $text;
68: }
69:
70: }
71: