class Theme extends ConcreteObject (View source)

A page's theme is a pointer to a directory containing templates, CSS files and optionally PHP includes, images and JavaScript files.

Themes inherit down the tree when a page is added, but can also be set at the site-wide level (thereby overriding any previous choices.).

Constants

E_THEME_INSTALLED

THEME_EXTENSION

THEME_CUSTOMIZABLE_STYLESHEET_EXTENSION

FILENAME_TYPOGRAPHY_CSS

Properties

$error from ConcreteObject
protected $pThemeName
protected $pThemeID
protected $pThemeDescription
protected $pThemeDirectory
protected $pThemeThumbnail
protected $pThemeHandle
protected $pThemeURL
protected $pThemeIsPreview
protected $pkgID
protected $stylesheetCachePath
protected $stylesheetCacheRelativePath
protected $pThemeGridFrameworkHandle Special items meant to be extended by custom theme classes.

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

__construct()

No description

static 
getGlobalList()

No description

static 
getLocalList()

No description

static 
getListByPackage($pkg)

No description

static 
getList($where = null)

No description

static 
getInstalledHandles()

No description

providesAsset($assetType, $assetHandle = null)

No description

requireAsset()

No description

static Theme[]
getAvailableThemes(bool $filterInstalled = true)

scans the directory for available themes. For those who don't want to go through the hassle of uploading.

static 
getByFileHandle($handle, $dir = DIR_FILES_THEMES, $pkgHandle = '')

No description

bool
isThemeCustomizable()

Checks the theme for a styles.xml file (which is how customizations happen.).

getThemeCustomizableStyleList()

Gets the style list object for this theme.

getThemeCustomizablePreset($handle)

Gets a preset for this theme by handle.

getThemeCustomizableStylePresets()

Gets all presets available to this theme.

enablePreviewRequest()

No description

resetThemeCustomStyles()

No description

isThemePreviewRequest()

No description

getStylesheetObject($stylesheet)

No description

string
getStylesheet(string $stylesheet)

Looks into the current CSS directory and returns a fully compiled stylesheet when passed a LESS stylesheet. Also serves up custom value list values for the stylesheet if they exist.

getThemeCustomStyleObject()

Returns a Custom Style Object for the theme if one exists.

ValueList
getThemeCustomStyleObjectValues()

Returns the value list of the custom style object if one exists.

setCustomStyleObject(ValueList $valueList, $selectedPreset = false, CustomCssRecord $customCssRecord = null)

No description

static PageTheme
getByHandle(string $pThemeHandle)

No description

static PageTheme
getByID($pThemeID)

No description

static Theme|null
populateThemeQuery(string $where, array $args)

No description

static 
add($pThemeHandle, $pkg = null)

No description

getFilesInTheme()

No description

static 
getThemeNameAndDescription($dir, $pThemeHandle, $pkgHandle = '')

No description

export($node)

No description

static 
exportList($xml)

No description

static 
install($dir, $pThemeHandle, $pkgID)

No description

updateThemeCustomClass()

No description

getThemeID()

No description

getThemeName()

No description

string
getThemeDisplayName(string $format = 'html')

Returns the display name for this theme (localized and escaped accordingly to $format)

getPackageID()

No description

getPackageHandle()

No description

hasCustomClass()

Returns whether a theme has a custom class.

getThemeHandle()

No description

getThemeDescription()

No description

getThemeDisplayDescription($format = 'html')

No description

getThemeDirectory()

No description

getThemeURL()

No description

getThemeEditorCSS()

No description

setThemeURL($pThemeURL)

No description

setThemeDirectory($pThemeDirectory)

No description

setThemeHandle($pThemeHandle)

No description

setStylesheetCachePath($path)

No description

setStylesheetCacheRelativePath($path)

No description

getStylesheetCachePath()

No description

isUninstallable()

No description

getThemeThumbnail()

No description

applyToSite(Site $site = null)

No description

static Theme
getSiteTheme()

No description

uninstall()

No description

registerAssets()

No description

supportsGridFramework()

No description

getThemeBlockClasses()

No description

getThemeAreaClasses()

No description

getThemeEditorClasses()

No description

getThemeResponsiveImageMap()

No description

Details

loadError($error)

Parameters

$error

isError()

getError()

setPropertiesFromArray($arr)

Parameters

$arr

static camelcase($file)

Parameters

$file

static uncamelcase($string)

Parameters

$string

__construct()

static getGlobalList()

static getLocalList()

static getListByPackage($pkg)

Parameters

$pkg

static getList($where = null)

Parameters

$where

static getInstalledHandles()

providesAsset($assetType, $assetHandle = null)

Parameters

$assetType
$assetHandle

requireAsset()

static Theme[] getAvailableThemes(bool $filterInstalled = true)

scans the directory for available themes. For those who don't want to go through the hassle of uploading.

Parameters

bool $filterInstalled

Return Value

Theme[]

static getByFileHandle($handle, $dir = DIR_FILES_THEMES, $pkgHandle = '')

Parameters

$handle
$dir
$pkgHandle

bool isThemeCustomizable()

Checks the theme for a styles.xml file (which is how customizations happen.).

Return Value

bool

StyleList getThemeCustomizableStyleList()

Gets the style list object for this theme.

Return Value

StyleList

getThemeCustomizablePreset($handle)

Gets a preset for this theme by handle.

Parameters

$handle

getThemeCustomizableStylePresets()

Gets all presets available to this theme.

enablePreviewRequest()

resetThemeCustomStyles()

isThemePreviewRequest()

getThemeCustomizableStyleSheets()

getStylesheetObject($stylesheet)

Parameters

$stylesheet

string getStylesheet(string $stylesheet)

Looks into the current CSS directory and returns a fully compiled stylesheet when passed a LESS stylesheet. Also serves up custom value list values for the stylesheet if they exist.

Parameters

string $stylesheet The LESS stylesheet to compile

Return Value

string The path to the stylesheet

getThemeCustomStyleObject()

Returns a Custom Style Object for the theme if one exists.

ValueList getThemeCustomStyleObjectValues()

Returns the value list of the custom style object if one exists.

Return Value

ValueList

setCustomStyleObject(ValueList $valueList, $selectedPreset = false, CustomCssRecord $customCssRecord = null)

Parameters

ValueList $valueList
$selectedPreset
CustomCssRecord $customCssRecord

static PageTheme getByHandle(string $pThemeHandle)

Parameters

string $pThemeHandle

Return Value

PageTheme

static PageTheme getByID($pThemeID)

Parameters

$pThemeID

Return Value

PageTheme

static protected Theme|null populateThemeQuery(string $where, array $args)

Parameters

string $where
array $args

Return Value

Theme|null

static add($pThemeHandle, $pkg = null)

Parameters

$pThemeHandle
$pkg

getFilesInTheme()

static private getThemeNameAndDescription($dir, $pThemeHandle, $pkgHandle = '')

Parameters

$dir
$pThemeHandle
$pkgHandle

export($node)

Parameters

$node

static exportList($xml)

Parameters

$xml

static protected install($dir, $pThemeHandle, $pkgID)

Parameters

$dir
$pThemeHandle
$pkgID

updateThemeCustomClass()

getThemeID()

getThemeName()

string getThemeDisplayName(string $format = 'html')

Returns the display name for this theme (localized and escaped accordingly to $format)

Parameters

string $format = 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped

Return Value

string

getPackageID()

getPackageHandle()

hasCustomClass()

Returns whether a theme has a custom class.

getThemeHandle()

getThemeDescription()

getThemeDisplayDescription($format = 'html')

Parameters

$format

getThemeDirectory()

getThemeURL()

getThemeEditorCSS()

setThemeURL($pThemeURL)

Parameters

$pThemeURL

setThemeDirectory($pThemeDirectory)

Parameters

$pThemeDirectory

setThemeHandle($pThemeHandle)

Parameters

$pThemeHandle

setStylesheetCachePath($path)

Parameters

$path

setStylesheetCacheRelativePath($path)

Parameters

$path

getStylesheetCachePath()

getStylesheetCacheRelativePath()

isUninstallable()

getThemeThumbnail()

applyToSite(Site $site = null)

Parameters

Site $site

static Theme getSiteTheme()

Return Value

Theme

uninstall()

registerAssets()

supportsGridFramework()

GridFramework|null getThemeGridFrameworkObject()

Return Value

GridFramework|null

getThemeBlockClasses()

getThemeAreaClasses()

getThemeEditorClasses()

getThemeDefaultBlockTemplates()

getThemeResponsiveImageMap()

getThemeGatheringGridItemMargin()

getThemeGatheringGridItemWidth()

getThemeGatheringGridItemHeight()