vB_BbCodeHelper
in package
Uses
vB_Trait_NoSerialize
Table of Contents
Constants
- PARSER_START = 1
- BB code parser's start state. Looking for the next tag to start.
- PARSER_TAG_OPENED = 3
- Tag has been opened. Now parsing for option and closing ].
- PARSER_TEXT = 2
- BB code parser's "this range is just text" state.
Methods
- __construct() : mixed
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- buildParseArrayAndFixTags() : array<string|int, mixed>
- Convert $text to a bbcode parse array with fixed mismatched tags
- cacheSmilies() : array<string|int, mixed>
- Caches the smilies in a form ready to be executed.
- generateAndSaveBbCodeData() : mixed
- instance() : vB_BbCodeHelper
- Generate an instance of vB_BbCodeHelper with defaults
- parseWhitespaceNewlines() : string
- Parses out specific white space before or after cetain tags and does nl2br
- stripSmilies() : string
- Removes translated smilies from a string.
- tagIsOnOwnLine() : bool
- This is meant to only be used with parseArray() and should be considered a subfunction, as its logic is extremely coupled with parseArray()'s logic, and one cannot be modified without the other.
Constants
PARSER_START
BB code parser's start state. Looking for the next tag to start.
public
mixed
PARSER_START
= 1
PARSER_TAG_OPENED
Tag has been opened. Now parsing for option and closing ].
public
mixed
PARSER_TAG_OPENED
= 3
PARSER_TEXT
BB code parser's "this range is just text" state.
public
mixed
PARSER_TEXT
= 2
Requires $internal_data to be set appropriately.
Methods
__construct()
public
__construct([mixed $tag_list = [] ][, mixed $smilies = [] ]) : mixed
Parameters
- $tag_list : mixed = []
- $smilies : mixed = []
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
buildParseArrayAndFixTags()
Convert $text to a bbcode parse array with fixed mismatched tags
public
buildParseArrayAndFixTags(mixed $text) : array<string|int, mixed>
Parameters
- $text : mixed
Return values
array<string|int, mixed>cacheSmilies()
Caches the smilies in a form ready to be executed.
public
cacheSmilies(bool $do_html) : array<string|int, mixed>
Parameters
- $do_html : bool
Return values
array<string|int, mixed> —Reference to smilie cache (key: find text; value: replace text)
generateAndSaveBbCodeData()
public
generateAndSaveBbCodeData(mixed $rawtext, mixed $nodeid) : mixed
Parameters
- $rawtext : mixed
- $nodeid : mixed
instance()
Generate an instance of vB_BbCodeHelper with defaults
public
static instance([mixed $appendCustomTags = true ]) : vB_BbCodeHelper
Parameters
- $appendCustomTags : mixed = true
Return values
vB_BbCodeHelperparseWhitespaceNewlines()
Parses out specific white space before or after cetain tags and does nl2br
public
parseWhitespaceNewlines(mixed $text[, mixed $do_nl2br = true ]) : string
Parameters
- $text : mixed
- $do_nl2br : mixed = true
Return values
string —Processed text
stripSmilies()
Removes translated smilies from a string.
public
stripSmilies(string $text) : string
Parameters
- $text : string
Return values
string —Text with smilie HTML returned to smilie codes
tagIsOnOwnLine()
This is meant to only be used with parseArray() and should be considered a subfunction, as its logic is extremely coupled with parseArray()'s logic, and one cannot be modified without the other.
public
tagIsOnOwnLine(mixed $openTagPosition, mixed $closeTagPosition, mixed $keys, mixed $preparsed) : bool
Parameters
- $openTagPosition : mixed
- $closeTagPosition : mixed
- $keys : mixed
- $preparsed : mixed