__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()
$_boardRoot
$_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()
inherited_from | \XenForo_BbCode_Formatter_Base::__construct() |
---|
addMediaSites(array $sites)
inherited_from | \XenForo_BbCode_Formatter_Base::addMediaSites() |
---|
array
addSmilies(array $smilies)
inherited_from | \XenForo_BbCode_Formatter_Base::addSmilies() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::create() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::filterFinalOutput() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::filterString() |
---|
string
array
List of states the renderer may be in
string
Filtered/escaped stringgetTags() : array
inherited_from | \XenForo_BbCode_Formatter_Base::getTags() |
---|
array
getTextSize(string $inputSize) : string | false
inherited_from | \XenForo_BbCode_Formatter_Base::getTextSize() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::parseValidatePlainIfNoOption() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::parseValidateTagCode() |
---|
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()
inherited_from | \XenForo_BbCode_Formatter_Base::preLoadData() |
---|
preLoadTemplates(\XenForo_View $view)
renderInvalidTag(array $tag, array $rendererStates) : string
This tag is simply displayed in its original form.
inherited_from | \XenForo_BbCode_Formatter_Base::renderInvalidTag() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::renderString() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::renderSubTree() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::renderTag() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagAlign() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagAttach(array $tag, array $rendererStates)
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagAttach() |
---|
renderTagCode(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagCode() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagEmail(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagEmail() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagHtml(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagHtml() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagImage(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagImage() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagIndent(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagIndent() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagList(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagList() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagMedia() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagPhp(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagPhp() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagQuote(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagQuote() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagSize(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagSize() |
---|
array
Information about the tag reference; keys: tag, option, children
array
Renderer states to push down
string
Rendered tagrenderTagUnparsed(array $tag, array $rendererStates) : string
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagUnparsed() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::renderTagUrl() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::renderTree() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::renderTreeElement() |
---|
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
inherited_from | \XenForo_BbCode_Formatter_Base::renderValidTag() |
---|
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.
inherited_from | \XenForo_BbCode_Formatter_Base::replaceSmiliesInText() |
---|
string
Text to replace in
mixed
Callback for escaping. If empty, no escaping is done.
string
setView(\XenForo_View $view) : \unknown_type
inherited_from | \XenForo_BbCode_Formatter_Base::setView() |
---|
\XenForo_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!
inherited_from | \XenForo_BbCode_Formatter_Base::stringifyTree() |
---|
array
Tree or sub-tree to stringify
string
Tree as a string (like the original input)trimLeadingLines(string $string, integer $amount) : string
inherited_from | \XenForo_BbCode_Formatter_Base::trimLeadingLines() |
---|
string
integer
string
_appendListElement(array $elements, string $appendString)
inherited_from | \XenForo_BbCode_Formatter_Base::_appendListElement() |
---|
array
By reference. List of existing elements.
string
String to append (if not empty)
_getMediaSiteHtmlFromCallback(string $mediaKey, array $site) : string | boolean
inherited_from | \XenForo_BbCode_Formatter_Base::_getMediaSiteHtmlFromCallback() |
---|
string
array
Information about the site to render this media
string
boolean
Returns false if callback is invalid_getTagRule(string $tagName) : array | false
inherited_from | \XenForo_BbCode_Formatter_Base::_getTagRule() |
---|
string
array
false
_getValidUrl(string $url) : string | false
False is returned if not possible.
inherited_from | \XenForo_BbCode_Formatter_Base::_getValidUrl() |
---|
string
URL to validate
string
false
_prepareSmilieUrl(string $smilieUrl) : string
Fetches the result from cache if possible.
inherited_from | \XenForo_BbCode_Formatter_Base::_prepareSmilieUrl() |
---|
string
string
_prepareSmilieUrlInternal(string $smilieUrl) : string
see | \global\XenForo_BbCode_Formatter_Base::_prepareSmilieUrl() |
---|
string
string
_processSmilieSpriteTemplate(array $smilie) : string
array
string
_processSmilieTemplate(array $smilie) : string
inherited_from | \XenForo_BbCode_Formatter_Base::_processSmilieTemplate() |
---|
array
string
_renderListOutput(string $listType, array $elements) : string
inherited_from | \XenForo_BbCode_Formatter_Base::_renderListOutput() |
---|
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
$_boardRoot : string
$_ignoredUsers : array
inherited_from | \XenForo_BbCode_Formatter_Base::$$_ignoredUsers |
---|
$_imageTemplate : string
Will be passed the following params: 1 URL 2 Additional CSS classes
inherited_from | \XenForo_BbCode_Formatter_Base::$$_imageTemplate |
---|
$_mediaSites : array
inherited_from | \XenForo_BbCode_Formatter_Base::$$_mediaSites |
---|
$_smiliePaths : array
inherited_from | \XenForo_BbCode_Formatter_Base::$$_smiliePaths |
---|
$_smilieReverse : array
inherited_from | \XenForo_BbCode_Formatter_Base::$$_smilieReverse |
---|
$_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
inherited_from | \XenForo_BbCode_Formatter_Base::$$_smilieTemplate |
---|
$_smilieTranslate : array
inherited_from | \XenForo_BbCode_Formatter_Base::$$_smilieTranslate |
---|
$_smilieUrlCache : array
inherited_from | \XenForo_BbCode_Formatter_Base::$$_smilieUrlCache |
---|
$_textDirection : string
inherited_from | \XenForo_BbCode_Formatter_Base::$$_textDirection |
---|
$_view : \XenForo_View | null
inherited_from | \XenForo_BbCode_Formatter_Base::$$_view |
---|