ZMObject
└─ZMToolboxTool
└─ZMToolboxUtils
public class ZMToolboxUtils
extends ZMToolboxTool
| Fields inherited from org.zenmagick.mvc.toolbox\ZMToolboxTool | |
|---|---|
| request_, toolbox_ | |
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | cssFile(string filename, array attr) Add the given CSS file to the final contents. |
| string | encodeXML(string s) Encode XML control characters. |
| string | formatMoney(float amount, boolean convert) Format the given amount according to the current currency. |
| string | getTitle(string page) Simple title generator based on the page name. |
| boolean | isFreeShipping(ZMShoppingCart shoppingCart) Check if the given shopping cart qualifies for free shipping (as per free shipping ot). |
| void | jsBottom(string filename) Add the given JS file to the end of the final contents (before the closing element). |
| void | jsNow(string filename) Add the given JS file now. |
| void | jsTop(string filename) Add the given JS file to the header section of the final contents. |
| string | staticPageContent(string pageName) Get the content of a static (define) page. |
| Methods inherited from org.zenmagick.mvc.toolbox\ZMToolboxTool | |
|---|---|
| __construct, getRequest, getToolbox, setRequest, setToolbox | |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public void cssFile(string filename, array attr)
Add the given CSS file to the final contents.
The underlying code (ZMTemplateManager) will ensure that each CSS file is included once only.
public string encodeXML(string s)
Encode XML control characters.
public string formatMoney(float amount, boolean convert)
Format the given amount according to the current currency.
true, consider $amount to be in default currency and convert before formatting.public string getTitle(string page)
Simple title generator based on the page name.
null for the current page.public boolean isFreeShipping(ZMShoppingCart shoppingCart)
Check if the given shopping cart qualifies for free shipping (as per free shipping ot).
true if this cart qualifies for free shipping.public void jsBottom(string filename)
Add the given JS file to the end of the final contents (before the closing
element).The underlying code (ZMTemplateManager) will ensure that each JS file is included once only.
Also, if the same JS file is requested for both top and bottom, it will be included at the
top only. The same applies to calling jsNow() on a file that has been already included or is marked for
inclusion at the bottom.
public void jsNow(string filename)
Add the given JS file now.
public void jsTop(string filename)
Add the given JS file to the header section of the final contents.
The underlying code (ZMTemplateManager) will ensure that each JS file is included once only.
public string staticPageContent(string pageName)
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.
Generic utilities.