class Theme extends Object (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  Object
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

from  Object
isError()

No description

from  Object
getError()

No description

from  Object
setPropertiesFromArray($arr)

No description

from  Object
static 
camelcase($file)

No description

from  Object
static 
uncamelcase($string)

No description

from  Object
__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)

No description

Parameters

$error

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

Parameters

$arr

static camelcase($file)

No description

Parameters

$file

static uncamelcase($string)

No description

Parameters

$string

__construct()

No description

static getGlobalList()

No description

static getLocalList()

No description

static getListByPackage($pkg)

No description

Parameters

$pkg

static getList($where = null)

No description

Parameters

$where

static getInstalledHandles()

No description

providesAsset($assetType, $assetHandle = null)

No description

Parameters

$assetType
$assetHandle

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.

Parameters

bool $filterInstalled

Return Value

Theme[]

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

No description

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()

No description

resetThemeCustomStyles()

No description

isThemePreviewRequest()

No description

getThemeCustomizableStyleSheets()

No description

getStylesheetObject($stylesheet)

No description

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)

No description

Parameters

ValueList $valueList
$selectedPreset
CustomCssRecord $customCssRecord

static PageTheme getByHandle(string $pThemeHandle)

No description

Parameters

string $pThemeHandle

Return Value

PageTheme

static PageTheme getByID($pThemeID)

No description

Parameters

$pThemeID

Return Value

PageTheme

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

No description

Parameters

string $where
array $args

Return Value

Theme|null

static add($pThemeHandle, $pkg = null)

No description

Parameters

$pThemeHandle
$pkg

getFilesInTheme()

No description

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

No description

Parameters

$dir
$pThemeHandle
$pkgHandle

export($node)

No description

Parameters

$node

static exportList($xml)

No description

Parameters

$xml

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

No description

Parameters

$dir
$pThemeHandle
$pkgID

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)

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()

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

Parameters

$format

getThemeDirectory()

No description

getThemeURL()

No description

getThemeEditorCSS()

No description

setThemeURL($pThemeURL)

No description

Parameters

$pThemeURL

setThemeDirectory($pThemeDirectory)

No description

Parameters

$pThemeDirectory

setThemeHandle($pThemeHandle)

No description

Parameters

$pThemeHandle

setStylesheetCachePath($path)

No description

Parameters

$path

setStylesheetCacheRelativePath($path)

No description

Parameters

$path

getStylesheetCachePath()

No description

getStylesheetCacheRelativePath()

No description

isUninstallable()

No description

getThemeThumbnail()

No description

applyToSite(Site $site = null)

No description

Parameters

Site $site

static Theme getSiteTheme()

No description

Return Value

Theme

uninstall()

No description

registerAssets()

No description

supportsGridFramework()

No description

GridFramework|null getThemeGridFrameworkObject()

No description

Return Value

GridFramework|null

getThemeBlockClasses()

No description

getThemeAreaClasses()

No description

getThemeEditorClasses()

No description

getThemeDefaultBlockTemplates()

No description

getThemeResponsiveImageMap()

No description

getThemeGatheringGridItemMargin()

No description

getThemeGatheringGridItemWidth()

No description

getThemeGatheringGridItemHeight()

No description