Source for file Url.php
Documentation is available at Url.php
class Text_Wiki_Render_Xhtml_Url extends Text_Wiki_Render {
'img_ext' => array ('jpg', 'jpeg', 'gif', 'png'),
* Renders a token into text matching the requested format.
* @param array $options The "options" portion of the token (second
* @return string The text rendered from the token options.
// create local variables from the options array (text,
// find the rightmost dot and determine the filename
// does the filename extension indicate an image file?
if ($this->getConf ('images') &&
in_array($ext, $this->getConf ('img_ext', array ()))) {
// create alt text for the image
if (! isset ($text) || $text == '') {
$css = $this->formatConf (' class="%s"', 'css_img');
$output = " <img$css src=\"$href\" alt=\"$text\" />";
// allow for alternative targets on non-anchor HREFs
$target = $this->getConf ('target');
// generate a regular link (not an image)
$css = $this->formatConf (' class="%s"', " css_$type" );
$output = " <a$css href=\"$href\"";
// use a "popup" window. this is XHTML compliant, suggested by
// Aaron Kalin. uses the $target as the new window name.
$output .= " onclick=\"window.open(this.href, '$target');";
$output .= " return false;\"";
// make numbered references look like footnotes when no
// CSS class specified, make them superscript by default
if ($type == 'footnote' && ! $css) {
$output = '<sup>' . $output . '</sup>';
Documentation generated on Mon, 11 Mar 2019 14:22:34 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|