class SSHTMLBBCodeParser_Filter_EmailLinks extends SSHTMLBBCodeParser_Filter

Properties

array $_definedTags An array of tags parsed by the engine
string $_text A string containing the input from SSHTMLBBCodeParser
string $_preparsed A string containing the preparsed input from SSHTMLBBCodeParser
array $_tagArray An array tags and texts build from the input text from SSHTMLBBCodeParser
string $_parsed A string containing the parsed version of the text from SSHTMLBBCodeParser
array $_options An array of options, filled by an ini file or through the contructor from SSHTMLBBCodeParser
array $_filters An array of filters used for parsing from SSHTMLBBCodeParser

Methods

none
__construct(array $options = array())

Constructor, initialises the options and filters

static 
getStaticProperty($class, $var)

No description

setOption(string $name, mixed $value)

Option setter

addFilter(string $filter)

Add a new filter

removeFilter(string $filter)

Remove an existing filter

boolean
addFilters(mixed $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(string $str)

Builds a tag from the input string

none
_validateTagArray()

Validates the tag array, regarding the allowed tags

boolean
_parentNeeded(array $out, array $in)

Checks to see if a parent is needed

boolean
_childNeeded(array $out, array $in)

Checks to see if a child is needed

boolean
_isAllowed(array $out, array $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(string $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

in SSHTMLBBCodeParser at line 139
none __construct(array $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

array $options options to use, can be left out

Return Value

none

in SSHTMLBBCodeParser at line 180
static getStaticProperty($class, $var)

Parameters

$class
$var

in SSHTMLBBCodeParser at line 199
setOption(string $name, mixed $value)

Option setter

Parameters

string $name option name
mixed $value option value

in SSHTMLBBCodeParser at line 210
addFilter(string $filter)

Add a new filter

Parameters

string $filter filter

in SSHTMLBBCodeParser at line 239
removeFilter(string $filter)

Remove an existing filter

Parameters

string $filter

in SSHTMLBBCodeParser at line 263
boolean addFilters(mixed $filters)

Add new filters

Parameters

mixed $filters (array or string)

Return Value

boolean true if all ok, false if not.

at line 74
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

in SSHTMLBBCodeParser at line 336
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

in SSHTMLBBCodeParser at line 414
array _buildTag(string $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

string $str string to build tag from

Return Value

array tag in array format

See also

_buildTagArray()

in SSHTMLBBCodeParser at line 486
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

in SSHTMLBBCodeParser at line 607
boolean _parentNeeded(array $out, array $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

array $out tag that is on the outside
array $in tag that is on the inside

Return Value

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

See also

_validateTagArray()

in SSHTMLBBCodeParser at line 647
boolean _childNeeded(array $out, array $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

array $out tag that is on the outside
array $in tag that is on the inside

Return Value

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

See also

_validateTagArray()

in SSHTMLBBCodeParser at line 685
boolean _isAllowed(array $out, array $in)

Checks to see if a tag is allowed inside another tag

The allowed tags are extracted from the private _definedTags array.

Parameters

array $out tag that is on the outside
array $in tag that is on the inside

Return Value

boolean return true if the tag is allowed, false otherwise

See also

_validateTagArray()

in SSHTMLBBCodeParser at line 717
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

in SSHTMLBBCodeParser at line 774
none setText(string $str)

Sets text in the object to be parsed

Parameters

string $str the text to set in the object

Return Value

none

See also

getText()
$_text

in SSHTMLBBCodeParser at line 788
string getText()

Gets the unparsed text from the object

Return Value

string the text set in the object

See also

setText()
$_text

in SSHTMLBBCodeParser at line 802
string getPreparsed()

Gets the preparsed text from the object

Return Value

string the text set in the object

See also

_preparse()
$_preparsed

in SSHTMLBBCodeParser at line 816
string getParsed()

Gets the parsed text from the object

Return Value

string the parsed text set in the object

See also

parse()
$_parsed

in SSHTMLBBCodeParser at line 832
none parse()

Parses the text set in the object

Return Value

none

See also

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

in SSHTMLBBCodeParser at line 849
none qparse($str)

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

Parameters

$str

Return Value

none

See also

parse()
$_text

in SSHTMLBBCodeParser at line 865
none staticQparse($str)

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

Parameters

$str

Return Value

none

See also

parse()
$_text