class SSHTMLBBCodeParser_Filter_EmailLinks extends SSHTMLBBCodeParser_Filter (View source)

Properties

private array $_definedTags

An array of tags parsed by the engine

private string $_text

A string containing the input

from  SSHTMLBBCodeParser
private string $_preparsed

A string containing the preparsed input

from  SSHTMLBBCodeParser
private array $_tagArray

An array tags and texts build from the input text

from  SSHTMLBBCodeParser
private string $_parsed

A string containing the parsed version of the text

from  SSHTMLBBCodeParser
private array $_options

An array of options, filled by an ini file or through the contructor

from  SSHTMLBBCodeParser
private array $_filters

An array of filters used for parsing

from  SSHTMLBBCodeParser

Methods

none
__construct($options = array())

Constructor, initialises the options and filters

static 
getStaticProperty($class, $var)

No description

setOption($name, $value)

Option setter

addFilter($filter)

Add a new filter

removeFilter(string $filter)

Remove an existing filter

bool
addFilters($filters)

Add new filters

none
_preparse()

Executes statements before the actual array building starts

none
_buildTagArray()

Builds the tag array from the input string $_text

array
_buildTag($str)

Builds a tag from the input string

none
_validateTagArray()

Validates the tag array, regarding the allowed tags

bool
_parentNeeded($out, $in)

Checks to see if a parent is needed

bool
_childNeeded($out, $in)

Checks to see if a child is needed

bool
_isAllowed($out, $in)

Checks to see if a tag is allowed inside another tag

none
_buildParsedString()

Builds a parsed string based on the tag array

none
setText($str)

Sets text in the object to be parsed

string
getText()

Gets the unparsed text from the object

string
getPreparsed()

Gets the preparsed text from the object

string
getParsed()

Gets the parsed text from the object

none
parse()

Parses the text set in the object

none
qparse($str)

Quick method to do setText(), parse() and getParsed at once

none
staticQparse($str)

Quick static method to do setText(), parse() and getParsed at once

Details

none __construct($options = array())

Constructor, initialises the options and filters

Sets the private variable _options with base options defined with &PEAR::getStaticProperty(), overwriting them with (if present) the argument to this method. Then it sets the extra options to properly escape the tag characters in preg_replace() etc. The set options are then stored back with &PEAR::getStaticProperty(), so that the filter classes can use them. All the filters in the options are initialised and their defined tags are copied into the private variable _definedTags.

Parameters

$options

Return Value

none

static getStaticProperty($class, $var)

Parameters

$class
$var

setOption($name, $value)

Option setter

Parameters

$name
$value

addFilter($filter)

Add a new filter

Parameters

$filter

removeFilter(string $filter)

Remove an existing filter

Parameters

string $filter

bool addFilters($filters)

Add new filters

Parameters

$filters

Return Value

bool

true if all ok, false if not.

private none _preparse()

Executes statements before the actual array building starts

This method should be overwritten in a filter if you want to do something before the parsing process starts. This can be useful to allow certain short alternative tags which then can be converted into proper tags with preg_replace() calls. The main class walks through all the filters and and calls this method if it exists. The filters should modify their private $_text variable.

Return Value

none

See also

$_text

private none _buildTagArray()

Builds the tag array from the input string $_text

An array consisting of tag and text elements is contructed from the $_preparsed variable. The method uses _buildTag() to check if a tag is valid and to build the actual tag to be added to the tag array.

Return Value

none

See also

_buildTag()
$_text
$_tagArray

private array _buildTag($str)

Builds a tag from the input string

This method builds a tag array based on the string it got as an argument. If the tag is invalid, is returned. The tag attributes are extracted from the string and stored in the tag array as an associative array.

Parameters

$str

Return Value

array

tag in array format

See also

_buildTagArray()

private none _validateTagArray()

Validates the tag array, regarding the allowed tags

While looping through the tag array, two following text tags are joined, and it is checked that the tag is allowed inside the last opened tag. By remembering what tags have been opened it is checked that there is correct (xml compliant) nesting. In the end all still opened tags are closed.

Return Value

none

See also

_isAllowed()
$_tagArray

private bool _parentNeeded($out, $in)

Checks to see if a parent is needed

Checks to see if the current $in tag has an appropriate parent. If it does, then it returns false. If a parent is needed, then it returns the first tag in the list to add to the stack.

Parameters

$out
$in

Return Value

bool

false if not needed, tag if needed, true if out of our minds

See also

_validateTagArray()

private bool _childNeeded($out, $in)

Checks to see if a child is needed

Checks to see if the current $out tag has an appropriate child. If it does, then it returns false. If a child is needed, then it returns the first tag in the list to add to the stack.

Parameters

$out
$in

Return Value

bool

false if not needed, tag if needed, true if out of our minds

See also

_validateTagArray()

private bool _isAllowed($out, $in)

Checks to see if a tag is allowed inside another tag

The allowed tags are extracted from the private _definedTags array.

Parameters

$out
$in

Return Value

bool

return true if the tag is allowed, false otherwise

See also

_validateTagArray()

private none _buildParsedString()

Builds a parsed string based on the tag array

The correct html and attribute values are extracted from the private _definedTags array.

Return Value

none

See also

$_tagArray
$_parsed

none setText($str)

Sets text in the object to be parsed

Parameters

$str

Return Value

none

See also

getText()
$_text

string getText()

Gets the unparsed text from the object

Return Value

string

the text set in the object

See also

setText()
$_text

string getPreparsed()

Gets the preparsed text from the object

Return Value

string

the text set in the object

See also

_preparse()
$_preparsed

string getParsed()

Gets the parsed text from the object

Return Value

string

the parsed text set in the object

See also

parse()
$_parsed

none parse()

Parses the text set in the object

Return Value

none

See also

_preparse()
_buildTagArray()
_validateTagArray()
_buildParsedString()

none qparse($str)

Quick method to do setText(), parse() and getParsed at once

Parameters

$str

Return Value

none

See also

parse()
$_text

none staticQparse($str)

Quick static method to do setText(), parse() and getParsed at once

Parameters

$str

Return Value

none

See also

parse()
$_text