ZenMagick 0.9.8


org.zenmagick.store.mvc.tools.ZMToolboxUtils
\store\mvc\tools\ZMToolboxUtils.php at line 34

Class ZMToolboxUtils

ZMObject
└─ZMToolboxTool
└─ZMToolboxUtils

public class ZMToolboxUtils
extends ZMToolboxTool

Generic utilities.

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

Fields inherited from org.zenmagick.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, boolean echo)

Format the given amount according to the current currency.

string

getTitle(string page, boolean echo)

Simple title generator based on the page name.

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.

Methods inherited from org.zenmagick.toolbox.ZMToolboxTool
getRequest, getToolbox, setRequest, setToolbox
Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Method Detail

\store\mvc\tools\ZMToolboxUtils.php at line 107

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.

\store\mvc\tools\ZMToolboxUtils.php at line 64

encodeXML

public string encodeXML(string s)

Encode XML control characters.

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

\store\mvc\tools\ZMToolboxUtils.php at line 87

formatMoney

public string formatMoney(float amount, boolean convert, boolean echo)

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.
echo - If true, the URI will be echo'ed as well as returned.
Returns:
The formatted amount.

\store\mvc\tools\ZMToolboxUtils.php at line 43

getTitle

public string getTitle(string page, boolean echo)

Simple title generator based on the page name.

Parameters:
page - The page name; default is null for the current page.
echo - If true, the URI will be echo'ed as well as returned.
Returns:
A reasonable page title.

\store\mvc\tools\ZMToolboxUtils.php at line 132

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.

\store\mvc\tools\ZMToolboxUtils.php at line 141

jsNow

public void jsNow(string filename)

Add the given JS file now.

Parameters:
filename - A relative JavaScript filename.

\store\mvc\tools\ZMToolboxUtils.php at line 118

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.

ZenMagick 0.9.8