ZenMagick 0.9.11


zenmagick.store.shared.services.themes\ZMTheme
services\themes\ZMTheme.php at line 30

Class ZMTheme

ZMObject
└─ZMTheme

public class ZMTheme
extends ZMObject

A theme.

Author:
DerManoMann

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct(mixed themeId, array properties)

Create new instance.

string

getBaseDir()

Return the full filename for the themes base directory.

string

getBoxesDir()

Return the path of the boxes directory.

mixed

getConfig(string key)

Get theme config.

string

getContentDir()

Return the path of the content directory.

string

getExtraDir()

Return the path of the extra directory.

string

getLangDir()

Return the path of the lang directory.

string

getName()

Set theme name.

array

getStaticPageList(boolean includeDefaults, int languageId)

Get a list of available static pages.

string

getThemeId()

Get this themes id.

string

getViewsDir()

Return the path of the views directory.

void

loadLocale(ZMLanguage language)

Load locale settings (l10n/i18n).

boolean

saveStaticPageContent(string page, string contents, int languageId)

Write the content of a static (define) page.

void

setConfig(array config)

Set full theme config.

void

setConfigValue(mixed key, mixed value)

Set theme config value.

string

staticPageContent(string page, int languageId)

Get the content of a static (define) page.

string

themeFile(string name, string baseDir)

Resolve a theme relative filename into a full path.

boolean

themeFileExists(string name, string baseDir)

Check if the given theme relative file exists.

string

themeURL(string uri)

Resolve a theme relative URI.

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set

Method Detail

services\themes\ZMTheme.php at line 40

__construct

public void __construct(mixed themeId, array properties)

Create new instance.

Params:
string themeId The theme id/name.
Parameters:
properties - Optional properties; default is an empty array;

services\themes\ZMTheme.php at line 85

getBaseDir

public string getBaseDir()

Return the full filename for the themes base directory.

Returns:
The theme base directory.

services\themes\ZMTheme.php at line 174

getBoxesDir

public string getBoxesDir()

Return the path of the boxes directory.

Returns:
A full filename denoting the themes boxes directory.

services\themes\ZMTheme.php at line 95

getConfig

public mixed getConfig(string key)

Get theme config.

Parameters:
key - Optional config key; default is null to return the full map.
Returns:
Theme config map, the value of a specific key or null for unknown keys.

services\themes\ZMTheme.php at line 183

getContentDir

public string getContentDir()

Return the path of the content directory.

Returns:
A full filename denoting the themes content directory.

services\themes\ZMTheme.php at line 165

getExtraDir

public string getExtraDir()

Return the path of the extra directory.

Returns:
A full filename denoting the themes extra directory.

services\themes\ZMTheme.php at line 201

getLangDir

public string getLangDir()

Return the path of the lang directory.

Returns:
A full filename denoting the themes lang directory.

services\themes\ZMTheme.php at line 112

getName

public string getName()

Set theme name.

Returns:
The name.

services\themes\ZMTheme.php at line 243

getStaticPageList

public array getStaticPageList(boolean includeDefaults, int languageId)

Get a list of available static pages.

Parameters:
includeDefaults - If set to true, default pages will be included; default is false.
languageId - Language id.
Returns:
List of available static page names.

services\themes\ZMTheme.php at line 76

getThemeId

public string getThemeId()

Get this themes id.

Returns:
The theme id.

services\themes\ZMTheme.php at line 192

getViewsDir

public string getViewsDir()

Return the path of the views directory.

Returns:
A full filename denoting the themes views directory.

services\themes\ZMTheme.php at line 348

loadLocale

public void loadLocale(ZMLanguage language)

Load locale settings (l10n/i18n).

NOTE: This is only going to load mappings. However, since i18n settings need to be set using define(..), this is done in a separate function, once loading (and theme switching) is over.

Parameters:
language - The language.

services\themes\ZMTheme.php at line 286

saveStaticPageContent

public boolean saveStaticPageContent(string page, string contents, int languageId)

Write the content of a static (define) page.

Parameters:
page - The page name.
contents - The contents.
languageId - Language id.
Returns:
The status.

services\themes\ZMTheme.php at line 121

setConfig

public void setConfig(array config)

Set full theme config.

Parameters:
config - The new config map.

services\themes\ZMTheme.php at line 131

setConfigValue

public void setConfigValue(mixed key, mixed value)

Set theme config value.

Parameters:
key - The config key or an array to set all.
value - The value.

services\themes\ZMTheme.php at line 316

staticPageContent

public string staticPageContent(string page, int languageId)

Get the content of a static (define) page.

Parameters:
page - The page name.
languageId - Language id.
Returns:
The content or null.

services\themes\ZMTheme.php at line 212

themeFile

public string themeFile(string name, string baseDir)

Resolve a theme relative filename into a full path.

Parameters:
name - A theme relative filename.
baseDir - An optional base directory; default is content/
Returns:
A fully qualified filename.

services\themes\ZMTheme.php at line 232

themeFileExists

public boolean themeFileExists(string name, string baseDir)

Check if the given theme relative file exists.

Parameters:
name - A theme relative filename.
baseDir - An optional base directory; default is content/
Returns:
true if the file exists, false if not.

services\themes\ZMTheme.php at line 148

themeURL

public string themeURL(string uri)

Resolve a theme relative URI.

The given uri is assumed to be relative to the themes content folder.

Parameters:
uri - The relative URI.
Returns:
An absolute URL.
Deprecated.

ZenMagick 0.9.11