core/model/modx/modparser095.class.php

Show: inherited
Table of Contents

Package
modx  

\modParser095

Package: modx

An extension of the MODX parser to support legacy MODX tags.

Use of this class is only necessary if you have a site that contains legacy MODX tags. It provides facilities for translating the legacy tags, as well as for supporting legacy behavior of the onParseDocument event used in many legacy MODX plugins.

Parent(s)
\modParser

Properties

Propertyprotectedbool  $_processingTag= 'false'
inherited

If the parser is currently processing a tag

Inherited from: \modParser::$$_processingTag
Default valuefalseDetails
Type
bool
Inherited_from
\modParser::$$_processingTag  
Propertyprotectedbool  $_processingUncacheable= 'false'
inherited

If the parser is currently processing an uncacheable tag

Inherited from: \modParser::$$_processingUncacheable
Default valuefalseDetails
Type
bool
Inherited_from
\modParser::$$_processingUncacheable  
Propertyprotectedbool  $_removingUnprocessed= 'false'
inherited

If the parser is currently removing all unprocessed tags

Inherited from: \modParser::$$_removingUnprocessed
Default valuefalseDetails
Type
bool
Inherited_from
\modParser::$$_removingUnprocessed  
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instance

Inherited from: \modParser::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modParser::$$modx  
Propertypublicarray  $tagTranslation= 'array ( '[[++' => array ('[(', ')]', '++'), '[[$' => array ('{{', '}}', '$'), '[[*' => array ('[*', '*]', '*'), '[[~' => array ('[~', '~]', '~'), '[[+' => array ('[+', '+]', '+'), '[[!' => array ('[!', '!]', '!'), )'

An array of translation strings from migrating from Evolution

Default valuearray ( '[[++' => array ('[(', ')]', '++'), '[[$' => array ('{{', '}}', '$'), '[[*' => array ('[*', '*]', '*'), '[[~' => array ('[~', '~]', '~'), '[[+' => array ('[+', '+]', '+'), '[[!' => array ('[!', '!]', '!'), )Details
Type
array

Methods

methodprotected_XType( string $type ) : string
inherited

Converts legacy property string types to xtypes.

Inherited from: \modParser::_XType()
Parameters
Name Type Description
$type string

A property type string.

Returns
Type Description
string A valid xtype.
Details
Access
protected  
methodpublic__construct( \xPDO $modx ) : void
inherited

Inherited from: \modParser::__construct()
Parameters
Name Type Description
$modx \xPDO

A reference to the modX|xPDO instance

methodpubliccollectElementTags( string $origContent, array $matches, string $prefix = '[[', string $suffix = ']]' ) : integer
inherited

Collects element tags in a string and injects them into an array.

Inherited from: \modParser::collectElementTags()
Parameters
Name Type Description
$origContent string

The content to collect tags from.

$matches array

&$matches An array in which the collected tags will be stored (by reference)

$prefix string

The characters that define the start of a tag (default= "[[").

$suffix string

The characters that define the end of a tag (default= "]]").

Returns
Type Description
integer The number of tags collected from the content.
methodpublicgetElement( string $class, string $name ) : \modElement | null
inherited

Get a modElement instance taking advantage of the modX::$sourceCache.

Inherited from: \modParser::getElement()
Parameters
Name Type Description
$class string

The modElement derivative class to load.

$name string

An element name or raw tagName to identify the modElement instance.

Returns
Type Description
\modElement | null An instance of the specified modElement derivative class.
methodpublicisProcessingTag( ) : bool
inherited

Returns true if the parser is currently processing a tag

Inherited from: \modParser::isProcessingTag()
Returns
Type Description
bool
methodpublicisProcessingUncacheable( ) : bool
inherited

Returns true if the parser is currently processing an uncacheable tag

Inherited from: \modParser::isProcessingUncacheable()
Returns
Type Description
bool
methodpublicisRemovingUnprocessed( ) : bool
inherited

Returns true if the parser is currently removing any unprocessed tags

Inherited from: \modParser::isRemovingUnprocessed()
Returns
Type Description
bool
methodpublicloadFromCache( string $tag ) : string
inherited

Loads output cached by complete tag signature from the elementCache.

Inherited from: \modParser::loadFromCache()
Parameters
Name Type Description
$tag string

The tag signature representing the element instance.

Returns
Type Description
string The cached output from the element instance.
Details
Uses
\modX::$_elementCache  
methodpublicmergeTagOutput( array $tagMap, string $content ) : void
inherited

Merges processed tag output into provided content string.

Inherited from: \modParser::mergeTagOutput()
Parameters
Name Type Description
$tagMap array

An array with full tags as keys and processed output as the values.

$content string

The content to merge the tag output with (passed by reference).

methodpublicparseProperties( string $propSource ) : array
inherited

Parses an element/tag property string or array definition.

Inherited from: \modParser::parseProperties()
Parameters
Name Type Description
$propSource string

A valid property string or array source to parse.

Returns
Type Description
array An associative array of property values parsed from the property string or array definition.
methodpublicparsePropertyString( string $string, boolean $valuesOnly = false ) : array
inherited

Parses an element/tag property string and returns an array of properties.

Inherited from: \modParser::parsePropertyString()
Parameters
Name Type Description
$string string

The property string to parse.

$valuesOnly boolean

Indicates only the property value should be returned.

Returns
Type Description
array The processed properties in array format
methodpublicprocessElementTags( string $parentTag,  $content, bool $processUncacheable = false, bool $removeUnprocessed = false, string $prefix = "[[", string $suffix = "]]", array $tokens = array (), bool $echo = false ) : string

Adds the legacy tag translation and legacy OnParseDocument event support.

Parameters
Name Type Description
$parentTag string
$content
$processUncacheable bool
$removeUnprocessed bool
$prefix string
$suffix string
$tokens array
$echo bool
Returns
Type Description
string
methodpublicprocessTag( string $tag, boolean $processUncacheable = true ) : mixed
inherited

Processes a modElement tag and returns the result.

Inherited from: \modParser::processTag()
Parameters
Name Type Description
$tag string

A full tag string parsed from content.

$processUncacheable boolean
Returns
Type Description
mixed The output of the processed element represented by the specified tag.
methodpublicrealname( string $unfiltered ) : string
inherited

Gets the real name of an element containing filter modifiers.

Inherited from: \modParser::realname()
Parameters
Name Type Description
$unfiltered string

The unfiltered name of a {@link modElement}.

Returns
Type Description
string The name minus any filter modifiers.
methodpublictranslate( string $content, array $tokens = array (), boolean $echo = false ) : void

Collects MODX legacy tags and translates them to the new tag format.

Parameters
Name Type Description
$content string

&$content The content in which legacy tags are to be replaced.

$tokens array

An optional array of tag tokens on which to exclude translation of the tags.

$echo boolean
Documentation was generated by DocBlox 0.18.1.