Class Text_Filter

Description

Text_Filter:: is a parent class for defining stackable text filters.

$Horde: framework/Text_Filter/Filter.php,v 1.15.2.13 2009/01/06 15:23:42 jan Exp $

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Text_Filter/Filter.php (line 27)


	
			
Direct descendents
Class Description
 class Text_Filter_bbcode The Text_Filter_bbcode:: class finds bbcode-style markup (see below) in a block of text and turns it into HTML.
 class Text_Filter_cleanascii Removes some common entities and high-ascii or otherwise nonstandard characters common in text pasted from Microsoft Word into a browser.
 class Text_Filter_dimsignature Displays message signatures marked by a '-- ' in the style of the CSS class "signature".
 class Text_Filter_emails The Text_Filter_emails:: class finds email addresses in a block of text and turns them into links.
 class Text_Filter_emoticons The Text_Filter_emoticons:: class finds emoticon strings ( :), etc.) in a block of text and turns them into image links.
 class Text_Filter_environment Replaces occurences of %VAR% with VAR, if VAR exists in the webserver's environment. Ignores all text after a '#' character (shell-style comments).
 class Text_Filter_highlightquotes Highlights quoted messages with different colors for the different quoting levels.
 class Text_Filter_linkurls The Text_Filter_linkurls:: class turns all URLs in the text into hyperlinks.
 class Text_Filter_simplemarkup Highlights simple markup as used in emails or usenet postings.
 class Text_Filter_space2html The space2html filter converts horizontal whitespace to HTML code.
 class Text_Filter_tabs2spaces The Text_Filter_tabs2spaces:: converts tabs into spaces.
 class Text_Filter_text2html Turn text into HTML with varying levels of parsing. For no html whatsoever, use htmlspecialchars() instead.
 class Text_Filter_words Filters the given text based on the words found in a word list file.
 class Text_Filter_xss This filter attempts to make HTML safe for viewing. IT IS NOT PERFECT. If
 class Text_Filter_html2text Takes HTML and converts it to formatted, plain text.
Variable Summary
 array $_params
Method Summary
 Text_Filter Text_Filter ([array $params = array()])
 Text_Filter &factory (mixed $driver, [array $params = array()])
 string filter (string $text, [ $filters = array()], [ $params = array()], array $patterns)
 array getPatterns ()
 string postProcess (string $text)
 string preProcess (string $text)
Variables
array $_params = array() (line 34)

Filter parameters.


Redefined in descendants as:
Methods
Constructor Text_Filter (line 41)

Constructor.

Text_Filter Text_Filter ([array $params = array()])
  • array $params: Any parameters that the filter instance needs.
factory (line 144)

Attempts to return a concrete Text_filter instance based on $driver.

  • return: The newly created concrete Text_Filter instance, or false on an error.
Text_Filter &factory (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete Text_Filter subclass to return. This is based on the filter driver ($driver). The code is dynamically included. If $driver is an array, then we will look in $driver[0] for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration parameters a subclass might need.
filter (line 54)

Applies a set of patterns to a block of text.

  • return: The transformed text.
string filter (string $text, [ $filters = array()], [ $params = array()], array $patterns)
  • string $text: The text to filter.
  • array $patterns: The array of patterns to filter with.
  • $filters
  • $params
getPatterns (line 110)

Returns a hash with replace patterns.

  • return: Patterns hash.
array getPatterns ()

Redefined in descendants as:
postProcess (line 123)

Executes any code necessaray after applying the filter patterns.

  • return: The modified text.
string postProcess (string $text)
  • string $text: The text after the filtering.

Redefined in descendants as:
preProcess (line 100)

Executes any code necessaray before applying the filter patterns.

  • return: The modified text.
string preProcess (string $text)
  • string $text: The text before the filtering.

Redefined in descendants as:

Documentation generated on Sun, 30 Jan 2011 05:17:19 +0000 by phpDocumentor 1.4.3