* Group log output by date
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 16 Jun 2007 16:45:36 +0000 (16:45 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 16 Jun 2007 16:45:36 +0000 (16:45 +0000)
* Use "all-logs-page" instead of "logs" for page which combines all logs

RELEASE-NOTES
includes/DefaultSettings.php
includes/SpecialLog.php
languages/messages/MessagesEn.php

index 062fc30..cf52d86 100644 (file)
@@ -85,6 +85,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 8458) Limit custom signature length to $wgMaxSigChars bytes
 * (bug 10096) Added an ability to query interwiki map table
 * On reupload, add a null revision to the image description page
+* Group log output by date
 
 == Bugfixes since 1.10 ==
 
index 0ecd8a0..253a87c 100644 (file)
@@ -2181,7 +2181,7 @@ $wgLogTypes = array( '',
  * Extensions with custom log types may add to this array.
  */
 $wgLogNames = array(
-       ''        => 'log',
+       ''        => 'all-logs-page',
        'block'   => 'blocklogpage',
        'protect' => 'protectlogpage',
        'rights'  => 'rightslog',
index f2400fe..0da3955 100644 (file)
@@ -322,13 +322,25 @@ class LogViewer {
        }
 
        function doShowList( &$out, $result ) {
+               global $wgLang;
+
+               $lastdate = '';
+               $listopen = false;
                // Rewind result pointer and go through it again, making the HTML
-               $html = "\n<ul>\n";
+               $html = '';
                $result->seek( 0 );
                while( $s = $result->fetchObject() ) {
-                       $html .= $this->logLine( $s );
+                       $date = $wgLang->date( $s->log_timestamp, /* adj */ true );
+                       if ( $date != $lastdate ) {
+                               if ( $listopen ) { $html .= Xml::closeElement( 'ul' ); }
+                               $html .= Xml::element('h4', null, $date) . "\n";
+                               $html .= Xml::openElement( 'ul' );
+                               $listopen = true;
+                               $lastdate = $date;
+                       }
+                       $html .= Xml::tags('li', null, $this->logLine( $s ) ) . "\n";
                }
-               $html .= "\n</ul>\n";
+               if ( $listopen ) { $html .= Xml::closeElement( 'ul' ); }
                $out->addHTML( $html );
                $result->free();
        }
@@ -346,7 +358,7 @@ class LogViewer {
                global $wgLang, $wgUser;;
                $skin = $wgUser->getSkin();
                $title = Title::makeTitle( $s->log_namespace, $s->log_title );
-               $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $s->log_timestamp), true );
+               $time = $wgLang->time( wfTimestamp(TS_MW, $s->log_timestamp), true );
 
                // Enter the existence or non-existence of this page into the link cache,
                // for faster makeLinkObj() in LogPage::actionText()
@@ -397,7 +409,7 @@ class LogViewer {
                }
 
                $action = LogPage::actionText( $s->log_type, $s->log_action, $title, $this->skin, $paramArray, true, true );
-               $out = "<li>$time $userLink $action $comment $revert</li>\n";
+               $out = "$time $userLink $action $comment $revert";
                return $out;
        }
 
index 9c29d25..7789ff7 100644 (file)
@@ -1628,6 +1628,7 @@ further information about books you are looking for:',
 'specialloguserlabel'  => 'User:',
 'speciallogtitlelabel' => 'Title:',
 'log'                  => 'Logs',
+'all-logs-page'        => 'All logs',
 'log-search-legend'    => 'Search for logs',
 'log-search-submit'    => 'Go',
 'alllogstext'          => 'Combined display of all available logs of {{SITENAME}}.