From 06f95cd5efdc02257f6c7391dcaa866a01524385 Mon Sep 17 00:00:00 2001 From: uckelman Date: Mon, 24 Jan 2005 23:15:27 +0000 Subject: [PATCH] The extra description for RelatedChanges was appearing in RecentChanges and PageHistory due to a bad test in _RecentChanges_HtmlFormatter. Fixed. git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4415 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/plugin/RecentChanges.php | 17 ++++++++----- lib/plugin/RelatedChanges.php | 45 ++++++++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/lib/plugin/RecentChanges.php b/lib/plugin/RecentChanges.php index 3a0754752..7729584f8 100644 --- a/lib/plugin/RecentChanges.php +++ b/lib/plugin/RecentChanges.php @@ -1,5 +1,5 @@ makeButton("RSS2", $rss_url, 'rssicon')); } - function description () { + function pre_description () { extract($this->_args); // FIXME: say something about show_all. if ($show_major && $show_minor) @@ -257,9 +257,11 @@ extends _RecentChanges_Formatter } else $desc = fmt("All %s are listed below.", $edits); } - if (isset($this->_args['page'])) // RelatedChanges - return HTML::p(false, $desc, HTML::br(), fmt("(to pages linked from \"%s\")",$this->_args['page'])); - return HTML::p(false, $desc); + return $desc; + } + + function description() { + return HTML::p(false, pre_description()); } @@ -733,7 +735,7 @@ extends WikiPlugin function getVersion() { return preg_replace("/[Revision: $]/", '', - "\$Revision: 1.103 $"); + "\$Revision: 1.104 $"); } function managesValidators() { @@ -920,6 +922,9 @@ class DayButtonBar extends HtmlElement { } // $Log: not supported by cvs2svn $ +// Revision 1.103 2004/12/15 17:45:09 rurban +// fix box method +// // Revision 1.102 2004/12/06 19:29:24 rurban // simplify RSS: add RSS2 link (rss tag only, new content-type) // diff --git a/lib/plugin/RelatedChanges.php b/lib/plugin/RelatedChanges.php index 1a3c3b38d..2e0e53c4d 100644 --- a/lib/plugin/RelatedChanges.php +++ b/lib/plugin/RelatedChanges.php @@ -1,5 +1,5 @@ _args['page'])); + } +} + + class WikiPlugin_RelatedChanges extends WikiPlugin_RecentChanges { @@ -19,7 +29,7 @@ extends WikiPlugin_RecentChanges function getVersion() { return preg_replace("/[Revision: $]/", '', - "\$Revision: 1.3 $"); + "\$Revision: 1.4 $"); } function getDefaultArguments() { @@ -63,6 +73,32 @@ extends WikiPlugin_RecentChanges return $this->makeBox(WikiLink(_("RelatedChanges"),'',_("Related Changes")), $this->format($this->getChanges($request->_dbi, $args), $args)); } + + function format ($changes, $args) { + global $WikiTheme; + $format = $args['format']; + + $fmt_class = $WikiTheme->getFormatter('RelatedChanges', $format); + if (!$fmt_class) { + if ($format == 'rss') + $fmt_class = '_RecentChanges_RssFormatter'; + elseif ($format == 'rss2') + $fmt_class = '_RecentChanges_Rss2Formatter'; + elseif ($format == 'rss091') { + include_once "lib/RSSWriter091.php"; + $fmt_class = '_RecentChanges_RssFormatter091'; + } + elseif ($format == 'sidebar') + $fmt_class = '_RecentChanges_SideBarFormatter'; + elseif ($format == 'box') + $fmt_class = '_RecentChanges_BoxFormatter'; + else + $fmt_class = '_RelatedChanges_HtmlFormatter'; + } + + $fmt = new $fmt_class($args); + return $fmt->format($changes); + } } /** @@ -94,6 +130,9 @@ class RelatedChangesRevisionIterator extends WikiDB_PageRevisionIterator } // $Log: not supported by cvs2svn $ +// Revision 1.3 2004/06/03 18:58:27 rurban +// days links requires action=RelatedChanges arg +// // Revision 1.2 2004/05/08 14:06:13 rurban // new support for inlined image attributes: [image.jpg size=50x30 align=right] // minor stability and portability fixes @@ -112,4 +151,4 @@ class RelatedChangesRevisionIterator extends WikiDB_PageRevisionIterator // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: -?> \ No newline at end of file +?> -- 2.45.0