PHP Class Backend\Modules\Extensions\Engine\Model

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
buildTemplateHTML ( array $format, boolean $large = false ) : string Build HTML for a template (visual representation)
checkSettings ( ) : array Checks the settings and optionally returns an array with warnings
clearCache ( ) Clear all applications cache.
createTemplateXmlForExport ( string $theme ) : string Create template XML for export
deleteTemplate ( integer $id ) : boolean Delete a template.
existsModule ( string $module ) : boolean Does this module exist.
existsTemplate ( integer $id ) : boolean Check if a template exists
existsTheme ( string $theme ) : boolean Does this template exist.
getExtras ( ) : array Get extras
getExtrasData ( ) : array Get all the available extra's
getModuleInformation ( string $module ) : array Fetch the module information from the info.xml file.
getModules ( ) : array Get modules based on the directory listing in the backend application.
getModulesThatRequireAkismet ( ) : array Fetch the list of modules that require Akismet API key
getModulesThatRequireGoogleMaps ( ) : array Fetch the list of modules that require Google Maps API key
getTemplate ( integer $id ) : array Get a given template
getTemplates ( string $theme = null ) : array Get templates
getThemes ( ) : array Fetch the list of available themes
hasModuleWarnings ( string $module ) : string Checks if a specific module has errors or not
insertTemplate ( array $template ) : integer Inserts a new template
installModule ( string $module ) Install a module.
installTheme ( string $theme ) Install a theme.
isModuleInstalled ( string $module ) : boolean Checks if a module is already installed.
isTemplateInUse ( integer $templateId ) : boolean Is the provided template id in use by active versions of pages?
isThemeInstalled ( string $theme ) : boolean Checks if a theme is already installed.
isWritable ( string $path ) : boolean Check if a directory is writable.
processModuleXml ( SimpleXMLElement $xml ) : array Process the module's information XML and return an array with the information.
processThemeXml ( SimpleXMLElement $xml ) : array Process the theme's information XML and return an array with the information.
templateSyntaxToArray ( string $syntax ) : array Convert the template syntax into an array to work with.
updateTemplate ( array $item ) Update a template
validateThemeInformation ( array $information ) : array Make sure that we have an entirely valid theme information array

Method Details

buildTemplateHTML() public static method

Build HTML for a template (visual representation)
public static buildTemplateHTML ( array $format, boolean $large = false ) : string
$format array The template format.
$large boolean Will the HTML be used in a large version?
return string

checkSettings() public static method

Checks the settings and optionally returns an array with warnings
public static checkSettings ( ) : array
return array

clearCache() public static method

Note: we do not need to rebuild anything, the core will do this when noticing the cache files are missing.
public static clearCache ( )

createTemplateXmlForExport() public static method

Create template XML for export
public static createTemplateXmlForExport ( string $theme ) : string
$theme string
return string

deleteTemplate() public static method

Delete a template.
public static deleteTemplate ( integer $id ) : boolean
$id integer The id of the template to delete.
return boolean

existsModule() public static method

This does not check for existence in the database but on the filesystem.
public static existsModule ( string $module ) : boolean
$module string Module to check for existence.
return boolean

existsTemplate() public static method

Check if a template exists
public static existsTemplate ( integer $id ) : boolean
$id integer The Id of the template to check for existence.
return boolean

existsTheme() public static method

This does not check for existence in the database but on the filesystem.
public static existsTheme ( string $theme ) : boolean
$theme string Theme to check for existence.
return boolean

getExtras() public static method

Get extras
public static getExtras ( ) : array
return array

getExtrasData() public static method

Get all the available extra's
public static getExtrasData ( ) : array
return array

getModuleInformation() public static method

Fetch the module information from the info.xml file.
public static getModuleInformation ( string $module ) : array
$module string
return array

getModules() public static method

If a module contains a info.xml it will be parsed.
public static getModules ( ) : array
return array

getModulesThatRequireAkismet() public static method

Fetch the list of modules that require Akismet API key
public static getModulesThatRequireAkismet ( ) : array
return array

getModulesThatRequireGoogleMaps() public static method

Fetch the list of modules that require Google Maps API key
public static getModulesThatRequireGoogleMaps ( ) : array
return array

getTemplate() public static method

Get a given template
public static getTemplate ( integer $id ) : array
$id integer The id of the requested template.
return array

getTemplates() public static method

Get templates
public static getTemplates ( string $theme = null ) : array
$theme string The theme we want to fetch the templates from.
return array

getThemes() public static method

Fetch the list of available themes
public static getThemes ( ) : array
return array

hasModuleWarnings() public static method

Checks if a specific module has errors or not
public static hasModuleWarnings ( string $module ) : string
$module string
return string

insertTemplate() public static method

Inserts a new template
public static insertTemplate ( array $template ) : integer
$template array The data for the template to insert.
return integer

installModule() public static method

Install a module.
public static installModule ( string $module )
$module string The name of the module to be installed.

installTheme() public static method

Install a theme.
public static installTheme ( string $theme )
$theme string The name of the theme to be installed.

isModuleInstalled() public static method

Checks if a module is already installed.
public static isModuleInstalled ( string $module ) : boolean
$module string
return boolean

isTemplateInUse() public static method

Is the provided template id in use by active versions of pages?
public static isTemplateInUse ( integer $templateId ) : boolean
$templateId integer The id of the template to check.
return boolean

isThemeInstalled() public static method

Checks if a theme is already installed.
public static isThemeInstalled ( string $theme ) : boolean
$theme string
return boolean

isWritable() public static method

The default is_writable function has problems due to Windows ACLs "bug"
public static isWritable ( string $path ) : boolean
$path string The path to check.
return boolean

processModuleXml() public static method

Process the module's information XML and return an array with the information.
public static processModuleXml ( SimpleXMLElement $xml ) : array
$xml SimpleXMLElement
return array

processThemeXml() public static method

Process the theme's information XML and return an array with the information.
public static processThemeXml ( SimpleXMLElement $xml ) : array
$xml SimpleXMLElement
return array

templateSyntaxToArray() public static method

Convert the template syntax into an array to work with.
public static templateSyntaxToArray ( string $syntax ) : array
$syntax string
return array

updateTemplate() public static method

Update a template
public static updateTemplate ( array $item )
$item array The new data for the template.

validateThemeInformation() public static method

Make sure that we have an entirely valid theme information array
public static validateThemeInformation ( array $information ) : array
$information array Contains the parsed theme info.xml data.
return array