ZMObject
|
+--ZMToolboxMacro
public class ZMToolboxMacro
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| protected string | buildAttributeValueLabel(ZMProduct product, ZMAttributeValue value, boolean enableImage) Format an attribute value label. |
| string | buildCrumbtrail(ZMCrumbtrail crumbtrail, string sep) Helper to format a given ZMCrumbtrail. |
| array | buildQuantityDiscounts(ZMProduct product, boolean tax) Build quantity discounts details. |
| string | categoryTree(array categories, boolean showProductCount, boolean useCategoryPage, boolean activeParent, boolean root, array path) Build a nested unordered list from the given categories. |
| string | formatAddress(ZMAddress address, boolean html, boolean echo) Format an address according to the countries address format. |
| array | officeOnlyEmailFooter(string name, string email, ZMSession session) Format additional email content for internal copies. |
| string | phpinfo(mixed what, boolean echo, what What) phpinfo wrapper. |
| array | productAttributes(ZMProduct product) Generate HTML for product attributes. |
| protected array | productCheckboxAttribute(ZMProduct product, ZMAttribute attribute) Generate HTML for a CHECKBOX attribute. |
| string | productPrice(ZMProduct product, boolean tax, boolean echo) Format the product price incl. |
| protected array | productRadioAttribute(ZMProduct product, ZMAttribute attribute) Generate HTML for a RADIO attribute. |
| protected array | productReadonlyAttribute(ZMAttribute attribute, ZMProduct product) Generate HTML for a READONLY attribute. |
| protected array | productSelectAttribute(ZMProduct product, ZMAttribute attribute) Generate HTML for a SELECT attribute. |
| protected array | productTextAttribute(ZMProduct product, ZMAttribute attribute) Generate HTML for a TEXT attribute. |
| protected array | productUploadAttribute(ZMProduct product, ZMAttribute attribute, mixed uploadIndex) Generate HTML for a FILE attribute. |
| string | showBanner(ZMBanner banner, boolean echo, boolean updateStats) Display the given banner. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
protected string buildAttributeValueLabel(ZMProduct product, ZMAttributeValue value, boolean enableImage)
Format an attribute value label.
true.public string buildCrumbtrail(ZMCrumbtrail crumbtrail, string sep)
Helper to format a given ZMCrumbtrail.
ZMCrumbtrail instance.public array buildQuantityDiscounts(ZMProduct product, boolean tax)
Build quantity discounts details.
ZMOffers for details; default is true.public string categoryTree(array categories, boolean showProductCount, boolean useCategoryPage, boolean activeParent, boolean root, array path)
Build a nested unordered list from the given categories.
Supports show category count and use category page.
Links in the active path (<a>) will have a class named act,
empty categories will have a class empty. Note that both can occur
at the same time.
Uses output buffering for increased performance.
Please note that the last three parameter are used internally and should not bet set.
array of ZMCategory instances.false.false.false.true); default is true.null.public string formatAddress(ZMAddress address, boolean html, boolean echo)
Format an address according to the countries address format.
The following values are available for display:
$firstname - The first name$lastname - The last name$company - The company name$street - The street address$streets - Depending on availablility either $street or $street$cr$suburb$suburb - The subrub$city - The city$state - The state (either from the list of states or manually entered)$country - The country name$postcode/$zip - The post/zip code$hr - A horizontal line$cr - New line character$statecomma - The sequence $state, (note the trailing space)If address is null, the localized version of N/A will be returned.
true, format as HTML, otherwise plain text.true, the URI will be echo'ed as well as returned.public array officeOnlyEmailFooter(string name, string email, ZMSession session)
Format additional email content for internal copies.
public string phpinfo(mixed what, boolean echo, what What)
phpinfo wrapper.
1.true, the info will be echo'ed as well as returned.phpinfo output minus a few formatting things that break validation.public array productAttributes(ZMProduct product)
Generate HTML for product attributes.
Usage sample:
<?php $attributes = $macro->productAttributes($product); ?>
<?php foreach ($attributes as $attribute) { ?>
<?php foreach ($attribute['html'] as $option) { ?>
<p><?php echo $option ?></p>
<?php } ?>
<?php } ?>
ZMProduct instance.protected array productCheckboxAttribute(ZMProduct product, ZMAttribute attribute)
Generate HTML for a CHECKBOX attribute.
public string productPrice(ZMProduct product, boolean tax, boolean echo)
Format the product price incl. offer, special and other stuff.
ZMOffers for details; default is true.true, the formatted price HTML will be echo'ed as well as returned.protected array productRadioAttribute(ZMProduct product, ZMAttribute attribute)
Generate HTML for a RADIO attribute.
protected array productReadonlyAttribute(ZMAttribute attribute, ZMProduct product)
Generate HTML for a READONLY attribute.
protected array productSelectAttribute(ZMProduct product, ZMAttribute attribute)
Generate HTML for a SELECT attribute.
protected array productTextAttribute(ZMProduct product, ZMAttribute attribute)
Generate HTML for a TEXT attribute.
protected array productUploadAttribute(ZMProduct product, ZMAttribute attribute, mixed uploadIndex)
Generate HTML for a FILE attribute.
public string showBanner(ZMBanner banner, boolean echo, boolean updateStats)
Display the given banner.
ZMBanner instance.true, the banner stats will get updated (click count).true, the URI will be echo'ed as well as returned.
Macro utilities.