ThemeManager
class ThemeManager
Theme Manager Class
Traits
Singleton trait.
Properties
static protected | $instance | from Singleton | |
protected | $themeModel | ||
array | $installedThemes | ||
array | $themes | ||
$activeTheme | |||
protected array | $paths | ||
protected | $config | ||
protected | $loadedConfig | ||
protected | $loadedCustomizerConfig | ||
protected | $booted | ||
static protected | $directories |
Methods
No description
No description
Returns a list of all themes in the system.
Loads all installed theme from application config.
Finds all available themes and loads them in to the $themes array.
Loads a single theme in to the manager.
No description
No description
No description
Checks to see if an extension has been registered.
Returns the theme domain by looking in its path.
Returns the parent theme code.
Create a Directory Map of all themes
Determines if a theme is activated by looking at the default themes config.
Determines if a theme is disabled by looking at the installed themes config.
Checks to see if a theme has been registered.
Search a theme folder for files.
No description
No description
No description
Returns a theme path based on its name.
Find a file.
Load a single theme generic file into an array. The file will be found by looking in the _layouts, _pages, _partials, _content, themes folders.
No description
Write an existing theme layout, page, partial or content file.
Rename a theme layout, page, partial or content in the file system.
Delete a theme layout, page, partial or content from the file system.
Extract uploaded/downloaded theme zip folder
Delete existing theme folder from filesystem.
No description
Read configuration from Config/Meta file
Check configuration in Config file
No description
Details
in
Singleton at line 18
final static
instance()
Create a new instance of this singleton.
in
Singleton at line 28
final static
forgetInstance()
Forget this singleton's instance if it exists
in
Singleton at line 36
final protected
__construct()
Constructor.
at line 56
initialize()
No description
in
Singleton at line 48
__clone()
No description
in
Singleton at line 53
__wakeup()
No description
at line 65
static
addDirectory($directory)
No description
at line 70
static
addAssetsFromActiveThemeManifest(Assets $manager)
No description
at line 85
static
applyAssetVariablesOnCombinerFilters(array $filters, Theme $theme = null)
No description
at line 108
array
listThemes()
Returns a list of all themes in the system.
at line 121
loadInstalled()
Loads all installed theme from application config.
at line 133
array
loadThemes()
Finds all available themes and loads them in to the $themes array.
at line 151
bool|object
loadTheme(string $themeCode, string $path)
Loads a single theme in to the manager.
at line 169
bootThemes()
No description
at line 185
getActiveTheme()
No description
at line 191
getActiveThemeCode()
No description
at line 208
Theme
findTheme($themeCode)
Returns a theme object based on its name.
at line 224
bool
hasTheme($themeCode)
Checks to see if an extension has been registered.
at line 236
string
findParent($themeCode)
Returns the theme domain by looking in its path.
at line 250
string
findParentCode($themeCode)
Returns the parent theme code.
at line 261
array
paths()
Create a Directory Map of all themes
at line 286
bool
isActive($themeCode)
Determines if a theme is activated by looking at the default themes config.
at line 302
bool
isDisabled($name)
Determines if a theme is disabled by looking at the installed themes config.
at line 316
bool
checkName($themeCode)
Checks to see if a theme has been registered.
at line 332
array
listFiles(string $themeCode, string $subFolder = null)
Search a theme folder for files.
at line 350
isLocked($themeCode)
No description
at line 355
checkParent($themeCode)
No description
at line 365
isLockedPath($path)
No description
at line 386
string|null
findPath($themeCode)
Returns a theme path based on its name.
at line 403
string|bool
findFile(string $filename, string $themeCode, string $base = null)
Find a file.
Scans for files located within themes directories. Also scans each theme directories for layouts, partials, and content. Generates fatal error if file not found.
at line 435
TemplateSource
readFile(string $filePath, string $themeCode)
Load a single theme generic file into an array. The file will be found by looking in the _layouts, _pages, _partials, _content, themes folders.
at line 447
newFile($filePath, $themeCode)
No description
at line 471
bool
writeFile(string $filePath, array $attributes, string $themeCode)
Write an existing theme layout, page, partial or content file.
at line 492
bool
renameFile(string $filePath, string $newFilePath, string $themeCode)
Rename a theme layout, page, partial or content in the file system.
at line 522
bool
deleteFile(string $filePath, string $themeCode)
Delete a theme layout, page, partial or content from the file system.
at line 545
bool
extractTheme(string $zipPath)
Extract uploaded/downloaded theme zip folder
at line 587
bool
removeTheme(null $themeCode)
Delete existing theme folder from filesystem.
at line 598
installTheme($code, $version = null)
No description
at line 619
Themes_model
createChildTheme(Themes_model $model)
No description
at line 652
array|null
getMetaFromFile(string $themeCode)
Read configuration from Config/Meta file
at line 674
getFileNameParts($path, Theme $theme)
No description
at line 695
protected array|null
validateMetaFile($config, string $path)
Check configuration in Config file
at line 714
protected
writeChildThemeMetaFile($path, $parentTheme, $themeConfig)
No description