3 class Text_Wiki_Render_Latex_Wikilink
extends Text_Wiki_Render
{
6 'view_url' => 'http://example.com/index.php?page=%s',
7 'new_url' => 'http://example.com/new.php?page=%s',
13 * Renders a token into XHTML.
17 * @param array $options The "options" portion of the token (second
20 * @return string The text rendered from the token options.
24 function token($options)
26 // make nice variable names (page, anchor, text)
29 // are we checking page existence?
30 $list =& $this->getConf('pages');
31 if (is_array($list)) {
32 // yes, check against the page list
33 $exists = in_array($page, $list);
35 // no, assume it exists
39 // convert *after* checking against page names so as not to mess
40 // up what the user typed and what we're checking.
41 $page = htmlspecialchars($page);
42 $anchor = htmlspecialchars($anchor);
43 $text = htmlspecialchars($text);
45 $href = $this->getConf('view_url');
47 if (strpos($href, '%s') === false
) {
48 // use the old form (page-at-end)
49 $href = $href . $page . $anchor;
51 // use the new form (sprintf format string)
52 $href = sprintf($href, $page . $anchor);
55 // get the CSS class and generate output
56 $css = $this->formatConf(' class="%s"', 'css');
57 return "$text\\footnote\{$href}";