ContentFormattingParser
This class is abstract. It contains tools that are usefull for implement a content parser.
- AbstractParser implements FormattingParser
- ContentFormattingParser
public
|
|
public
|
|
public
|
|
public
string[]
|
|
public
|
#
set_html_auth( array $array_auth )
Sets the required authorizations that are necessary to post some HTML code which will be displayed by the web browser. |
public
mixed[]
|
|
protected
|
#
split_imbricated_tag( string & $content, string $tag, string $attributes )
Splits a string accorting to a tag name. Works also with nested tags. |
protected static
string[]
|
#
preg_split_safe_recurse( $content, $tag, $attributes )
Splits a string according to a regular expression. The matched pattern can be nested and must follow the BBCode syntax, i.e matching [tag=args]content of the tag[/tag]. It returns an array For example, il you have this: $my_str = '[tag=1]test1[/tag]test2[tag=2]test3[tag=3]test4[/tag]test5[/tag]?est6'; You call it like that: ContentFormattingParser::preg_split_safe_recurse($my_str, 'tag', '[0-9]'); It will return you array('', '1', 'test1', 'test2', '2', array('test3', '3', 'test4', 'test5'), 'test6'). |
protected
|
#
pick_up_tag( $tag, $arguments = '' )
Removes the content of the tag $tag and replaces them by an identifying code. They will be reinserted in the content by the reimplant_tags method. It enables you to treat the whole string enough affecting the interior of some tags. Example: $my_parser contains this content: 'test1[tag=1]test2[/tag]test3' $my_parser->pick_up_tag('tag', '[0-9]'); will replace the content of the parser by 'test1[CODE_TAG_1]test3' |
protected
boolean
|
|
protected
|
PICK_UP,
REIMPLANT
|
protected
string[]
|
$html_auth
Authorization of the HTML BBCode tag. |
#
array()
|
protected
string[]
|
$forbidden_tags
List of the BBCode forbidden tags |
#
array()
|
$array_tags,
$content,
$module_special_tags,
$page_path,
$path_to_root
|