ZMObject
└─ZMTheme
public class ZMTheme
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
ZMTheme(mixed themeId) Create new instance. |
|
| Method Summary | |
|---|---|
| string | Return the path of the boxes directory. |
| string | Return the path of the content directory. |
| string | Return the path of the extra directory. |
| string | Return the path of the lang directory. |
| string | Return the full filename for the themes root directory. |
| array | getStaticPageList(boolean includeDefaults, int languageId) Get a list of available static pages. |
| string | Get this themes id. |
| ZMThemeInfo | Get the ZMThemeInfo for this theme. |
| string | 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 | |
public ZMTheme(mixed themeId)
Create new instance.
public string getBoxesDir()
Return the path of the boxes directory.
public string getContentDir()
Return the path of the content directory.
public string getExtraDir()
Return the path of the extra directory.
public string getLangDir()
Return the path of the lang directory.
public string getRootDir()
Return the full filename for the themes root directory.
public array getStaticPageList(boolean includeDefaults, int languageId)
Get a list of available static pages.
true, default pages will be included; default is false.null for current language.public string getThemeId()
Get this themes id.
public ZMThemeInfo getThemeInfo()
Get the ZMThemeInfo for this theme.
ZMThemeInfo instance.public string getViewsDir()
Return the path of the views directory.
public boolean hasLayout(string page)
Check if a layout is configured for the given page.
true if a layout file is configured for the given page.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.
public boolean saveStaticPageContent(string page, string contents, int languageId)
Write the content of a static (define) page.
null for current language.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.
null for current language.true, the URL will be echo'ed as well as returned.null.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.
content/true, the URL will be echo'ed as well as returned.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
public boolean themeFileExists(string name, string baseDir)
Check if the given theme relative file exists.
content/true if the file exists, false if not.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.
true, the URL will be echo'ed as well as returned.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.
null for current language.true, the URL will be echo'ed as well as returned.null.
A theme.