SSHTMLBBCodeParser_Filter_EmailLinks
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
Constructor, initialises the options and filters
Executes statements before the actual array building starts
Validates the tag array, regarding the allowed tags
Checks to see if a tag is allowed inside another tag
Quick method to do setText(), parse() and getParsed at once
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.
static
getStaticProperty($class, $var)
setOption($name, $value)
Option setter
addFilter($filter)
Add a new filter
removeFilter(string $filter)
Remove an existing filter
bool
addFilters($filters)
Add new filters
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.
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.
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,
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.
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.
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.
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.
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.
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