__construct()
addMediaSites()
addSmilies()
create()
filterFinalOutput()
filterString()
getTags()
getTextSize()
parseValidatePlainIfNoOption()
parseValidateTagCode()
preLoadData()
preLoadTemplates()
renderInvalidTag()
renderString()
renderSubTree()
renderTag()
renderTagAlign()
renderTagAttach()
renderTagCode()
renderTagEmail()
renderTagHtml()
renderTagImage()
renderTagIndent()
renderTagList()
renderTagMedia()
renderTagPhp()
renderTagQuote()
renderTagSize()
renderTagUnparsed()
renderTagUrl()
renderTree()
renderTreeElement()
renderValidTag()
replaceSmiliesInText()
setView()
stringifyTree()
trimLeadingLines()
_appendListElement()
_getMediaSiteHtmlFromCallback()
_getTagRule()
_getValidUrl()
_prepareSmilieUrl()
_prepareSmilieUrlInternal()
_processSmilieSpriteTemplate()
_processSmilieTemplate()
_renderListOutput()
_renderTagQuoteFallback()
$_ignoredUsers
$_imageTemplate
$_mediaSites
$_smiliePaths
$_smilieReverse
$_smilieSpriteTemplate
$_smilieTemplate
$_smilieTranslate
$_smilieUrlCache
$_tags
$_textDirection
$_view
Base class for defining the formatting used by the BB code parser.
This class implements HTML formatting.
package | XenForo_BbCode |
---|
__construct()
addMediaSites(array $sites)
array
addSmilies(array $smilies)
array
List of smilies with data from the DB (smilie_id, smilieText [array], image_url)
create(string $class, array | false $options) : \XenForo_BbCode_Formatter_Base
string
Name of the class. If empty, uses this class; if doesn't contain an underscore, assumes a partial name
array
false
Set of options to configure formatter; defaults to pulling as necessary; if false, doesn't look in registry etc
filterFinalOutput(string $output) : string
string
string
filterString(string $string, array $rendererStates) : string
A string is simply the text between tags. This function is responsible for things like word wrap and smilies and output escaping.
string
array
List of states the renderer may be in
string
Filtered/escaped stringgetTags() : array
array
getTextSize(string $inputSize) : string | false
string
string
false
parseValidatePlainIfNoOption(array $tagInfo, string | null $tagOption) : array | boolean
Useful for tags like url/email, where the address may be in the body of the tag.
array
Info about the tag we're parsing.
string
null
Any option passed into the tag
array
boolean
True if tag is ok as is, array to change states, false to reject tagparseValidateTagCode(array $tagInfo, string | null $tagOption) : array | boolean
Users must explicitly opt in to allow BB codes to be used within.
array
Info about the tag we're parsing.
string
null
Any option passed into the tag
array
boolean
True if tag is ok as is, array to change states, false to reject tagpreLoadData()
preLoadTemplates(\XenForo_View $view)
\XenForo_View
renderInvalidTag(array $tag, array $rendererStates) : string
This tag is simply displayed in its original form.
array
Tag data from tree
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
string
Rendered versionrenderString(string $string, array $rendererStates, integer $trimLeadingLines) : string
string
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
integer
By reference. Number of leading lines to strip off next element.
string
Rendered stringrenderSubTree(array $tree, array $rendererStates) : string
This does not reset the rendering states, meaning it is ok for recursive calls.
array
Tree from {@link parse()}
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
string
Output textrenderTag(array $element, array $rendererStates, integer $trimLeadingLines) : string
This tag may be valid or invalid.
array
Tag element.
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
integer
By reference. Number of leading lines to strip from next element. May be modified by tag.
string
Rendered tag.renderTagAlign(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagAttach(array $tag, array $rendererStates)
renderTagCode(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagEmail(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagHtml(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagImage(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagIndent(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagList(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagMedia(array $tag, array $rendererStates) : string
Media tags embed rich media (usually videos). To embed a video, the source must be known.
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagPhp(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagQuote(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagSize(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagUnparsed(array $tag, array $rendererStates) : string
array
Tag data from tree
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
string
Rendered versionrenderTagUrl(array $tag, array $rendererStates) : string
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTree(array $tree, array $extraStates) : string
Note that this initializes the default states, so it is likely not the correct function to call for child tags.
array
Tree from {@link parse()}.
array
A list of extra states to push into the formatter
string
Output textrenderTreeElement(array | string $element, array $rendererStates, integer $trimLeadingLines) : string
array
string
Tree element
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
integer
By reference. Number of leading lines to strip off next element.
string
Rendered element.renderValidTag(array $tagInfo, array $tag, array $rendererStates) : string
array
Information about how to parse the tag
array
Tag data from tree
array
Renderer states to push down. Except in specific cases, cannot be pushed up.
string
Rendered versionreplaceSmiliesInText(string $text, mixed $escapeCallback) : string
This method also escapes the output before the smilies are ultimately replaced. This is necessary to prevent the rich output from being escaped.
string
Text to replace in
mixed
Callback for escaping. If empty, no escaping is done.
string
setView(\XenForo_View $view) : \unknown_type
stringifyTree(array $tree) : string
This can be useful for functions that can only take plain text children.
Note that this output is not escaped in anyway!
array
Tree or sub-tree to stringify
string
Tree as a string (like the original input)trimLeadingLines(string $string, integer $amount) : string
string
integer
string
_appendListElement(array $elements, string $appendString)
array
By reference. List of existing elements.
string
String to append (if not empty)
_getMediaSiteHtmlFromCallback(string $mediaKey, array $site) : string | boolean
string
array
Information about the site to render this media
string
boolean
Returns false if callback is invalid_getTagRule(string $tagName) : array | false
string
array
false
_getValidUrl(string $url) : string | false
False is returned if not possible.
string
URL to validate
string
false
_prepareSmilieUrl(string $smilieUrl) : string
Fetches the result from cache if possible.
string
string
_prepareSmilieUrlInternal(string $smilieUrl) : string
string
string
_processSmilieSpriteTemplate(array $smilie) : string
array
string
_processSmilieTemplate(array $smilie) : string
array
string
_renderListOutput(string $listType, array $elements) : string
string
Type of list (ol or ul)
array
List of elements in the list. These are already rendered.
string
_renderTagQuoteFallback(string $name, string $content) : string
string
Name of quoted user
string
Quoted text
string
$_ignoredUsers : array
$_imageTemplate : string
Will be passed the following params: 1 URL 2 Additional CSS classes
$_mediaSites : array
$_smiliePaths : array
$_smilieReverse : array
$_smilieSpriteTemplate : string
Will be passed the following params: 1 Smilie ID 2 Smilie text 3 Smilie title
$_smilieTemplate : string
Will be passed the following params: 1 Image URL 2 Smilie text 3 Smilie title
$_smilieTranslate : array
$_smilieUrlCache : array
$_textDirection : string