ZenMagick 0.9.10


zenmagick.store.shared.mvc.tools\ZMToolboxUtils
mvc\toolbox\ZMToolboxUtils.php at line 33

Class ZMToolboxUtils

ZMObject
└─ZMToolboxTool
└─ZMToolboxUtils

public class ZMToolboxUtils
extends ZMToolboxTool

Generic utilities.

Author:
DerManoMann

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

Method Detail

mvc\toolbox\ZMToolboxUtils.php at line 92

cssFile

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.

Parameters:
filename - A relative CSS filename.
attr - Optional attribute map.

mvc\toolbox\ZMToolboxUtils.php at line 61

encodeXML

public string encodeXML(string s)

Encode XML control characters.

Parameters:
s - The input string.
Returns:
The encoded string.

mvc\toolbox\ZMToolboxUtils.php at line 73

formatMoney

public string formatMoney(float amount, boolean convert)

Format the given amount according to the current currency.

Parameters:
amount - The amount.
convert - If true, consider $amount to be in default currency and convert before formatting.
Returns:
The formatted amount.

mvc\toolbox\ZMToolboxUtils.php at line 41

getTitle

public string getTitle(string page)

Simple title generator based on the page name.

Parameters:
page - The page name; default is null for the current page.
Returns:
A reasonable page title.

mvc\toolbox\ZMToolboxUtils.php at line 136

isFreeShipping

public boolean isFreeShipping(ZMShoppingCart shoppingCart)

Check if the given shopping cart qualifies for free shipping (as per free shipping ot).

Parameters:
shoppingCart - The cart to examine.
Returns:
true if this cart qualifies for free shipping.

mvc\toolbox\ZMToolboxUtils.php at line 117

jsBottom

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.

Parameters:
filename - A relative JavaScript filename.

mvc\toolbox\ZMToolboxUtils.php at line 126

jsNow

public void jsNow(string filename)

Add the given JS file now.

Parameters:
filename - A relative JavaScript filename.

mvc\toolbox\ZMToolboxUtils.php at line 103

jsTop

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.

Parameters:
filename - A relative JavaScript filename.

mvc\toolbox\ZMToolboxUtils.php at line 150

staticPageContent

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.

Parameters:
pageName - The page name.
Returns:
The content or null.

ZenMagick 0.9.10