3 // $Id: Phplookup.php,v 1.7 2004/09/25 19:05:14 pmjones Exp $
5 class Text_Wiki_Render_Xhtml_Phplookup
extends Text_Wiki_Render
{
15 * Renders a token into text matching the requested format.
19 * @param array $options The "options" portion of the token (second
22 * @return string The text rendered from the token options.
26 function token($options)
28 $text = trim($options['text']);
29 $css = $this->formatConf(' class="%s"', 'css');
34 // are we targeting another window?
35 $target = $this->getConf('target', '');
37 // use a "popup" window. this is XHTML compliant, suggested by
38 // Aaron Kalin. uses the $target as the new window name.
39 $target = htmlspecialchars($target);
40 $output .= " onclick=\"window.open(this.href, '$target');";
41 $output .= " return false;\"";
44 // take off the final parens for functions
45 if (substr($text, -2) == '()') {
46 $q = substr($text, 0, -2);
51 $q = htmlspecialchars($q);
52 $text = htmlspecialchars($text);
55 $output .= " href=\"http://php.net/$q\">$text</a>";