core/model/modx/transport/modtranslator.class.php

Show: inherited
Table of Contents

Package
modx  
Subpackage
transport  

\modTranslator

Package: modx\transport

Abstracts the pre-097 site conversion utilities.

Parent(s)
\modTranslate095

Properties

Propertypublicarray  $classes= ''

Can either be an array of array of classname => fields to translate, empty to skip classes or null to process all standard content fields for MODX (use processAllFields())
Details
Type
array
Propertypublicarray  $files= ''

An array of files (with full paths) to be translated
Details
Type
array
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX instance

Inherited from: \modTranslate095::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modTranslate095::$$modx  
Propertypublic\modParser095  $parser= 'null'
inherited

The parsing engine for interpreting Evolution-style tags

Inherited from: \modTranslate095::$$parser
Default valuenullDetails
Type
\modParser095
Inherited_from
\modTranslate095::$$parser  
Propertypublicarray  $paths= ''

Paths of files, according to the patterns, to be translated (recursive)
Details
Type
array
Propertypublicstring  $patterns= ''

File patterns to limit the file types to be included for translation in the paths
Details
Type
string
Propertypublicboolean  $recursive= ''

If true, paths added will be recursively translated.
Details
Type
boolean

Methods

methodpublic__construct( \xPDO $modx, bool $recursive = true ) : void

Initializes the class and sets up a translation map

Parameters
Name Type Description
$modx \xPDO

A reference to the xPDO|modX instance

$recursive bool

Whether or not this translator will recurse

methodpublicaddClass( ) : void

Adds a class to be translated.

Can have an unlimited number of arguments.

methodpublicaddFile( ) : void

Adds a file to be translated.

Can have an unlimited number of arguments.

methodpublicaddPath( ) : void

Adds a path to be translated.

Can have an unlimited number of arguments.

methodpublicaddPattern( ) : void

Adds a pattern to be translated.

Can have an unlimited number of arguments.

methodpublicgetAllSubdirs( string $path ) : void

Recursively adds all subdirs of a directory.

Parameters
Name Type Description
$path string

The path to recursively search in.

methodpublicgetParser( ) : \modParser095
inherited

Gets the parsing engine

Inherited from: \modTranslate095::getParser()
Returns
Type Description
\modParser095
methodpublicprocessAllFields( boolean $b = true ) : void

Sets the translator to process all standard MODX fields.

Parameters
Name Type Description
$b boolean

If false, will revert to an empty array of classes.

methodpublictranslateFiles( boolean $save = false, array $files = array() ) : string
inherited

Translate specific files

Inherited from: \modTranslate095::translateFiles()
Parameters
Name Type Description
$save boolean

If true, will save the translation

$files array

An array of files to translate

Returns
Type Description
string
methodpublictranslateSite( boolean $save = false, boolean $toFile = false ) : void

Translates the site.

Parameters
Name Type Description
$save boolean

Determines if translation is written to the database tables and/or files (changes are permanent if true)

$toFile boolean

A path to a file where a log of the translation session is written

Documentation was generated by DocBlox 0.18.1.