1: <?php
2: 3: 4:
5: class Text_Wiki_Render_Xhtml_Attribute extends Text_Wiki_Render
6: {
7: 8: 9: 10: 11: 12: 13: 14:
15: public function token($options)
16: {
17: $output = '<table width="100%" class="attributes"><tbody>';
18:
19: foreach ($options['attributes'] as $attribute) {
20:
21: $link = array('page' => $attribute['name'],
22: 'anchor' => '',
23: 'text' => $attribute['name']);
24:
25:
26:
27: if (preg_match('/^(' . Wicked::REGEXP_WIKIWORD . ')$/',
28: $attribute['value'], $matches)) {
29: $vlink = array('page' => $matches[1],
30: 'anchor' => '',
31: 'text' => $matches[1]);
32: $value = $this->wiki->renderObj['Wikilink']->token($vlink);
33: } elseif (preg_match('/^\(\((.*)\)\)$/', $attribute['value'],
34: $matches)) {
35: $vlink = array('page' => $matches[1],
36: 'anchor' => '',
37: 'text' => $matches[1]);
38: $value = $this->wiki->renderObj['Wikilink']->token($vlink);
39: } else {
40: $value = htmlspecialchars($attribute['value']);
41: }
42:
43: $output .= '<tr><td width="1%" nowrap="nowrap"><strong><em>' .
44: $this->wiki->renderObj['Wikilink']->token($link) .
45: ' :</em></strong></td><td>' . $value .
46: '</td></tr>';
47: }
48:
49: $output .= '</tbody></table>';
50:
51: return $output;
52: }
53: }
54: