From 8431dfd67bdfe34d2750a9678a2ee88c96000cdf Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 1 Apr 2004 06:28:33 +0000 Subject: [PATCH] fix by Dan Frankowski: Cached_Userlink, was not backlinked git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3235 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/CachedMarkup.php | 18 ++++++++++++++++-- lib/InlineParser.php | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/CachedMarkup.php b/lib/CachedMarkup.php index 1e9b1e857..6c4a3e364 100644 --- a/lib/CachedMarkup.php +++ b/lib/CachedMarkup.php @@ -1,4 +1,4 @@ - * * This file is part of PhpWiki. @@ -409,7 +409,21 @@ class Cached_InterwikiLink extends Cached_ExternalLink { } } - +// Needed to put UserPages to backlinks. Special method to markup userpages with icons +// Thanks to PhpWiki:DanFr for finding this bug. +// Fixed since 1.3.8, prev. versions had no userpages in backlinks +class Cached_UserLink extends Cached_WikiLink { + function expand($basepage, &$markup) { + $label = isset($this->_label) ? $this->_label : false; + $anchor = isset($this->_anchor) ? (string)$this->_anchor : ''; + $page = new WikiPageName($this->_page, $basepage, $anchor); + $link = WikiLink($page, 'auto', $label); + // $link = HTML::a(array('href' => $PageName)); + $link->setContent(PossiblyGlueIconToText('wikiuser', $this->_page)); + $link->setAttr('class', 'wikiuser'); + return $link; + } +} class Cached_PluginInvocation extends Cached_DynamicContent { function Cached_PluginInvocation ($pi) { diff --git a/lib/InlineParser.php b/lib/InlineParser.php index 2f322a990..d541754d4 100644 --- a/lib/InlineParser.php +++ b/lib/InlineParser.php @@ -1,4 +1,4 @@ - * * This file is part of PhpWiki. @@ -390,7 +390,7 @@ class Markup_wikiword extends SimpleMarkup function markup ($match) { if ($this->_isWikiUserPage($match)) - return $this->_UserLink($match); + return new Cached_UserLink($match); //$this->_UserLink($match); else return new Cached_WikiLink($match); } -- 2.45.0