2 rcs_id('$Id: RecentChanges.php,v 1.93 2004-05-14 17:33:07 rurban Exp $');
4 Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
6 This file is part of PhpWiki.
8 PhpWiki is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 PhpWiki is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with PhpWiki; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 class _RecentChanges_Formatter
27 var $_absurls = false;
29 function _RecentChanges_Formatter ($rc_args) {
30 $this->_args = $rc_args;
31 $this->_diffargs = array('action' => 'diff');
33 if ($rc_args['show_minor'] || !$rc_args['show_major'])
34 $this->_diffargs['previous'] = 'minor';
36 // PageHistoryPlugin doesn't have a 'daylist' arg.
37 if (!isset($this->_args['daylist']))
38 $this->_args['daylist'] = false;
41 function include_versions_in_URLs() {
42 return (bool) $this->_args['show_all'];
45 function date ($rev) {
47 return $Theme->getDay($rev->get('mtime'));
50 function time ($rev) {
52 return $Theme->formatTime($rev->get('mtime'));
55 function diffURL ($rev) {
56 $args = $this->_diffargs;
57 if ($this->include_versions_in_URLs())
58 $args['version'] = $rev->getVersion();
59 $page = $rev->getPage();
60 return WikiURL($page->getName(), $args, $this->_absurls);
63 function historyURL ($rev) {
64 $page = $rev->getPage();
65 return WikiURL($page, array('action' => _("PageHistory")),
69 function pageURL ($rev) {
70 return WikiURL($this->include_versions_in_URLs() ? $rev : $rev->getPage(),
74 function authorHasPage ($author) {
75 global $WikiNameRegexp, $request;
76 $dbi = $request->getDbh();
77 return isWikiWord($author) && $dbi->isWikiPage($author);
80 function authorURL ($author) {
81 return $this->authorHasPage() ? WikiURL($author) : false;
85 function status ($rev) {
86 if ($rev->hasDefaultContents())
88 $page = $rev->getPage();
89 $prev = $page->getRevisionBefore($rev->getVersion());
90 if ($prev->hasDefaultContents())
95 function importance ($rev) {
96 return $rev->get('is_minor_edit') ? 'minor' : 'major';
99 function summary($rev) {
100 if ( ($summary = $rev->get('summary')) )
103 switch ($this->status($rev)) {
105 return _("Deleted.");
107 return _("New page.");
113 function setValidators($most_recent_rev) {
114 $rev = $most_recent_rev;
115 $validators = array('RecentChanges-top' =>
116 array($rev->getPageName(), $rev->getVersion()),
117 '%mtime' => $rev->get('mtime'));
119 $request->appendValidators($validators);
123 class _RecentChanges_HtmlFormatter
124 extends _RecentChanges_Formatter
126 function diffLink ($rev) {
128 return $Theme->makeButton(_("(diff)"), $this->diffURL($rev), 'wiki-rc-action');
131 function historyLink ($rev) {
133 return $Theme->makeButton(_("(hist)"), $this->historyURL($rev), 'wiki-rc-action');
136 function pageLink ($rev, $link_text=false) {
138 return WikiLink($rev,'auto',$link_text);
140 $page = $rev->getPage();
142 if ($this->include_versions_in_URLs()) {
143 $version = $rev->getVersion();
144 if ($rev->isCurrent())
146 $exists = !$rev->hasDefaultContents();
150 $cur = $page->getCurrentRevision();
151 $exists = !$cur->hasDefaultContents();
154 return $Theme->linkExistingWikiWord($page->getName(), $link_text, $version);
156 return $Theme->linkUnknownWikiWord($page->getName(), $link_text);
160 function authorLink ($rev) {
161 $author = $rev->get('author');
162 if ( $this->authorHasPage($author) ) {
163 return WikiLink($author);
168 function summaryAsHTML ($rev) {
169 if ( !($summary = $this->summary($rev)) )
171 return HTML::strong( array('class' => 'wiki-summary'),
173 TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
177 function rss_icon () {
178 global $request, $Theme;
180 $rss_url = $request->getURLtoSelf(array('format' => 'rss'));
181 return HTML::small(array('style' => 'font-weight:normal;vertical-align:middle;'), $Theme->makeButton("RSS", $rss_url, 'rssicon'));
184 function description () {
185 extract($this->_args);
186 // FIXME: say something about show_all.
187 if ($show_major && $show_minor)
190 $edits = _("major edits");
192 $edits = _("minor edits");
193 if ($caption == _("Recent Comments"))
194 $edits = _("comments");
196 if ($timespan = $days > 0) {
197 if (intval($days) != $days)
198 $days = sprintf("%.1f", $days);
202 * Depending how this text is split up it can be tricky or
203 * impossible to translate with good grammar. So the seperate
204 * strings for 1 day and %s days are necessary in this case
205 * for translating to multiple languages, due to differing
206 * overlapping ideal word cutting points.
208 * en: day/days "The %d most recent %s [during (the past] day) are listed below."
209 * de: 1 Tag "Die %d jüngste %s [innerhalb (von des letzten] Tages) sind unten aufgelistet."
210 * de: %s days "Die %d jüngste %s [innerhalb (von] %s Tagen) sind unten aufgelistet."
212 * en: day/days "The %d most recent %s during [the past] (day) are listed below."
213 * fr: 1 jour "Les %d %s les plus récentes pendant [le dernier (d'une] jour) sont énumérées ci-dessous."
214 * fr: %s jours "Les %d %s les plus récentes pendant [les derniers (%s] jours) sont énumérées ci-dessous."
218 if (intval($days) == 1)
219 $desc = fmt("The %d most recent %s during the past day are listed below.",
222 $desc = fmt("The %d most recent %s during the past %s days are listed below.",
223 $limit, $edits, $days);
225 $desc = fmt("The %d most recent %s are listed below.",
228 elseif ($limit < 0) { //$limit < 0 means we want oldest pages
230 if (intval($days) == 1)
231 $desc = fmt("The %d oldest %s during the past day are listed below.",
234 $desc = fmt("The %d oldest %s during the past %s days are listed below.",
235 $lmt, $edits, $days);
237 $desc = fmt("The %d oldest %s are listed below.",
243 if (intval($days) == 1)
244 $desc = fmt("The most recent %s during the past day are listed below.",
247 $desc = fmt("The most recent %s during the past %s days are listed below.",
250 $desc = fmt("All %s are listed below.", $edits);
252 if (isset($this->_args['page'])) // RelatedChanges
253 return HTML::p(false, $desc, HTML::br(), fmt("(to pages linked from \"%s\")",$this->_args['page']));
254 return HTML::p(false, $desc);
259 extract($this->_args);
260 if (isset($caption) and $caption == _("Recent Comments"))
261 return array(_("RecentComments"),' ',$this->rss_icon(),
262 $this->sidebar_link());
263 return array($show_minor ? _("RecentEdits") : _("RecentChanges"),
266 $this->sidebar_link());
269 function empty_message () {
270 if (isset($this->_args['caption']) and $this->_args['caption'] == _("Recent Comments"))
271 return _("No comments found");
273 return _("No changes found");
276 function sidebar_link() {
277 extract($this->_args);
278 $pagetitle = $show_minor ? _("RecentEdits") : _("RecentChanges");
281 $sidebarurl = WikiURL($pagetitle, array('format' => 'sidebar'), 'absurl');
284 "function addPanel() {\n"
285 ." window.sidebar.addPanel (\"" . sprintf("%s - %s", WIKI_NAME, $pagetitle) . "\",\n"
286 ." \"$sidebarurl\",\"\");\n"
288 $jsf = JavaScript($addsidebarjsfunc);
291 $sidebar_button = $Theme->makeButton("sidebar", 'javascript:addPanel();', 'sidebaricon');
292 $addsidebarjsclick = asXML(HTML::small(array('style' => 'font-weight:normal;vertical-align:middle;'), $sidebar_button));
293 $jsc = JavaScript("if ((typeof window.sidebar == 'object') &&\n"
294 ." (typeof window.sidebar.addPanel == 'function'))\n"
296 ." document.write('$addsidebarjsclick');\n"
299 return HTML(new RawXML("\n"), $jsf, new RawXML("\n"), $jsc);
302 function format ($changes) {
303 include_once('lib/InlineParser.php');
305 $html = HTML(HTML::h2(false, $this->title()));
306 if (($desc = $this->description()))
307 $html->pushContent($desc);
309 if ($this->_args['daylist'])
310 $html->pushContent(new DayButtonBar($this->_args));
316 while ($rev = $changes->next()) {
317 if (($date = $this->date($rev)) != $last_date) {
319 $html->pushContent($lines);
320 $html->pushContent(HTML::h3($date));
325 // enforce view permission
326 if (mayAccessPage('view',$rev->_pagename)) {
327 $lines->pushContent($this->format_revision($rev));
330 $this->setValidators($rev);
335 $html->pushContent($lines);
337 $html->pushContent(HTML::p(array('class' => 'rc-empty'),
338 $this->empty_message()));
343 function format_revision ($rev) {
344 $args = &$this->_args;
346 $class = 'rc-' . $this->importance($rev);
348 $time = $this->time($rev);
349 if (! $rev->get('is_minor_edit'))
350 $time = HTML::strong(array('class' => 'pageinfo-majoredit'), $time);
352 $line = HTML::li(array('class' => $class));
355 if ($args['difflinks'])
356 $line->pushContent($this->diffLink($rev), ' ');
358 if ($args['historylinks'])
359 $line->pushContent($this->historyLink($rev), ' ');
361 $line->pushContent($this->pageLink($rev), ' ',
363 $this->summaryAsHTML($rev),
365 $this->authorLink($rev));
371 class _RecentChanges_SideBarFormatter
372 extends _RecentChanges_HtmlFormatter
374 function rss_icon () {
378 //title click opens the normal RC or RE page in the main browser frame
379 extract($this->_args);
380 $titlelink = WikiLink($show_minor ? _("RecentEdits") : _("RecentChanges"));
381 $titlelink->setAttr('target', '_content');
382 return HTML($this->logo(), $titlelink);
385 //logo click opens the HomePage in the main browser frame
387 $img = HTML::img(array('src' => $Theme->getImageURL('logo'),
390 'style' => 'height:2.5ex'
392 $linkurl = WikiLink(HOME_PAGE, false, $img);
393 $linkurl->setAttr('target', '_content');
397 function authorLink ($rev) {
398 $author = $rev->get('author');
399 if ( $this->authorHasPage($author) ) {
400 $linkurl = WikiLink($author);
401 $linkurl->setAttr('target', '_content'); // way to do this using parent::authorLink ??
407 function diffLink ($rev) {
408 $linkurl = parent::diffLink($rev);
409 $linkurl->setAttr('target', '_content');
410 // FIXME: Smelly hack to get smaller diff buttons in sidebar
411 $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', asXML($linkurl)));
414 function historyLink ($rev) {
415 $linkurl = parent::historyLink($rev);
416 $linkurl->setAttr('target', '_content');
417 // FIXME: Smelly hack to get smaller history buttons in sidebar
418 $linkurl = new RawXML(str_replace('<img ', '<img style="height:2ex" ', asXML($linkurl)));
421 function pageLink ($rev) {
422 $linkurl = parent::pageLink($rev);
423 $linkurl->setAttr('target', '_content');
426 // Overriding summaryAsHTML, because there is no way yet to
427 // return summary as transformed text with
428 // links setAttr('target', '_content') in Mozilla sidebar.
429 // So for now don't create clickable links inside summary
430 // in the sidebar, or else they target the sidebar and not the
431 // main content window.
432 function summaryAsHTML ($rev) {
433 if ( !($summary = $this->summary($rev)) )
435 return HTML::strong(array('class' => 'wiki-summary'),
437 /*TransformLinks(*/$summary,/* $rev->get('markup')),*/
442 function format ($changes) {
443 $this->_args['daylist'] = false; //don't show day buttons in Mozilla sidebar
444 $html = _RecentChanges_HtmlFormatter::format ($changes);
445 $html = HTML::div(array('class' => 'wikitext'), $html);
447 $request->discardOutput();
449 printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", $GLOBALS['charset']);
450 printf('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"');
451 printf(' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
452 printf('<html xmlns="http://www.w3.org/1999/xhtml">');
455 extract($this->_args);
456 $title = WIKI_NAME . $show_minor ? _("RecentEdits") : _("RecentChanges");
457 printf("<title>" . $title . "</title>\n");
459 $css = $Theme->getCSS();
463 printf("<body class=\"sidebar\">\n");
465 printf("\n</body>\n");
468 $request->finish(); // cut rest of page processing short
472 class _RecentChanges_BoxFormatter
473 extends _RecentChanges_HtmlFormatter
475 function rss_icon () {
479 function authorLink ($rev) {
481 function diffLink ($rev) {
483 function historyLink ($rev) {
485 function summaryAsHTML ($rev) {
487 function description () {
489 function format ($changes) {
490 include_once('lib/InlineParser.php');
495 $sp = HTML::Raw('· ');
496 while ($rev = $changes->next()) {
497 // enforce view permission
498 if (mayAccessPage('view',$rev->_pagename)) {
499 $html->pushContent($sp,$this->pageLink($rev),HTML::br());
501 $this->setValidators($rev);
506 $html->pushContent(HTML::p(array('class' => 'rc-empty'),
507 $this->empty_message()));
512 class _RecentChanges_RssFormatter
513 extends _RecentChanges_Formatter
515 var $_absurls = true;
517 function time ($rev) {
518 return Iso8601DateTime($rev->get('mtime'));
521 function pageURI ($rev) {
522 return WikiURL($rev, '', 'absurl');
525 function format ($changes) {
527 include_once('lib/RssWriter.php');
528 $rss = new RssWriter;
531 $rss->channel($this->channel_properties());
533 if (($props = $this->image_properties()))
535 if (($props = $this->textinput_properties()))
536 $rss->textinput($props);
539 while ($rev = $changes->next()) {
540 // enforce view permission
541 if (mayAccessPage('view',$rev->_pagename)) {
542 $rss->addItem($this->item_properties($rev),
543 $this->pageURI($rev));
545 $this->setValidators($rev);
551 $request->discardOutput();
553 printf("\n<!-- Generated by PhpWiki:\n%s-->\n", $GLOBALS['RCS_IDS']);
555 // Flush errors in comment, otherwise it's invalid XML.
556 global $ErrorManager;
557 if (($errors = $ErrorManager->getPostponedErrorsAsHTML()))
558 printf("\n<!-- PHP Warnings:\n%s-->\n", AsXML($errors));
560 $request->finish(); // NORETURN!!!!
563 function image_properties () {
566 $img_url = AbsoluteURL($Theme->getImageURL('logo'));
570 return array('title' => WIKI_NAME,
571 'link' => WikiURL(HOME_PAGE, false, 'absurl'),
575 function textinput_properties () {
576 return array('title' => _("Search"),
577 'description' => _("Title Search"),
579 'link' => WikiURL(_("TitleSearch"), false, 'absurl'));
582 function channel_properties () {
585 $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl');
587 return array('title' => WIKI_NAME,
589 'description' => _("RecentChanges"),
590 'dc:date' => Iso8601DateTime(time()));
592 /* FIXME: other things one might like in <channel>:
601 * rss091:managingEditor
603 * rss091:lastBuildDate
611 function item_properties ($rev) {
612 $page = $rev->getPage();
613 $pagename = $page->getName();
615 return array( 'title' => split_pagename($pagename),
616 'description' => $this->summary($rev),
617 'link' => $this->pageURL($rev),
618 'dc:date' => $this->time($rev),
619 'dc:contributor' => $rev->get('author'),
620 'wiki:version' => $rev->getVersion(),
621 'wiki:importance' => $this->importance($rev),
622 'wiki:status' => $this->status($rev),
623 'wiki:diff' => $this->diffURL($rev),
624 'wiki:history' => $this->historyURL($rev)
629 class NonDeletedRevisionIterator extends WikiDB_PageRevisionIterator
633 * @param $revisions object a WikiDB_PageRevisionIterator.
635 function NonDeletedRevisionIterator ($revisions, $check_current_revision = true) {
636 $this->_revisions = $revisions;
637 $this->_check_current_revision = $check_current_revision;
641 while (($rev = $this->_revisions->next())) {
642 if ($this->_check_current_revision) {
643 $page = $rev->getPage();
644 $check_rev = $page->getCurrentRevision();
649 if (! $check_rev->hasDefaultContents())
658 class WikiPlugin_RecentChanges
661 function getName () {
662 return _("RecentChanges");
665 function getVersion() {
666 return preg_replace("/[Revision: $]/", '',
667 "\$Revision: 1.93 $");
670 function managesValidators() {
671 // Note that this is a bit of a fig.
672 // We set validators based on the most recently changed page,
673 // but this fails when the most-recent page is deleted.
674 // (Consider that the Last-Modified time will decrease
675 // when this happens.)
677 // We might be better off, leaving this as false (and junking
678 // the validator logic above) and just falling back to the
679 // default behavior (handled by WikiPlugin) of just using
680 // the WikiDB global timestamp as the mtime.
682 // Nevertheless, for now, I leave this here, mostly as an
683 // example for how to use appendValidators() and managesValidators().
688 function getDefaultArguments() {
689 return array('days' => 2,
690 'show_minor' => false,
691 'show_major' => true,
693 'show_deleted' => 'sometimes',
698 'historylinks' => false,
703 function getArgs ($argstr, $request, $defaults = false) {
704 $args = WikiPlugin::getArgs($argstr, $request, $defaults);
706 $action = $request->getArg('action');
707 if ($action != 'browse' && ! $request->isActionPage($action))
708 $args['format'] = false; // default -> HTML
710 if ($args['format'] == 'rss' && empty($args['limit']))
711 $args['limit'] = 15; // Fix default value for RSS.
713 if ($args['format'] == 'sidebar' && empty($args['limit']))
714 $args['limit'] = 10; // Fix default value for sidebar.
719 function getMostRecentParams ($args) {
722 $params = array('include_minor_revisions' => $show_minor,
723 'exclude_major_revisions' => !$show_major,
724 'include_all_revisions' => !empty($show_all));
726 $params['limit'] = $limit;
729 $params['since'] = time() - 24 * 3600 * $days;
731 $params['since'] = 24 * 3600 * $days - time();
736 function getChanges ($dbi, $args) {
737 $changes = $dbi->mostRecent($this->getMostRecentParams($args));
739 $show_deleted = $args['show_deleted'];
740 if ($show_deleted == 'sometimes')
741 $show_deleted = $args['show_minor'];
744 $changes = new NonDeletedRevisionIterator($changes, !$args['show_all']);
749 function format ($changes, $args) {
751 $format = $args['format'];
753 $fmt_class = $Theme->getFormatter('RecentChanges', $format);
755 if ($format == 'rss')
756 $fmt_class = '_RecentChanges_RssFormatter';
757 elseif ($format == 'rss091') {
758 include_once "lib/RSSWriter091.php";
759 $fmt_class = '_RecentChanges_RssFormatter091';
761 elseif ($format == 'sidebar')
762 $fmt_class = '_RecentChanges_SideBarFormatter';
763 elseif ($format == 'box')
764 $fmt_class = '_RecentChanges_BoxFormatter';
766 $fmt_class = '_RecentChanges_HtmlFormatter';
769 $fmt = new $fmt_class($args);
770 return $fmt->format($changes);
773 function run($dbi, $argstr, &$request, $basepage) {
774 $args = $this->getArgs($argstr, $request);
776 // HACKish: fix for SF bug #622784 (1000 years of RecentChanges ought
777 // to be enough for anyone.)
778 $args['days'] = min($args['days'], 365000);
780 // Hack alert: format() is a NORETURN for rss formatters.
781 return $this->format($this->getChanges($dbi, $args), $args);
784 // box is used to display a fixed-width, narrow version with common header.
785 // just a numbered list of limit pagenames, without date.
786 function box($args = false, $request = false, $basepage = false) {
787 if (!$request) $request =& $GLOBALS['request'];
788 if (!isset($args['limit'])) $args['limit'] = 15;
789 $args['format'] = 'box';
790 $args['show_minor'] = false;
791 $args['show_major'] = true;
792 $args['show_deleted'] = false;
793 $args['show_all'] = false;
795 return $this->makeBox(WikiLink(_("RecentChanges"),'',_("Recent Changes")),
796 $this->format($this->getChanges($request->_dbi, $args), $args));
802 class DayButtonBar extends HtmlElement {
804 function DayButtonBar ($plugin_args) {
805 $this->HtmlElement('p', array('class' => 'wiki-rc-action'));
807 // Display days selection buttons
808 extract($plugin_args);
813 $caption = _("Show minor edits for:");
815 $caption = _("Show all changes for:");
817 $caption = _("Show changes for:");
820 $this->pushContent($caption, ' ');
823 $sep = $Theme->getButtonSeparator();
826 foreach (explode(",", $daylist) as $days) {
828 $this->pushContent($sep);
829 $this->pushContent($this->_makeDayButton($days));
833 function _makeDayButton ($days) {
834 global $Theme, $request;
839 $label = "..."; //alldays
841 $label = sprintf(_("%s days"), abs($days));
843 $url = $request->getURLtoSelf(array('action' => 'browse', 'days' => $days));
845 return $Theme->makeButton($label, $url, 'wiki-rc-action');
849 // $Log: not supported by cvs2svn $
850 // Revision 1.92 2004/04/21 04:29:10 rurban
851 // Two convenient RecentChanges extensions
852 // RelatedChanges (only links from current page)
853 // RecentEdits (just change the default args)
855 // Revision 1.91 2004/04/19 18:27:46 rurban
856 // Prevent from some PHP5 warnings (ref args, no :: object init)
857 // php5 runs now through, just one wrong XmlElement object init missing
858 // Removed unneccesary UpgradeUser lines
859 // Changed WikiLink to omit version if current (RecentChanges)
861 // Revision 1.90 2004/04/18 01:11:52 rurban
862 // more numeric pagename fixes.
863 // fixed action=upload with merge conflict warnings.
864 // charset changed from constant to global (dynamic utf-8 switching)
866 // Revision 1.89 2004/04/10 02:30:49 rurban
867 // Fixed gettext problem with VIRTUAL_PATH scripts (Windows only probably)
868 // Fixed "cannot setlocale..." (sf.net problem)
870 // Revision 1.88 2004/04/01 15:57:10 rurban
871 // simplified Sidebar theme: table, not absolute css positioning
872 // added the new box methods.
873 // remaining problems: large left margin, how to override _autosplitWikiWords in Template only
875 // Revision 1.87 2004/03/30 02:14:03 rurban
876 // fixed yet another Prefs bug
877 // added generic PearDb_iter
878 // $request->appendValidators no so strict as before
879 // added some box plugin methods
880 // PageList commalist for condensed output
882 // Revision 1.86 2004/03/12 13:31:43 rurban
883 // enforce PagePermissions, errormsg if not Admin
885 // Revision 1.85 2004/02/17 12:11:36 rurban
886 // 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, ...)
888 // Revision 1.84 2004/02/15 22:29:42 rurban
889 // revert premature performance fix
891 // Revision 1.83 2004/02/15 21:34:37 rurban
892 // PageList enhanced and improved.
893 // fixed new WikiAdmin... plugins
894 // editpage, Theme with exp. htmlarea framework
895 // (htmlarea yet committed, this is really questionable)
896 // WikiUser... code with better session handling for prefs
897 // enhanced UserPreferences (again)
898 // RecentChanges for show_deleted: how should pages be deleted then?
900 // Revision 1.82 2004/01/25 03:58:43 rurban
901 // use stdlib:isWikiWord()
903 // Revision 1.81 2003/11/28 21:06:31 carstenklapp
904 // Enhancement: Mozilla RecentChanges sidebar now defaults to 10 changes
905 // instead of 1. Make diff buttons smaller with css. Added description
906 // line back in at the top.
908 // Revision 1.80 2003/11/27 15:17:01 carstenklapp
909 // Theme & appearance tweaks: Converted Mozilla sidebar link into a Theme
910 // button, to allow an image button for it to be added to Themes. Output
911 // RSS button in small text size when theme has no button image.
913 // Revision 1.79 2003/04/29 14:34:20 dairiki
914 // Bug fix: "add sidebar" link didn't work when USE_PATH_INFO was false.
916 // Revision 1.78 2003/03/04 01:55:05 dairiki
917 // Fix to ensure absolute URL for logo in RSS recent changes.
919 // Revision 1.77 2003/02/27 23:23:38 dairiki
920 // Fix my breakage of CSS and sidebar RecentChanges output.
922 // Revision 1.76 2003/02/27 22:48:44 dairiki
923 // Fixes invalid HTML generated by PageHistory plugin.
925 // (<noscript> is block-level and not allowed within <p>.)
927 // Revision 1.75 2003/02/22 21:39:05 dairiki
928 // Hackish fix for SF bug #622784.
930 // (The root of the problem is clearly a PHP bug.)
932 // Revision 1.74 2003/02/21 22:52:21 dairiki
933 // Make sure to interpret relative links (like [/Subpage]) in summary
934 // relative to correct basepage.
936 // Revision 1.73 2003/02/21 04:12:06 dairiki
937 // Minor fixes for new cached markup.
939 // Revision 1.72 2003/02/17 02:19:01 dairiki
940 // Fix so that PageHistory will work when the current revision
941 // of a page has been "deleted".
943 // Revision 1.71 2003/02/16 20:04:48 dairiki
944 // Refactor the HTTP validator generation/checking code.
946 // This also fixes a number of bugs with yesterdays validator mods.
948 // Revision 1.70 2003/02/16 05:09:43 dairiki
949 // Starting to fix handling of the HTTP validator headers, Last-Modified,
952 // Last-Modified was being set incorrectly (but only when DEBUG was not
953 // defined!) Setting a Last-Modified without setting an appropriate
954 // Expires: and/or Cache-Control: header results in browsers caching
955 // the page unconditionally (for a certain period of time).
956 // This is generally bad, since it means people don't see updated
957 // page contents right away --- this is particularly confusing to
958 // the people who are editing pages since their edits don't show up
959 // next time they browse the page.
961 // Now, we don't allow caching of pages without revalidation
962 // (via the If-Modified-Since and/or If-None-Match request headers.)
963 // (You can allow caching by defining CACHE_CONTROL_MAX_AGE to an
964 // appropriate value in index.php, but I advise against it.)
968 // o Even when request is aborted due to the content not being
969 // modified, we currently still do almost all the work involved
970 // in producing the page. So the only real savings from all
971 // this logic is in network bandwidth.
973 // o Plugins which produce "dynamic" output need to be inspected
974 // and made to call $request->addToETag() and
975 // $request->setModificationTime() appropriately, otherwise the
976 // page can change without the change being detected.
977 // This leads to stale pages in cache again...
979 // Revision 1.69 2003/01/18 22:01:43 carstenklapp
981 // Reformatting & tabs to spaces;
982 // Added copyleft, getVersion, getDescription, rcs_id.
985 // (c-file-style: "gnu")
990 // c-hanging-comment-ender-p: nil
991 // indent-tabs-mode: nil