AdminTheme
extends CFormModel
in package
Admin Theme Model
Tags
Table of Contents
Properties
- $config : mixed
- $name : string
- $path : string
- $sTemplateUrl : string
- $use_asset_manager : bool
- $instance : AdminTheme
Methods
- getAdminThemeList() : array<string|int, mixed>
- Get the list of admin theme, as an array containing each configuration object for each template
- getInstance() : AdminTheme
- Get instance of theme object.
- getOtherAssets() : array<string|int, string>
- registerStylesAndScripts() : mixed
- Load the default admin interface CSS and JavaScript Packages including the admin_theme
- setAdminTheme() : AdminTheme
- Set the Admin Theme : - checks if the required template exists - set the admin theme variables - set the admin theme constants - Register all the needed CSS/JS files
- defineConstants() : mixed
- Few constants depending on Template
- getThemeList() : array<string|int, mixed>
- Return an array containing the configuration object of all templates in a given directory
- isStandardAdminTheme() : bool
- Use to check if admin theme is standard
- registerAdminTheme() : void
- Register admin-theme package
Properties
$config
public
mixed
$config
Contains the Admin Theme's configuration file
$name
public
string
$name
Admin Theme's name
$path
public
string
$path
Admin Theme's path
$sTemplateUrl
public
string
$sTemplateUrl
URL to reach Admin Theme (used to get CSS/JS/Files when asset manager is off)
$use_asset_manager
public
static bool
$use_asset_manager
If true, force the use of asset manager even if debug mode is on (useful to debug asset manager's problems)
$instance
private
static AdminTheme
$instance
The instance of theme object
Methods
getAdminThemeList()
Get the list of admin theme, as an array containing each configuration object for each template
public
static getAdminThemeList() : array<string|int, mixed>
Return values
array<string|int, mixed> —the array of configuration object
getInstance()
Get instance of theme object.
public
static getInstance() : AdminTheme
Will instantiate the Admin Theme object first time it is called. Please use this instead of global variable.
Return values
AdminThemegetOtherAssets()
public
static getOtherAssets() : array<string|int, string>
Return values
array<string|int, string>registerStylesAndScripts()
Load the default admin interface CSS and JavaScript Packages including the admin_theme
public
registerStylesAndScripts() : mixed
Register all the styles and scripts of the current template. Check if RTL is needed, use asset manager if needed. This function is public because it appears that sometime, the package need to be register again in header (probably a cache problem)
setAdminTheme()
Set the Admin Theme : - checks if the required template exists - set the admin theme variables - set the admin theme constants - Register all the needed CSS/JS files
public
setAdminTheme() : AdminTheme
Return values
AdminThemedefineConstants()
Few constants depending on Template
private
defineConstants() : mixed
getThemeList()
Return an array containing the configuration object of all templates in a given directory
private
static getThemeList(string $sDir) : array<string|int, mixed>
Parameters
- $sDir : string
-
the directory to scan
Return values
array<string|int, mixed> —the array of object
isStandardAdminTheme()
Use to check if admin theme is standard
private
isStandardAdminTheme(string $sAdminThemeName) : bool
Parameters
- $sAdminThemeName : string
-
the name of the template
Return values
bool —return true if it's a standard template, else false
registerAdminTheme()
Register admin-theme package
private
registerAdminTheme( $files, $aCssFiles) : void