Class Theme
This class describes the themes behavior
Methods summary
public static
|
|
public static
|
|
public static
|
|
public static
array
|
|
public
mixed
|
#
getDefinition( string $prop = "" )
Get the theme data in the file manifest.json. If $prop is set, this method returns the property value in the theme data, else it returns all the theme data |
public
string
|
|
public
string
|
|
public
boolean
|
#
isRemovable( )
Check if the theme is removable. A theme is removable if it's not a native theme, and if it is not the selected one for the application |
public
string
|
#
getStartFile( )
Get the start file of the theme. The start file is the file start.php in the theme that initialize special intructions for the theme |
public
string
|
|
public
string
|
#
getStaticDir( )
Get the directory for HTTP accessible files. During theme build, the files are copied in this directory |
public
string
|
|
public
string
|
#
getFileUrl( string $file )
Copy a file from the theme directory to the static directory (to be accessible by HTTP requests) and returns it URL |
public
string
|
|
public
string
|
|
public
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
#
getBaseCssUrl( )
This method return the URL to access the CSS file of the theme, compiled from theme.less |
public
boole
|
|
public
array
|
#
getEditableVariables( string $less = null )
Get the variables in a CSS file content. In CSS files, variables are defined with the folowing format : /* define("variableName", color|dimension|file, "variable description that will appear in the customization page of the theme", defaultValue) *\/ |
public
array
|
|
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
string
|
#
getMediasUrl( string $filename = '' )
Get the URL of the directory containing the medias uplaoded by the administrator |
public
string
|
|
public
string
|
|
public
string
|
|
public
string
|
Constants summary
string |
DEFAULT_THEME
The default theme name |
#
'hawk'
|
string |
LESS_BASENAME
The theme css file basename |
#
'theme.less'
|
string |
COMPILED_CSS_BASENAME
The filename of the compiled Css file |
#
'theme.css'
|
string |
CSS_CUSTOM_BASENAME
The theme css custom file basename |
#
'theme-custom.css'
|
string |
MANIFEST_BASENAME
The filename of the definition file |
#
'manifest.json'
|
string |
PREVIEW_BASENAME
The filename of the preview image |
#
'preview.png'
|
string |
NAME_PATTERN
The pattern for a theme name |
#
'[a-zA-Z0-9\-_.]+'
|
string |
EDITABLE_VARS_PATTERN
The pattern to find the editable variables in the less main file |
#
'#^\s*@([\w\-]+)\s*\:\s*(.+?)\s*\;\s*//\s*editable\s*\:\s*"(.+?)"\s*\,?\s*(color|file)?\s*$#m'
|
Properties summary
public static
array
|
$nativeThemes
The themes embedded with Hawk, that are not removable |
#
array('hawk', 'dark')
|