1: <?php
2: /**
3: * Renders a wiki page free link for a Wiki page.
4: *
5: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
6: *
7: * See the enclosed file COPYING for license information (GPLv2). If
8: * you did not receive this file, see
9: * http://www.horde.org/licenses/gpl
10: *
11: * PHP version 5
12: *
13: * @category Horde
14: * @package Wicked
15: * @author Gunnar Wrobel <wrobel@pardus.de>
16: * @link http://www.horde.org/apps/wicked
17: * @license http://www.horde.org/licenses/gpl GNU General Public License, version 2
18: */
19:
20: /**
21: * Renders a wiki page free link for a Wiki page.
22: *
23: * @category Horde
24: * @package Wicked
25: * @author Gunnar Wrobel <wrobel@pardus.de>
26: * @link http://www.horde.org/apps/wicked
27: * @license http://www.horde.org/licenses/gpl GNU General Public License, version 2
28: */
29: class Text_Wiki_Render_Rst_Freelink extends Text_Wiki_Render
30: {
31: /**
32: * A collector for link sections below a paragraph.
33: *
34: * @var array
35: */
36: static public $paragraph_links = array();
37:
38: /**
39: * Renders a token into text matching the requested format.
40: *
41: * @param array $options The "options" portion of the token (second
42: * element).
43: *
44: * @return string The text rendered from the token options.
45: */
46: public function token($options)
47: {
48: extract($options);
49:
50: self::$paragraph_links[] = '.. _`' . $text . '`: ' . $page;
51: return '`' . $text . '`_';
52: }
53: }
54: