ZenMagick 0.9.6


Functions


Function Summary
string

zen_date_raw(string date, boolean reverse)

Convert UI date into a raw date format that zen-cart understands.

string

zm_i18n(string name)

Lookup and echo a i18n specific setting.

void

zm_i18n_add(mixed name, string value)

Add i18n setting.

void

zm_i18n_finalise()

Finalise i18n settings.

string

zm_l10n(string text, var args)

Lookup and echo a language specific text.

void

zm_l10n_add(array map)

Add language mappings.

string

zm_l10n_chunk_get(string name, var args)

Lookup a language specific chunk.

string

zm_l10n_get(string text, var args)

Lookup a language specific text.

Function Detail

zen_date_raw

public string zen_date_raw(string date, boolean reverse)

Convert UI date into a raw date format that zen-cart understands.

This generic implementation will work as long as UI_DATE_FORMAT is defined.
The function will honour DD, MM, CC, YY and YYYY in the format.

NOTE: The format is *not* case sensitive.

Parameters:
date - A date (usually part of a form submit by the user).
reverse - If true, the returned data will be reversed.
Returns:
The provided date converted into the format YYYYDDMM or MMDDYYYY, respectivley.

zm_i18n

public string zm_i18n(string name)

Lookup and echo a i18n specific setting.

Parameters:
name - The setting name.
Returns:
A value or null.

zm_i18n_add

public void zm_i18n_add(mixed name, string value)

Add i18n setting.

Parameters:
name - The setting name or an array of settings.
value - The value (will be ignored if name is of type array).

zm_i18n_finalise

public void zm_i18n_finalise()

Finalise i18n settings.

This function will convert all i18n settings into corresponding defines and do all additional stuff that should be done just once.


zm_l10n

public string zm_l10n(string text, var args)

Lookup and echo a language specific text.

Parameters:
text - The text.
args - A variable number of arguments that will be used as arguments for * vsprintf(..) to insert variables into the localized text.
Returns:
A localized version based on the current language, or the original text.

zm_l10n_add

public void zm_l10n_add(array map)

Add language mappings.

Parameters:
map - The new/additional mappings.

zm_l10n_chunk_get

public string zm_l10n_chunk_get(string name, var args)

Lookup a language specific chunk.

Similar to zm_l10n_get(..), except that the first argument is a chunk (file-)name, rather than a real localizable string.

Parameters:
name - The chunk name.
args - A variable number of arguments that will be used as arguments for * vsprintf(..) to insert variables into the localized text.
Returns:
A localized version based on the current language, or null.

zm_l10n_get

public string zm_l10n_get(string text, var args)

Lookup a language specific text.

Parameters:
text - The text.
args - A variable number of arguments that will be used as arguments for * vsprintf(..) to insert variables into the localized text.
Returns:
A localized version based on the current language, or the original text.

ZenMagick 0.9.6