ZenMagick 0.9.1


org.zenmagick.service.ZMThemes

Class ZMThemes

ZMObject
|
+--ZMThemes

public class ZMThemes
extends ZMObject

Themes.

Author:
mano
Version:
$Id: ZMThemes.php 1061 2008-04-21 23:31:35Z DerManoMann $

Constructor Summary

ZMThemes()

Create new instance.

Method Summary
private array

getThemeDirList()

Generate a list of all theme directories.

ZMTheme

getThemeForId(string themeId)

Get ZMTheme instance for the given theme Id.

ZMThemeInfo

getThemeInfoForId(string themeId)

Get ZMThemeInfo instance for the current (or given) theme Id.

array

getThemeInfoList()

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)

Resolve theme incl.

void

updateZCThemeId(string themeId, int languageId)

Update the configured zen-cart theme id.

Methods inherited from org.zenmagick.ZMObject
backtrace, create, log, singleton

Constructor Detail

ZMThemes

public ZMThemes()

Create new instance. /


Method Detail

getThemeDirList

private array getThemeDirList()

Generate a list of all theme directories.

Returns:
List of all directories under themes that contain a theme.

getThemeForId

public ZMTheme getThemeForId(string themeId)

Get ZMTheme instance for the given theme Id.

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

getThemeInfoForId

public ZMThemeInfo getThemeInfoForId(string themeId)

Get ZMThemeInfo instance for the current (or given) theme Id.

Parameters:
themeId - The theme id or null for the current theme id.
Returns:
The themes ZMThemeInfo implementation or null.

getThemeInfoList

public array getThemeInfoList()

Get a list of all available themes.

Returns:
A list of ZMThemeInfo instances.

getZCThemeId

public string getZCThemeId(int languageId)

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

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

instance

public static void instance()

Get instance. /


resolveTheme

public ZMTheme resolveTheme(string themeId)

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; default is ZM_DEFAULT_THEME.
Returns:
The final theme.

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.1