Theme¶
- class Theme¶
Package: Record
A theme and its metadata.
Dummy model to simulate the other ActiveRecord models.
- property path¶
- property directory¶
- property image¶
- property title¶
- property description¶
- property license¶
- property website¶
- property omeka_minimum_version¶
- __construct($themeName)¶
Parameters: - $themeName (unknown) –
- setDirectoryName($dir)¶
Parameters: - $dir (unknown) –
- getScriptPath()¶
Get the physical path to the theme’s scripts.
Returns: string Physical path.
- getAssetPath()¶
Get the web path to the theme’s assets.
Returns: string Web path.
- getScriptPathForPlugin(string $pluginModuleName)¶
Get the physical path to the theme’s override scripts for the given plugin.
Parameters: - $pluginModuleName (string) – (i.e., ‘exhibit-builder’)
Returns: string Physical path.
- getAssetPathForPlugin(string $pluginModuleName)¶
Get the web path to the theme’s override assets for the given plugin.
Parameters: - $pluginModuleName (string) – (i.e., ‘exhibit-builder’)
Returns: string Web path.
- setImage($fileName)¶
Parameters: - $fileName (unknown) –
- setIni($fileName)¶
Parameters: - $fileName (unknown) –
- setConfig($fileName)¶
Parameters: - $fileName (unknown) –
- getCurrentThemeName(string $type)¶
Get the directory name of the current theme.
Parameters: - $type (string) – ‘admin’ or ‘public’, defaults to current type
Returns: string
- getAllThemes()¶
Retrieve all themes
Returns: array An array of theme objects
- getTheme(string $themeName)¶
Retrieve a theme.
Parameters: - $themeName (string) – The name of the theme.
Returns: Theme A theme object
- setOptions(string $themeName, array $themeConfigOptions)¶
Set theme configuration options.
Parameters: - $themeName (string) – The name of the theme
- $themeConfigOptions (array) – An associative array of configuration options, where each key is a configuration form input name and each value is a string value of that configuration form input
Returns: void
- getOptions(string $themeName)¶
Get theme configuration options.
Parameters: - $themeName (string) – The name of the theme
Returns: array An associative array of configuration options, where each key is a configuration form input name and each value is a string value of that configuration form input
- getOption(string $themeName, string $themeOptionName)¶
Get the value of a theme configuration option.
Parameters: - $themeName (string) – The name of the theme
- $themeOptionName (string) – The name of the theme option
Returns: string The value of the theme option
- setOption(string $themeName, string $themeOptionName, $themeOptionValue)¶
Set the value of a theme configuration option.
Parameters: - $themeName (string) – The name of the theme
- $themeOptionName (string) – The name of the theme option
- $themeOptionValue (unknown) –
Returns: void
- getOptionName(string $themeName)¶
Get the name of a specific theme’s option. Each theme has a single option in the option’s table, which stores all of the configuration options for that theme
Parameters: - $themeName (string) – The name of the theme
Returns: string The name of a specific theme’s option.
- getUploadedFileName(string $themeName, string $optionName, string $fileName)¶
Get the name of a file uploaded as a theme configuration option. This is the name of the file after it has been uploaded and renamed.
Parameters: - $themeName (string) – The name of the theme
- $optionName (string) – The name of the theme option associated with the uploaded file
- $fileName (string) – The name of the uploaded file
Returns: string The name of an uploaded file for the theme.
- _parseWebsite(string $website)¶
Parses the website string to confirm whether it has a scheme.
Parameters: - $website (string) – The website given in the theme’s INI file.
Returns: string The website URL with a prepended scheme.