ZenMagick 0.9.10


zenmagick.store.shared.services.themes\ZMThemes
services\themes\ZMThemes.php at line 29

Class ZMThemes

ZMObject
└─ZMThemes

public class ZMThemes
extends ZMObject

Themes.

Author:
DerManoMann

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

__construct()

Create new instance.

ZMTheme

getThemeForId(string themeId)

Get ZMTheme instance for the given theme Id.

array

getThemes()

Get a list of all available themes.

string

getZCThemeId(int languageId)

Get the configured zen-cart theme id (aka the template directory name).

static void

instance()

Get instance.

ZMTheme

resolveTheme(string themeId, ZMLanguage language)

Resolve theme incl.

void

updateZCThemeId(string themeId, int languageId)

Update the configured zen-cart theme id.

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

Method Detail

services\themes\ZMThemes.php at line 34

__construct

public void __construct()

Create new instance.


services\themes\ZMThemes.php at line 78

getThemeForId

public ZMTheme getThemeForId(string themeId)

Get ZMTheme instance for the given theme Id.

Parameters:
themeId - The theme id.
Returns:
ZMTheme instance or null.

services\themes\ZMThemes.php at line 58

getThemes

public array getThemes()

Get a list of all available themes.

Returns:
A list of ZMTheme instances.

services\themes\ZMThemes.php at line 107

getZCThemeId

public string getZCThemeId(int languageId)

Get the configured zen-cart theme id (aka the template directory name).

Parameters:
languageId - Language id.
Returns:
The configured zen-cart theme id.

services\themes\ZMThemes.php at line 48

instance

public static void instance()

Get instance.


services\themes\ZMThemes.php at line 173

resolveTheme

public ZMTheme resolveTheme(string themeId, ZMLanguage language)

Resolve theme incl. loader update, theme switching and all theme default handling.

This is the method in the ZenMagick theme handling. It will:

  1. Configure the theme loader to add theme specific code (controller) to the classpath
  2. Init l10n/i18n
  3. Load the theme specific extra code
  4. Check for theme switching and repeat the process if needed

Passing default theme id rather than the current theme id is equivalent to enabling default theme fallback. Coincidentally, this is also the default behaviour.

Parameters:
themeId - The themeId to start with.
language - The language.
Returns:
The final theme.

services\themes\ZMThemes.php at line 132

updateZCThemeId

public void updateZCThemeId(string themeId, int languageId)

Update the configured zen-cart theme id.

Parameters:
themeId - The theme id.
languageId - Optional language id; default is 0 for all.

ZenMagick 0.9.10