class Theme (View source)

handles theme

add the possibility to make a theme depend on another theme and by default on original make all components optional - get missing components from 'parent' theme

Properties

string $version
string $name
string $id
string $path
string $imgPath
string $imgPathFs
int $mtimeInfo
int $filesizeInfo

needed because sometimes, the mtime for different themes is identical

Methods

bool
loadInfo()

Loads theme information

static self|null
load(string $themeUrl, string $themeFsPath, string $themeName)

No description

bool
checkImgPath()

checks image path for existence - if not found use img from fallback theme

string
getPath()

returns path to theme

string
getFsPath()

returns file system path to the theme

void
setPath(string $path)

set path to theme

void
setFsPath(string $path)

set file system path to the theme

void
setVersion(string $version)

sets version

string
getVersion()

returns version

bool
checkVersion(string $version)

checks theme version against $version returns true if theme version is equal or higher to $version

void
setName(string $name)

sets name

string
getName()

returns name

void
setId(string $id)

sets id

string
getId()

returns id

void
setImgPath(string $path)

Sets path to images for the theme

void
setImgPathFs(string $path)

Sets path to images for the theme

string
getImgPath(string|null $file = null, string|null $fallback = null)

Returns the path to image for the theme.

array
getColorModes()

No description

void
setColorMode(string $colorMode)

No description

string
getColorMode()

No description

Details

bool loadInfo()

Loads theme information

Return Value

bool

static self|null load(string $themeUrl, string $themeFsPath, string $themeName)

No description

Parameters

string $themeUrl
string $themeFsPath
string $themeName

Return Value

self|null

bool checkImgPath()

checks image path for existence - if not found use img from fallback theme

Return Value

bool

string getPath()

returns path to theme

Return Value

string

path to theme

string getFsPath()

returns file system path to the theme

Return Value

string

file system path to theme

void setPath(string $path)

set path to theme

Parameters

string $path

path to theme

Return Value

void

void setFsPath(string $path)

set file system path to the theme

Parameters

string $path

path to theme

Return Value

void

void setVersion(string $version)

sets version

Parameters

string $version

version to set

Return Value

void

string getVersion()

returns version

Return Value

string version

bool checkVersion(string $version)

checks theme version against $version returns true if theme version is equal or higher to $version

Parameters

string $version

version to compare to

Return Value

bool

void setName(string $name)

sets name

Parameters

string $name

name to set

Return Value

void

string getName()

returns name

Return Value

string name

void setId(string $id)

sets id

Parameters

string $id

new id

Return Value

void

string getId()

returns id

Return Value

string id

void setImgPath(string $path)

Sets path to images for the theme

Parameters

string $path

path to images for this theme as an URL path

Return Value

void

void setImgPathFs(string $path)

Sets path to images for the theme

Parameters

string $path

file-system path to images for this theme

Return Value

void

string getImgPath(string|null $file = null, string|null $fallback = null)

Returns the path to image for the theme.

If filename is given, it possibly fallbacks to fallback theme for it if image does not exist.

Parameters

string|null $file

file name for image

string|null $fallback

fallback image

Return Value

string

image path for this theme

array getColorModes()

No description

Return Value

array

void setColorMode(string $colorMode)

No description

Parameters

string $colorMode

Return Value

void

string getColorMode()

No description

Return Value

string