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 |
Methods
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 53
initialize()
No description
in
Singleton at line 48
__clone()
No description
in
Singleton at line 53
__wakeup()
No description
at line 62
static
addAssetsFromActiveThemeManifest(Assets $manager)
No description
at line 77
static
applyAssetVariablesOnCombinerFilters(array $filters, Theme $theme = null)
No description
at line 100
array
listThemes()
Returns a list of all themes in the system.
at line 113
loadInstalled()
Loads all installed theme from application config.
at line 125
array
loadThemes()
Finds all available themes and loads them in to the $themes array.
at line 143
bool|object
loadTheme(string $themeCode, string $path)
Loads a single theme in to the manager.
at line 162
bootThemes()
No description
at line 178
getActiveTheme()
No description
at line 184
getActiveThemeCode()
No description
at line 201
Theme
findTheme($themeCode)
Returns a theme object based on its name.
at line 217
bool
hasTheme($themeCode)
Checks to see if an extension has been registered.
at line 229
string
findParent($themeCode)
Returns the theme domain by looking in its path.
at line 243
string
findParentCode($themeCode)
Returns the parent theme code.
at line 254
array
paths()
Create a Directory Map of all themes
at line 272
bool
isActive($themeCode)
Determines if a theme is activated by looking at the default themes config.
at line 288
bool
isDisabled($name)
Determines if a theme is disabled by looking at the installed themes config.
at line 302
bool
checkName($themeCode)
Checks to see if a theme has been registered.
at line 318
array
listFiles(string $themeCode, string $subFolder = null)
Search a theme folder for files.
at line 336
isLocked($themeCode)
No description
at line 341
checkParent($themeCode)
No description
at line 351
isLockedPath($path)
No description
at line 372
string|null
findPath($themeCode)
Returns a theme path based on its name.
at line 389
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 421
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 433
newFile($filePath, $themeCode)
No description
at line 457
bool
writeFile(string $filePath, array $attributes, string $themeCode)
Write an existing theme layout, page, partial or content file.
at line 478
bool
renameFile(string $filePath, string $newFilePath, string $themeCode)
Rename a theme layout, page, partial or content in the file system.
at line 508
bool
deleteFile(string $filePath, string $themeCode)
Delete a theme layout, page, partial or content from the file system.
at line 531
bool
extractTheme(string $zipPath)
Extract uploaded/downloaded theme zip folder
at line 573
bool
removeTheme(null $themeCode)
Delete existing theme folder from filesystem.
at line 584
installTheme($code, $version = null)
No description
at line 605
Themes_model
createChildTheme(Themes_model $model)
No description
at line 641
array|null
getMetaFromFile(string $themeCode)
Read configuration from Config/Meta file
at line 655
getFileNameParts($path, Theme $theme)
No description
at line 676
protected array|null
validateMetaFile(string $path, $themeCode)
Check configuration in Config file
at line 700
protected string
writeChildThemeMetaFile($path, $parentTheme, $themeConfig)
No description