ZenMagick 0.9.8


org.zenmagick.store.services.themes.ZMTheme
\store\services\themes\ZMTheme.php at line 31

Class ZMTheme

ZMObject
└─ZMTheme

public class ZMTheme
extends ZMObject

A theme.

Author:
DerManoMann
Version:
$Id: ZMTheme.php 2694 2009-12-03 22:32:18Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMTheme(mixed themeId)

Create new instance.

Method Summary
string

getBoxesDir()

Return the path of the boxes directory.

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

getRootDir()

Return the full filename for the themes root directory.

array

getStaticPageList(boolean includeDefaults, int languageId)

Get a list of available static pages.

string

getThemeId()

Get this themes id.

ZMThemeInfo

getThemeInfo()

Get the ZMThemeInfo for this theme.

string

getViewsDir()

Return the path of the views directory.

boolean

hasLayout(string page)

Check if a layout is configured for the given page.

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.

string

staticPageContent(string page, int languageId, boolean echo)

Get the content of a static (define) page.

string

themeFile(string name, string baseDir, boolean echo)

Resolve a theme relative filename into a full path.

string

themeFileContents(string file)

Load and eval a theme file.

boolean

themeFileExists(string name, string baseDir)

Check if the given theme relative file exists.

string

themeURL(string uri, boolean echo)

Resolve a theme relative URI.

string

zcStaticPageContent(string page, int languageId, boolean echo)

Get the content of a static (define) page using the zen-cart location.

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

Constructor Detail

\store\services\themes\ZMTheme.php at line 41

ZMTheme

public ZMTheme(mixed themeId)

Create new instance.

Params:
string themeId The theme id/name.

Method Detail

\store\services\themes\ZMTheme.php at line 123

getBoxesDir

public string getBoxesDir()

Return the path of the boxes directory.

Returns:
A full filename denoting the themes boxes directory.

\store\services\themes\ZMTheme.php at line 132

getContentDir

public string getContentDir()

Return the path of the content directory.

Returns:
A full filename denoting the themes content directory.

\store\services\themes\ZMTheme.php at line 114

getExtraDir

public string getExtraDir()

Return the path of the extra directory.

Returns:
A full filename denoting the themes extra directory.

\store\services\themes\ZMTheme.php at line 150

getLangDir

public string getLangDir()

Return the path of the lang directory.

Returns:
A full filename denoting the themes lang directory.

\store\services\themes\ZMTheme.php at line 105

getRootDir

public string getRootDir()

Return the full filename for the themes root directory.

Returns:
The themes root directory.

\store\services\themes\ZMTheme.php at line 197

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 - Optional language id; default is null for current language.
Returns:
List of available static page names.

\store\services\themes\ZMTheme.php at line 60

getThemeId

public string getThemeId()

Get this themes id.

Returns:
The theme id.

\store\services\themes\ZMTheme.php at line 365

getThemeInfo

public ZMThemeInfo getThemeInfo()

Get the ZMThemeInfo for this theme.

Returns:
A ZMThemeInfo instance.

\store\services\themes\ZMTheme.php at line 141

getViewsDir

public string getViewsDir()

Return the path of the views directory.

Returns:
A full filename denoting the themes views directory.

\store\services\themes\ZMTheme.php at line 68

hasLayout

public boolean hasLayout(string page)

Check if a layout is configured for the given page.

Parameters:
page - The page name.
Returns:
true if a layout file is configured for the given page.

\store\services\themes\ZMTheme.php at line 385

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.

\store\services\themes\ZMTheme.php at line 245

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 - Optional language id; default is null for current language.
Returns:
The status.

\store\services\themes\ZMTheme.php at line 284

staticPageContent

public string staticPageContent(string page, int languageId, boolean echo)

Get the content of a static (define) page.

If the file is not found and isEnableThemeDefaults is set to true, the method will try to resolve the name in the default theme.

Parameters:
page - The page name.
languageId - Optional language id; default is null for current language.
echo - If true, the URL will be echo'ed as well as returned.
Returns:
The content or null.

\store\services\themes\ZMTheme.php at line 165

themeFile

public string themeFile(string name, string baseDir, boolean echo)

Resolve a theme relative filename into a full path.

If the file is not found and isEnableThemeDefaults is set to true, the method will try to resolve the name in the default theme.

Parameters:
name - A theme relative filename.
baseDir - An optional base directory; default is content/
echo - If true, the URL will be echo'ed as well as returned.
Returns:
A fully qualified filename.

\store\services\themes\ZMTheme.php at line 355

themeFileContents

public string themeFileContents(string file)

Load and eval a theme file.

This allows to use PHP code in, for example, JavaScript files. One side-effect is that the evaluated content is inline'ed rather than loaded from a separate file. That means it's more usefule for small snippets rather than large files

Parameters:
file - The filename.
Returns:
The eval'ed content.

\store\services\themes\ZMTheme.php at line 186

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.

\store\services\themes\ZMTheme.php at line 85

themeURL

public string themeURL(string uri, boolean echo)

Resolve a theme relative URI.

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

If the file is not found and isEnableThemeDefaults is set to true, the method will try to resolve the name in the default theme.

Parameters:
uri - The relative URI.
echo - If true, the URL will be echo'ed as well as returned.
Returns:
An absolute URL.

\store\services\themes\ZMTheme.php at line 323

zcStaticPageContent

public string zcStaticPageContent(string page, int languageId, boolean echo)

Get the content of a static (define) page using the zen-cart location.

If the file is not found and isEnableThemeDefaults is set to true, the method will try to resolve the name in the default theme.

Parameters:
page - The page name.
languageId - Optional language id; default is null for current language.
echo - If true, the URL will be echo'ed as well as returned.
Returns:
The content or null.

ZenMagick 0.9.8