4c1331a0e9bffe46795f98e0951edf68b943170a
2 // <if> conditional tests
9 require_once('../kernel.php');
10 $isso = new Shared_Object_Framework();
12 $isso->set('apppath', getcwd());
13 $isso->set('application', 'Template Test');
14 $isso->set('appversion', '$Id$');
15 $isso->set('debug', true
);
17 $isso->load('template', 'template', true
);
19 // ###################################################################
21 $data = '<tr valign="middle">
23 <span style="float: right; display: inline" class="smallfont">
24 1 <if condition="$show[\'edit\']">
25 2 <if condition="$show[\'receive\']">
26 <a href="item.php?do=finishget&id=$iteminfo[itemid]" title="Remove"><img src="{$template->templatedir}images/remove_item.png" alt="Remove Item" border="0" /></a>
28 <a href="item.php?do=edit&id=$iteminfo[itemid]" title="Edit"><img src="{$template->templatedir}images/edit_item.png" alt="Edit Item" border="0" /></a>
29 <a href="item.php?do=got&id=$iteminfo[itemid]" title="Received"><img src="{$template->templatedir}images/receive_item.png" alt="Received Item" border="0" /></a>
32 3 <if condition="$show[\'purchase\'] OR $show[\'unpurchase\']">
33 4 <if condition="$show[\'purchase\']">
34 <a href="item.php?do=purchase&id=$iteminfo[itemid]" title="Purchase"><img src="{$template->templatedir}images/purchase_item.png" alt="Purchase Item" border="0" /></a>
36 5 <if condition="$show[\'unpurchase\']">
37 <a href="item.php?do=unpurchase&id=$iteminfo[itemid]" title="Un-purchase"><img src="{$template->templatedir}images/unpurchase_item.png" alt="Un-purchase Item" border="0" /></a>
40 (<a href="mailto:$iteminfo[email]">$iteminfo[email]</a>)
45 <if condition="$iteminfo[\'url\']"><a href="$iteminfo[url]" target="_blank">$iteminfo[name]</a><else />$iteminfo[name]</if>
47 <td class="alt2">$iteminfo[price]</td>
48 <td class="alt1">$iteminfo[rating]</td>
49 <td class="alt2">$iteminfo[notes]</td>
50 <td class="alt1">$iteminfo[dateline]</td>
53 // ###################################################################
55 $data2 = '1 <if condition="test"> -0
56 2 <if condition="hi"> -1
60 3 <if condition="a"> -2
68 4 <if condition="hi"> -1
71 5 <if condition="asdfa"> -2
79 // ###################################################################
92 // ###################################################################
94 $parsed = $template->_parse($data2);
98 echo highlight_string('$test = "' . $parsed . '";', true
);
102 eval('$test = "' . $parsed . '";');