1: <?php
2: /**
3: * This class renders Wicked blocks.
4: *
5: * @package Wicked
6: */
7: class Text_Wiki_Render_Xhtml_Wickedblock extends Text_Wiki_Render
8: {
9: /**
10: * Renders a token into text matching the requested format.
11: *
12: * @access public
13: *
14: * @param array $options The "options" portion of the token (second
15: * element).
16: *
17: * @return string The text rendered from the token options.
18: */
19: public function token($options)
20: {
21: try {
22: return $GLOBALS['injector']
23: ->getInstance('Horde_Core_Factory_BlockCollection')
24: ->create()
25: ->getBlock($options['app'],
26: $options['app'] . '_Block_' . $options['block'],
27: $options['args'])
28: ->getContent();
29: } catch (Horde_Exception $e) {
30: return $e->getMessage();
31: }
32: }
33: }
34: