r23034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23033‎ | r23034 | r23035 >
Date:16:45, 16 June 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* Group log output by date
* Use "all-logs-page" instead of "logs" for page which combines all logs
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SpecialLog.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialLog.php
@@ -322,13 +322,25 @@
323323 }
324324
325325 function doShowList( &$out, $result ) {
 326+ global $wgLang;
 327+
 328+ $lastdate = '';
 329+ $listopen = false;
326330 // Rewind result pointer and go through it again, making the HTML
327 - $html = "\n<ul>\n";
 331+ $html = '';
328332 $result->seek( 0 );
329333 while( $s = $result->fetchObject() ) {
330 - $html .= $this->logLine( $s );
 334+ $date = $wgLang->date( $s->log_timestamp, /* adj */ true );
 335+ if ( $date != $lastdate ) {
 336+ if ( $listopen ) { $html .= Xml::closeElement( 'ul' ); }
 337+ $html .= Xml::element('h4', null, $date) . "\n";
 338+ $html .= Xml::openElement( 'ul' );
 339+ $listopen = true;
 340+ $lastdate = $date;
 341+ }
 342+ $html .= Xml::tags('li', null, $this->logLine( $s ) ) . "\n";
331343 }
332 - $html .= "\n</ul>\n";
 344+ if ( $listopen ) { $html .= Xml::closeElement( 'ul' ); }
333345 $out->addHTML( $html );
334346 $result->free();
335347 }
@@ -346,7 +358,7 @@
347359 global $wgLang, $wgUser;;
348360 $skin = $wgUser->getSkin();
349361 $title = Title::makeTitle( $s->log_namespace, $s->log_title );
350 - $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $s->log_timestamp), true );
 362+ $time = $wgLang->time( wfTimestamp(TS_MW, $s->log_timestamp), true );
351363
352364 // Enter the existence or non-existence of this page into the link cache,
353365 // for faster makeLinkObj() in LogPage::actionText()
@@ -397,7 +409,7 @@
398410 }
399411
400412 $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
401 - $out = "<li>$time $userLink $action $comment $revert</li>\n";
 413+ $out = "$time $userLink $action $comment $revert";
402414 return $out;
403415 }
404416
Index: trunk/phase3/includes/DefaultSettings.php
@@ -2181,7 +2181,7 @@
21822182 * Extensions with custom log types may add to this array.
21832183 */
21842184 $wgLogNames = array(
2185 - '' => 'log',
 2185+ '' => 'all-logs-page',
21862186 'block' => 'blocklogpage',
21872187 'protect' => 'protectlogpage',
21882188 'rights' => 'rightslog',
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1628,6 +1628,7 @@
16291629 'specialloguserlabel' => 'User:',
16301630 'speciallogtitlelabel' => 'Title:',
16311631 'log' => 'Logs',
 1632+'all-logs-page' => 'All logs',
16321633 'log-search-legend' => 'Search for logs',
16331634 'log-search-submit' => 'Go',
16341635 'alllogstext' => 'Combined display of all available logs of {{SITENAME}}.
Index: trunk/phase3/RELEASE-NOTES
@@ -85,6 +85,7 @@
8686 * (bug 8458) Limit custom signature length to $wgMaxSigChars bytes
8787 * (bug 10096) Added an ability to query interwiki map table
8888 * On reupload, add a null revision to the image description page
 89+* Group log output by date
8990
9091 == Bugfixes since 1.10 ==
9192

Follow-up revisions

RevisionCommit summaryAuthorDate
r23039Merged revisions 22967-23037 via svnmerge from...david20:15, 16 June 2007
r23494Revert r23034 for the moment; made it hard to clearly extract log line inform...brion21:02, 27 June 2007
r23581Merged revisions 23406-23580 via svnmerge from...david04:50, 30 June 2007

Status & tagging log