Why does HAM taste so good? It's the HZML.
These HZML tags are available only within the latest compiled binary versions of HAM (version 4+), usable in her HAM templates (hazel-cat/HAM/templates) to customize your administration interface.
| <Hazel-HAM-Cando /> | |||
|---|---|---|---|
| Query a security capability of the current user. HAM only; v4.000+ | |||
| Class |
A security class is something such as "products:rwad" where "products" can be any generic HAM action type (eg. "config", "orders", "products", "users") , and "rwad" represents a set of read, write, add, and delete operations. |
||
| Result |
Name in %HZV root to store result. Default value: "RESULT"
|
||
|
If the current user is able to carry out an action of the given security class, set result true. The result can then be checked in (eg.) a |
|||
| <Hazel-HAM-Cando Class="users:w" Result="WUSER" /> <Hazel-True Token="%HZV_WUSER"> <a href="%HZU_HAM?action=list_users">Edit Users</a> </Hazel-True> | |||
|
<Hazel-HAM-Header /> <Hazel-HAM-Footer /> |
|||
|---|---|---|---|
| Display a standard HTML file header. HAM only; v4.000+ | |||
| Title |
The title and top-level <h1>header</h1> for the page. Only applicable to header.
|
||
| Include |
Filename relative to hazel-cat/HAM/templates/, to be inserted before the closing </head> tag. Only applicable to header.
|
||
|
These elements simplify the creation of HAM templates, leaving only the "meat" in the template file itself. The default output of both is shown in the example block below. The link to As of HAM v4.040, creating your own |
|||
| <!-- Begin output from Hazel-HAM-Header Title="Login" /> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <title>HAM: Login</title> <link rel="stylesheet" href="%HZU_HAM/style/" /> </head> <body> <h1>HAM: Login</h1> <div class="indented"> <!-- End output from Hazel-HAM-Header Title="Login" /> <!-- Begin output from Hazel-HAM-Footer /> </div> <hr> <Hazel-True Token="%HZH_HAM_UID" GT="-1"> <em>You are connected %HZH_HAM_LOGIN_METHOD as %HZH_HAM_USERNAME <uid %HZH_HAM_UID>. Be sure to <a href="%HZU_HAM?action=logout"> logout</a> when finished.</em> <br /> </Hazel-True> <br />HAM [<a href="%HZU_HAM?action=select_theme">%HZE_THEME</a>] :: <a href="%HZU_HAM?action=home">Home</a> :: <a href="%HZU_HAM?action=products">Products</a> :: <a href="%HZU_HAM?action=orders">Orders</a> :: <a href="%HZU_HAM?action=logout">Logout</a> // Hazel [<a href="%HZU_HAM?action=select_theme">%HZE_THEME</a>] :: <a href="%HZU_ACTION=home&theme=test">Home</a> :: <a href="%HZU_ACTION=test&theme=test">TestOrder</a> :: <a href="%HZU_ACTION=showreg">ShowReg</a> :: <a href="%HZU_ACTION=cleanup">Cleanup</a> <br> </body> </html> <!-- End output from Hazel-HAM-Footer /> | |||
| <Hazel-HAM-Loop Type="Orders"> ... </Hazel-HAM-Loop> | |||
|---|---|---|---|
| Render a block of HZML for each order received. HAM only; v4.000+ | |||
|
As other Hazel loops, the orders loop renders its content once each for a certain number of items. In this case, those items are orders received by Hazel. Within an orders loop, you can use the HAM-specific
Within each loop, A simple example of an orders loop follows, but the full experience can be had by inspecting the |
|||
| <ul> <Hazel-HAM-Loop Type="Orders"> <li>%HZO_ORDER_ID placed %HZO_DATE by %HZO_BILL_FNAME %HZO_BILL_LNAME in the amount of $%HZO_TOTAL_ORDER.</li> </Hazel-HAM-Loop> </ul> |
| <Hazel-HAM-Loop Type="Users"> ... </Hazel-HAM-Loop> | |||
|---|---|---|---|
| Render a block of HZML for each HAM user defined. HAM only; v4.000+ | |||
|
The users loop renders its content once for each user you have defined in the HAM system. Within a users loop, you can use the following tokens:
Within each loop, For a detailed example, see the |
|||
| <ul> <Hazel-HAM-Loop Type="Users"> <li>%HZH_WORD2 (%HZH_WORD1) is <Hazel-Choice Token="%HZH_WORD4" False="NOT" /> awaiting deletion.</li> </Hazel-HAM-Loop> </ul> |