ZMObject
|
+--ZMToolboxHtml
public class ZMToolboxHtml
extends ZMObject
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| string | backLink(string text, array attr, boolean echo) Create a full back link. |
| string | encode(string s, boolean echo) Encode a given string to valid HTML. |
| string | ezpageLink(integer id, string text, array attr, boolean echo) Create a full HTML <a> tag pointig to an ezpage. |
| string | fieldMessages(string name, boolean echo) Show form field specific error messages. |
| string | hrefTarget(boolean newWin, boolean echo) Create a HTML target or onclick attribute for a HTML <a> tag. |
| string | image(ZMImageInfo imageInfo, string format, mixed parameter, boolean echo) Creates a HTML <img> tag for the given ZMImageInfo. |
| string | more(string s, int max, string more, boolean echo) Truncate text. |
| string | onload(string page, boolean echo) Get optional onload handler attribute for the current page. |
| string | productImageLink(ZMProduct product, int categoryId, array attr, string format, boolean echo) Create a HTML <a> tag with the product image of the given product. |
| string | strip(string text, boolean echo) Strip HTML tags from the given text. |
| string | text2html(string s) Convert text based user input into HTML. |
| Methods inherited from org.zenmagick.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public string backLink(string text, array attr, boolean echo)
Create a full back link.
Return a full HTML <a> tag.
Since the link text may be HTML, no HTML escaping is done in this method.
true, the URI will be echo'ed as well as returned.<a> tag.public string encode(string s, boolean echo)
Encode a given string to valid HTML.
true, the escaped string will be echo'ed as well as returned.public string ezpageLink(integer id, string text, array attr, boolean echo)
Create a full HTML <a> tag pointig to an ezpage.
Since the link text may be HTML, no HTML escaping is done on the $text parameter.
null to use the ezpage title as link text.true, the link will be echo'ed as well as returned.public string fieldMessages(string name, boolean echo)
Show form field specific error messages.
The generated ul tag will have the value [$name]Info as id, and
a class of fieldMsg.
Each li will have the type as class assigned.
Messages are HTML escaped/encoded but no further localization is done.
true, the URI will be echo'ed as well as returned.null.public string hrefTarget(boolean newWin, boolean echo)
Create a HTML target or onclick attribute for a HTML <a> tag.
Behaviour is controlled with the ZenMagick setting isJSTarget.
true, HTML for opening in a new window will be created.true, the formatted text will be echo'ed as well as returned.public string image(ZMImageInfo imageInfo, string format, mixed parameter, boolean echo)
Creates a HTML <img> tag for the given ZMImageInfo.
ZMProducts::IMAGE_SMALL, ZMProducts::IMAGE_MEDIUM
* or ZMProducts::IMAGE_LARGE; default is >ZMProducts::IMAGE_SMALL.<mg> tag; can be either
* a query string style list of name/value pairs or a map.true, the URI will be echo'ed as well as returned.<img> tag.public string more(string s, int max, string more, boolean echo)
Truncate text.
true, the URI will be echo'ed as well as returned.public string onload(string page, boolean echo)
Get optional onload handler attribute for the current page.
The generated HTML is in the form onload="SOME JAVASCRIPT".
null for the current page.true, the URI will be echo'ed as well as returned.public string productImageLink(ZMProduct product, int categoryId, array attr, string format, boolean echo)
Create a HTML <a> tag with the product image of the
given product.
This one will return a fully encoded HTML <img> tag.
null.ZMProducts::IMAGE_SMALL, ZMProducts::IMAGE_MEDIUM
* or ZMProducts::IMAGE_LARGE; default is ZMProducts::IMAGE_SMALL.true, the URI will be echo'ed as well as returned.<a> tag.public string strip(string text, boolean echo)
Strip HTML tags from the given text.
true, the stripped text will be echo'ed as well as returned.public string text2html(string s)
Convert text based user input into HTML.
HTML utilities.