From: Niklas Laxström Date: Sun, 6 Apr 2008 08:59:48 +0000 (+0000) Subject: * Logs are grouped under date headings similar to enhanced changes list X-Git-Tag: 1.31.0-rc.0~48590 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=8e310cb43c3bd97c3a73b74153029f5b4d173406;p=lhc%2Fweb%2Fwiklou.git * Logs are grouped under date headings similar to enhanced changes list * This is a second attempt; now with a configuration variable to restore the old behaviour without reverting --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3af299d2dd..dfb4b2cbb3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -28,6 +28,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Removed $wgAlternateMaster, use $wgLBFactoryConf * (bug 13562) Misspelled option $wgUserNotifedOnAllChanges changed to $wgUserNotifiedOnAllChanges +* $wgDateGroupedLogs can be set to false to restore old log formatting === New features in 1.13 === @@ -63,6 +64,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13490) Show upload/file size limit on upload form * Redesign of Special:Userrights * Make rev_deleted log entries more intelligible. +* Logs are grouped under date headings similar to enhanced changes list === Bug fixes in 1.13 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ca8065d102..4a142d4d34 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2493,6 +2493,11 @@ $wgLogActions = array( 'suppress/block' => 'blocklogentry', ); +/** + * Group logs under date headings similar to enhanced recent changes. + */ +$wgDateGroupedLogs = true; + /** * Experimental preview feature to fetch rendered text * over an XMLHttpRequest from JavaScript instead of diff --git a/includes/LogEventsList.php b/includes/LogEventsList.php index 28c61f156c..54ee58d8a4 100644 --- a/includes/LogEventsList.php +++ b/includes/LogEventsList.php @@ -136,13 +136,19 @@ class LogEventsList { private function getTitlePattern( $pattern ) { return Xml::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $pattern ); } + + + protected function getWrapperElement() { + global $wgDateGroupedLogs; + return $wgDateGroupedLogs ? 'div' : 'ul'; + } public function beginLogEventsList() { - return "\n"; + return Xml::closeElement( $this->getWrapperElement() ) . "\n"; } /** @@ -258,8 +264,24 @@ class LogEventsList { } else { $action = LogPage::actionText( $row->log_type, $row->log_action, $title, $this->skin, $paramArray, true ); } - - return "
  • $del$time $userLink $action $comment $revert
  • \n"; + + global $wgDateGroupedLogs; + if ( $wgDateGroupedLogs ) { + $time = $wgLang->time( wfTimestamp(TS_MW, $row->log_timestamp), true ); + $date = $wgLang->date( wfTimestamp(TS_MW, $row->log_timestamp), true ); + $line = Xml::tags('div', null, "$del$time $userLink $action $comment $revert" ); + + static $lastdate = false; + if ( $date !== $lastdate ) { + $lastdate = $date; + return Xml::element('h4', null, $date) . "\n" . $line; + } else { + return $line; + } + } else { + return Xml::tags('li', null, "$del$time $userLink $action $comment $revert" ); + } + } /**