From: <var...@us...> - 2009-03-23 20:49:53
|
Revision: 6693 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6693&view=rev Author: vargenau Date: 2009-03-23 20:49:42 +0000 (Mon, 23 Mar 2009) Log Message: ----------- In case if null diff, give the reason: renaming or change of metadata Modified Paths: -------------- trunk/lib/diff.php trunk/lib/plugin/Diff.php Modified: trunk/lib/diff.php =================================================================== --- trunk/lib/diff.php 2009-03-23 19:47:25 UTC (rev 6692) +++ trunk/lib/diff.php 2009-03-23 20:49:42 UTC (rev 6693) @@ -375,19 +375,21 @@ if ($diff->isEmpty()) { $html->pushContent(HTML::hr(), - HTML::p('[', _("Versions are identical"), - ']')); - } - else { - // New CSS formatted unified diffs (ugly in NS4). + HTML::p(_("Content of versions "), $old->getVersion(), + _(" and "), $new->getVersion(), _(" is identical."))); + // If two consecutive versions have the same content, it is because the page was + // renamed, or metadata changed: ACL, owner, markup. + // We give the reason by printing the summary. + if (($new->getVersion() - $old->getVersion()) == 1) { + $html->pushContent(HTML::p(_("Version "), $new->getVersion(), + _(" was created because: "), $new->get('summary'))); + } + } else { $fmt = new HtmlUnifiedDiffFormatter; - - // Use this for old table-formatted diffs. - //$fmt = new TableUnifiedDiffFormatter; $html->pushContent($fmt->format($diff)); } - $html->pushContent(HTML::hr(), HTML::h1($new_version)); + $html->pushContent(HTML::hr(), HTML::h2($new_version)); require_once("lib/BlockParser.php"); $html->pushContent(TransformText($new,$new->get('markup'),$pagename)); } @@ -396,59 +398,6 @@ GeneratePage($html, sprintf(_("Diff: %s"), $pagename), $new); } -// $Log: not supported by cvs2svn $ -// Revision 1.54 2007/01/02 13:18:16 rurban -// omit want_content if not necessary -// -// Revision 1.53 2006/12/02 13:58:27 rurban -// Fix MonoBook layout (id content forbidden here) -// Add new revision to the bottom of the diff as in mediawiki. -// -// Revision 1.52 2005/04/01 14:45:14 rurban -// fix dirty side-effect: dont printf too early bypassing ob_buffering. -// fixes MSIE. -// -// Revision 1.51 2005/02/04 15:26:57 rurban -// need div=content for blog -// -// Revision 1.50 2005/02/04 13:44:45 rurban -// prevent from php5 nameclash -// -// Revision 1.49 2004/11/21 11:59:19 rurban -// remove final \n to be ob_cache independent -// -// Revision 1.48 2004/06/14 11:31:36 rurban -// renamed global $Theme to $WikiTheme (gforge nameclash) -// inherit PageList default options from PageList -// default sortby=pagename -// use options in PageList_Selectable (limit, sortby, ...) -// added action revert, with button at action=diff -// added option regex to WikiAdminSearchReplace -// -// Revision 1.47 2004/06/08 13:51:57 rurban -// some comments only -// -// Revision 1.46 2004/05/01 15:59:29 rurban -// nothing changed -// -// Revision 1.45 2004/01/25 03:57:15 rurban -// use isWikiWord() -// -// Revision 1.44 2003/02/17 02:17:31 dairiki -// Fix so that action=diff will work when the most recent version -// of a page has been "deleted". -// -// Revision 1.43 2003/01/29 19:17:37 carstenklapp -// Bugfix for   showing on diff page. -// -// Revision 1.42 2003/01/11 23:05:04 carstenklapp -// Tweaked diff formatting. -// -// Revision 1.41 2003/01/08 02:23:02 carstenklapp -// Don't perform a diff when the page doesn't exist (such as a -// nonexistant calendar day/sub-page) -// - // Local Variables: // mode: php // tab-width: 8 Modified: trunk/lib/plugin/Diff.php =================================================================== --- trunk/lib/plugin/Diff.php 2009-03-23 19:47:25 UTC (rev 6692) +++ trunk/lib/plugin/Diff.php 2009-03-23 20:49:42 UTC (rev 6693) @@ -179,10 +179,16 @@ if ($diff->isEmpty()) { $html->pushContent(HTML::hr(), - HTML::p('[', _("Versions are identical"), - ']')); + HTML::p(_("Content of versions "), $old->getVersion(), + _(" and "), $new->getVersion(), _(" is identical."))); + // If two consecutive versions have the same content, it is because the page was + // renamed, or metadata changed: ACL, owner, markup. + // We give the reason by printing the summary. + if (($new->getVersion() - $old->getVersion()) == 1) { + $html->pushContent(HTML::p(_("Version "), $new->getVersion(), + _(" was created because: "), $new->get('summary'))); + } } else { - // New CSS formatted unified diffs $fmt = new HtmlUnifiedDiffFormatter; $html->pushContent($fmt->format($diff)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |