PHP Class Contao\Theme

Provide methods to handle themes.
Inheritance: extends Backend
Show file Open project: contao/core-bundle

Public Methods

Method Description
exportTheme ( DataContainer $dc ) Export a theme
importTheme ( ) : string Import a theme

Protected Methods

Method Description
addDataRow ( DOMDocument $xml, DOMElement $table, array $arrRow, array $arrOrder = [] ) Add a data row to the XML document
addFolderToArchive ( ZipWriter $objArchive, string $strFolder, DOMDocument $xml, DOMElement $table, array $arrOrder = [] ) Recursively add a folder to the archive
addTableTlFiles ( DOMDocument $xml, DOMElement $tables, Result $objTheme, ZipWriter $objArchive ) Add the table tl_files to the XML and the files to the archive
addTableTlImageSize ( DOMDocument $xml, DOMNode $tables, Result $objTheme ) Add the table tl_image_size
addTableTlLayout ( DOMDocument $xml, DOMNode $tables, Result $objTheme ) Add the table tl_layout
addTableTlModule ( DOMDocument $xml, DOMNode $tables, Result $objTheme ) Add the table tl_module
addTableTlStyleSheet ( DOMDocument $xml, DOMNode $tables, Result $objTheme ) Add the table tl_style_sheet
addTableTlTheme ( DOMDocument $xml, DOMNode $tables, Result $objTheme ) Add the table tl_theme
addTemplatesToArchive ( ZipWriter $objArchive, string $strFolder ) Add templates to the archive
compareThemeFiles ( array $arrFiles, array $arrDbFields ) : string Compare the theme tables with the local database and check whether there are custom layout sections
customizeUploadPath ( string $strPath ) : string Replace files/ with the custom upload folder name
extractThemeFiles ( array $arrFiles, array $arrDbFields ) Extract the theme files and write the data to the database
standardizeUploadPath ( string $strPath ) : string Replace a custom upload folder name with files/

Method Details

addDataRow() protected method

Add a data row to the XML document
protected addDataRow ( DOMDocument $xml, DOMElement $table, array $arrRow, array $arrOrder = [] )
$xml DOMDocument
$table DOMElement
$arrRow array
$arrOrder array

addFolderToArchive() protected method

Recursively add a folder to the archive
protected addFolderToArchive ( ZipWriter $objArchive, string $strFolder, DOMDocument $xml, DOMElement $table, array $arrOrder = [] )
$objArchive ZipWriter
$strFolder string
$xml DOMDocument
$table DOMElement
$arrOrder array

addTableTlFiles() protected method

Add the table tl_files to the XML and the files to the archive
protected addTableTlFiles ( DOMDocument $xml, DOMElement $tables, Result $objTheme, ZipWriter $objArchive )
$xml DOMDocument
$tables DOMElement
$objTheme Contao\Database\Result
$objArchive ZipWriter

addTableTlImageSize() protected method

Add the table tl_image_size
protected addTableTlImageSize ( DOMDocument $xml, DOMNode $tables, Result $objTheme )
$xml DOMDocument
$tables DOMNode
$objTheme Contao\Database\Result

addTableTlLayout() protected method

Add the table tl_layout
protected addTableTlLayout ( DOMDocument $xml, DOMNode $tables, Result $objTheme )
$xml DOMDocument
$tables DOMNode
$objTheme Contao\Database\Result

addTableTlModule() protected method

Add the table tl_module
protected addTableTlModule ( DOMDocument $xml, DOMNode $tables, Result $objTheme )
$xml DOMDocument
$tables DOMNode
$objTheme Contao\Database\Result

addTableTlStyleSheet() protected method

Add the table tl_style_sheet
protected addTableTlStyleSheet ( DOMDocument $xml, DOMNode $tables, Result $objTheme )
$xml DOMDocument
$tables DOMNode
$objTheme Contao\Database\Result

addTableTlTheme() protected method

Add the table tl_theme
protected addTableTlTheme ( DOMDocument $xml, DOMNode $tables, Result $objTheme )
$xml DOMDocument
$tables DOMNode
$objTheme Contao\Database\Result

addTemplatesToArchive() protected method

Add templates to the archive
protected addTemplatesToArchive ( ZipWriter $objArchive, string $strFolder )
$objArchive ZipWriter
$strFolder string

compareThemeFiles() protected method

Compare the theme tables with the local database and check whether there are custom layout sections
protected compareThemeFiles ( array $arrFiles, array $arrDbFields ) : string
$arrFiles array
$arrDbFields array
return string

customizeUploadPath() protected method

Replace files/ with the custom upload folder name
protected customizeUploadPath ( string $strPath ) : string
$strPath string
return string

exportTheme() public method

Export a theme
public exportTheme ( DataContainer $dc )
$dc DataContainer

extractThemeFiles() protected method

Extract the theme files and write the data to the database
protected extractThemeFiles ( array $arrFiles, array $arrDbFields )
$arrFiles array
$arrDbFields array

importTheme() public method

Import a theme
public importTheme ( ) : string
return string

standardizeUploadPath() protected method

Replace a custom upload folder name with files/
protected standardizeUploadPath ( string $strPath ) : string
$strPath string
return string