Will be null on previewing a page being created.
* (bug 37627) UserNotLoggedIn() exception to show a generic error page whenever
a user is not logged in.
+* Watched status in changes lists are no longer indicated by <strong></strong>
+ tags with class "mw-watched". Instead, each line now has a class
+ "mw-changeslist-line-watched" or "mw-changeslist-line-not-watched", and the
+ title itself is surrounded by <span></span> tags with class "mw-title".
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
$this->rcCacheIndex = 0;
$this->lastdate = '';
$this->rclistOpen = false;
+ $this->getOutput()->addModuleStyles( 'mediawiki.special.changeslist' );
return '';
}
if( $this->isDeleted($rc,Revision::DELETED_TEXT) ) {
$articlelink = '<span class="history-deleted">' . $articlelink . '</span>';
}
- # Bolden pages watched by this user
- if( $watched ) {
- $articlelink = "<strong class=\"mw-watched\">{$articlelink}</strong>";
- }
+ # To allow for boldening pages watched by this user
+ $articlelink = "<span class=\"mw-title\">{$articlelink}</span>";
# RTL/LTR marker
$articlelink .= $this->getLanguage()->getDirMark();
}
}
+ // Indicate watched status on the line to allow for more
+ // comprehensive styling.
+ $classes[] = $watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
+
// Moved pages (very very old, not supported anymore)
if( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) {
// Log entries
wfProfileIn( __METHOD__ );
# Add the namespace and title of the block as part of the class
+ $classes = array( 'mw-collapsible', 'mw-collapsed', 'mw-enhanced-rc' );
if ( $block[0]->mAttribs['rc_log_type'] ) {
# Log entry
- $classes = 'mw-collapsible mw-collapsed mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-log-'
+ $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
. $block[0]->mAttribs['rc_log_type'] . '-' . $block[0]->mAttribs['rc_title'] );
} else {
- $classes = 'mw-collapsible mw-collapsed mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-ns'
+ $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns'
. $block[0]->mAttribs['rc_namespace'] . '-' . $block[0]->mAttribs['rc_title'] );
}
+ $classes[] = $block[0]->watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
$r = Html::openElement( 'table', array( 'class' => $classes ) ) .
Html::openElement( 'tr' );
$type = $rcObj->mAttribs['rc_type'];
$logType = $rcObj->mAttribs['rc_log_type'];
+ $classes = array( 'mw-enhanced-rc' );
if( $logType ) {
# Log entry
- $classes = 'mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-log-'
+ $classes[] = Sanitizer::escapeClass( 'mw-changeslist-log-'
. $logType . '-' . $rcObj->mAttribs['rc_title'] );
} else {
- $classes = 'mw-enhanced-rc ' . Sanitizer::escapeClass( 'mw-changeslist-ns' .
+ $classes[] = Sanitizer::escapeClass( 'mw-changeslist-ns' .
$rcObj->mAttribs['rc_namespace'] . '-' . $rcObj->mAttribs['rc_title'] );
}
+ $classes[] = $rcObj->watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
$r = Html::openElement( 'table', array( 'class' => $classes ) ) .
Html::openElement( 'tr' );
/**
* Class to expand PHP execution time for a function call.
+ * Use this when performing changes that should not be interrupted.
+ *
* On construction, set_time_limit() is called and set to $seconds.
+ * If the client aborts the connection, PHP will continue to run.
* When the object goes out of scope, the timer is restarted, with
* the original time limit minus the time the object existed.
*/
class ScopedPHPTimeout {
protected $startTime; // float; seconds
protected $oldTimeout; // integer; seconds
+ protected $oldIgnoreAbort; // boolean
protected static $stackDepth = 0; // integer
protected static $totalCalls = 0; // integer
} elseif ( self::$stackDepth > 0 ) { // recursion guard
trigger_error( "Resursive invocation of " . __CLASS__ . " attempted." );
} else {
+ $this->oldIgnoreAbort = ignore_user_abort( true );
$this->oldTimeout = ini_set( 'max_execution_time', $seconds );
$this->startTime = microtime( true );
++self::$stackDepth;
// take some measures to prevent this. Track total time and calls.
self::$totalElapsed += $elapsed;
--self::$stackDepth;
+ ignore_user_abort( $this->oldIgnoreAbort );
}
}
}
if ( $notificationtimestamp && ( $row->rev_timestamp >= $notificationtimestamp ) ) {
$s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
+ $classes[] = 'mw-history-line-updated';
}
$tools = array();
* @return int
*/
function userAdjust( $ts, $tz = false ) {
- global $wgUser, $wgLocaltimezone, $wgLocalTZoffset;
+ global $wgUser, $wgLocalTZoffset;
if ( $tz === false ) {
$tz = $wgUser->getOption( 'timecorrection' );
$data = explode( '|', $tz, 3 );
- if ( $data[0] == 'System' || $tz == '' ) {
- # Global timezone
- if ( isset( $wgLocaltimezone ) ) {
- $data[0] = 'ZoneInfo';
- $data[2] = $wgLocaltimezone;
- }
- # Global offset in minutes.
- if ( isset( $wgLocalTZoffset ) ) {
- $data[1] = $wgLocalTZoffset;
- }
- }
-
if ( $data[0] == 'ZoneInfo' ) {
wfSuppressWarnings();
$userTZ = timezone_open( $data[2] );
}
$minDiff = 0;
- if ( $data[0] == 'Offset' ) {
+ if ( $data[0] == 'System' || $tz == '' ) {
+ # Global offset in minutes.
+ if ( isset( $wgLocalTZoffset ) ) {
+ $minDiff = $wgLocalTZoffset;
+ }
+ } elseif ( $data[0] == 'Offset' ) {
$minDiff = intval( $data[1] );
} else {
$data = explode( ':', $tz );
'version-svn-revision' => '(r$2)', # only translate this message to other languages if you have to change it
'version-license' => 'License',
'version-poweredby-credits' => "This wiki is powered by '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
-'version-poweredby-others' => 'others',
+'version-poweredby-others' => '[{{SERVER}}{{SCRIPTPATH}}/CREDITS others]',
'version-license-info' => 'MediaWiki is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
MediaWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
/* @embed */
background: url(images/arrow-expanded.png) no-repeat left center;
}
+
+.mw-changeslist-line-watched .mw-title {
+ font-weight: bold;
+}
<?php
class TimeAdjustTest extends MediaWikiLangTestCase {
- static $offset, $timezone;
+ static $offset;
public function setUp() {
parent::setUp();
- global $wgLocalTZoffset, $wgLocaltimezone;
+ global $wgLocalTZoffset;
self::$offset = $wgLocalTZoffset;
- self::$timezone = $wgLocaltimezone;
$this->iniSet( 'precision', 15 );
}
public function tearDown() {
- global $wgLocalTZoffset, $wgLocaltimezone;
+ global $wgLocalTZoffset;
$wgLocalTZoffset = self::$offset;
- $wgLocaltimezone = self::$timezone;
parent::tearDown();
}
- /**
- * Test offset usage for a given language::userAdjust
- * @dataProvider dataUserAdjustWithOffset
- */
- function testUserAdjustWithOffset( $inputDate, $offset, $expectedDate ) {
- global $wgLocalTZoffset, $wgLocaltimezone, $wgContLang;
+ # Test offset usage for a given language::userAdjust
+ function testUserAdjust() {
+ global $wgLocalTZoffset, $wgContLang;
$wgContLang = $en = Language::factory( 'en' );
- $wgLocaltimezone = 'DummyTimezoneSoUserAdjustWillUseTzOffset';
- $wgLocalTZoffset = $offset;
-
- $this->assertEquals(
- strval( $expectedDate ),
- strval( $en->userAdjust( $inputDate, '' ) ),
- "User adjust {$inputDate} by {$offset} minutes should give {$expectedDate}"
- );
- }
-
- function dataUserAdjustWithOffset() {
# Collection of parameters for Language_t_Offset.
# Format: date to be formatted, localTZoffset value, expected date
- return array(
+ $userAdjust_tests = array(
array( 20061231235959, 0, 20061231235959 ),
array( 20061231235959, 5, 20070101000459 ),
array( 20061231235959, 15, 20070101001459 ),
array( 20061231235959, -30, 20061231232959 ),
array( 20061231235959, -60, 20061231225959 ),
);
- }
-
- /**
- * Test timezone usage for a given language::userAdjust
- * @dataProvider dataUserAdjustWithTimezone
- */
- function testUserAdjustWithTimezone( $inputDate, $timezone, $expectedDate ) {
- global $wgLocalTZoffset, $wgLocaltimezone;
- $wgContLang = $en = Language::factory( 'en' );
+ foreach ( $userAdjust_tests as $data ) {
+ $wgLocalTZoffset = $data[1];
- $wgLocaltimezone = $timezone;
- $wgLocalTZoffset = 0;
-
- $this->assertEquals(
- strval( $expectedDate ),
- strval( $en->userAdjust( $inputDate, '' ) ),
- "User adjust {$inputDate} with timezone {$timezone} should give {$expectedDate}"
- );
- }
-
- function dataUserAdjustWithTimezone() {
- return array(
- array( 20111028233711, 'Europe/Warsaw', 20111029013711 ),
- array( 20111108205929, 'Europe/Warsaw', 20111108215929 ),
- );
+ $this->assertEquals(
+ strval( $data[2] ),
+ strval( $en->userAdjust( $data[0], '' ) ),
+ "User adjust {$data[0]} by {$data[1]} minutes should give {$data[2]}"
+ );
+ }
}
-
}
// quickUserCan should ignore user blocks
$this->assertEquals( true, $this->title->quickUserCan( 'move-target' ) );
- global $wgLocalTZoffset, $wgLocaltimezone;
+ global $wgLocalTZoffset;
$wgLocalTZoffset = -60;
- $wgLocaltimezone = 'DummyTimezoneSoUserAdjustWillUseTzOffset';
-
$this->user->mBlockedby = $this->user->getName();
$this->user->mBlock = new Block( '127.0.8.1', 0, 1, 'no reason given', $now, 0, 10 );
$this->assertEquals( array( array( 'blockedtext',