From 826181ada7dc9b2c40db2c33465eea27a17e405b Mon Sep 17 00:00:00 2001 From: rurban Date: Fri, 27 Feb 2004 02:49:40 +0000 Subject: [PATCH] patch #680562 "PageTrail Duplicates Patch (1.3.4)" git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3083 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/plugin/PageTrail.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/plugin/PageTrail.php b/lib/plugin/PageTrail.php index f825c07fd..6cd940047 100644 --- a/lib/plugin/PageTrail.php +++ b/lib/plugin/PageTrail.php @@ -1,5 +1,5 @@ @@ -50,13 +52,14 @@ extends WikiPlugin function getVersion() { return preg_replace("/[Revision: $]/", '', - "\$Revision: 1.3 $"); + "\$Revision: 1.4 $"); } // default values function getDefaultArguments() { return array('numberlinks' => $this->def_numberlinks, 'invisible' => false, + 'duplicates' => false, ); } @@ -71,8 +74,11 @@ extends WikiPlugin $thispage = $request->getArg('pagename'); $thiscookie = $request->cookies->get("Wiki_PageTrail"); $Pages = explode(':', $thiscookie); - array_unshift($Pages, $thispage); - $request->cookies->set("Wiki_PageTrail", implode(':', $Pages)); + + if ($duplicates || ($thispage != $Pages[0])) { + array_unshift($Pages, $thispage); + $request->cookies->set("Wiki_PageTrail",implode(':',$Pages)); + } if (! $invisible) { $numberlinks = min(count($Pages)-1, $numberlinks); @@ -89,6 +95,9 @@ extends WikiPlugin }; // $Log: not supported by cvs2svn $ +// Revision 1.3 2004/02/17 12:11:36 rurban +// added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...) +// // Revision 1.2 2003/01/18 22:22:36 carstenklapp // defined constant for arrow, eliminate use of fmt() // -- 2.45.0