200, 'height' => 200, ); } function handle_plugin_args_cruft(&$argstr, &$args) { $this->source = $argstr; } function run($dbi, $argstr, &$request, $basepage) { global $WikiTheme; $args = $this->getArgs($argstr, $request); if (empty($this->source)) return ''; $html = HTML(); if (empty($WikiTheme->_asciiSVG)) { $js = JavaScript('', array ('src' => $WikiTheme->_findData('asciiSVG.js'))); if (empty($WikiTheme->_headers_printed)) $WikiTheme->addMoreHeaders($js); else $html->pushContent($js); $WikiTheme->_asciiSVG = 1; // prevent duplicates } // we need script='data' and not script="data" $embed = new AsciiSVG_HTML("embed", array('width' => $args['width'], 'height' => $args['height'], 'src' => "d.svg", 'script' => $this->source)); $html->pushContent($embed); return $html; } }; class AsciiSVG_HTML extends HtmlElement { function startTag() { $start = "<" . $this->_tag; $this->_setClasses(); foreach ($this->_attr as $attr => $val) { if (is_bool($val)) { if (!$val) continue; $val = $attr; } $qval = str_replace("\"", '"', $this->_quote((string)$val)); if ($attr == 'script') $start .= " $attr='$qval'"; else $start .= " $attr=\"$qval\""; } $start .= ">"; return $start; } } // $Log: not supported by cvs2svn $ // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>