Source for file Freelink.php
Documentation is available at Freelink.php
class Text_Wiki_Render_Xhtml_Freelink extends Text_Wiki_Render {
'view_url' => 'http://example.com/index.php?page=%s',
'new_url' => 'http://example.com/new.php?page=%s',
* 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.
// get nice variable names (page, text, anchor)
if (in_array($page, $this->getConf ('pages'))){
// the page exists, show a link to the page
$href = $this->getConf ('view_url');
if (strpos($href, '%s') === false ) {
$href = $href . $page . '#' . $anchor;
$href = sprintf($href, $page . '#' . $anchor);
return " <a href=\"$href\">$text</a>";
// the page does not exist, show the page name and
$href = $this->getConf ('new_url');
if (strpos($href, '%s') === false ) {
return $text . " <a href=\"$href\">" . $this->getConf ('new_text') . "</a>";
Documentation generated on Mon, 11 Mar 2019 13:51:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|