Index: trunk/phase3/includes/Skin.php |
— | — | @@ -1204,8 +1204,11 @@ |
1205 | 1205 | |
1206 | 1206 | function lastModified() { |
1207 | 1207 | global $wgLang, $wgArticle; |
1208 | | - |
1209 | | - $timestamp = $wgArticle->getTimestamp(); |
| 1208 | + if( $this->mRevisionId ) { |
| 1209 | + $timestamp = Revision::getTimestampFromId( $this->mRevisionId, $wgArticle->getId() ); |
| 1210 | + } else { |
| 1211 | + $timestamp = $wgArticle->getTimestamp(); |
| 1212 | + } |
1210 | 1213 | if ( $timestamp ) { |
1211 | 1214 | $d = $wgLang->date( $timestamp, true ); |
1212 | 1215 | $t = $wgLang->time( $timestamp, true ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | $wgExtensionCredits['specialpage'][] = array( |
26 | 26 | 'name' => 'Flagged Revisions', |
27 | 27 | 'author' => array( 'Aaron Schulz', 'Joerg Baach' ), |
28 | | - 'version' => '1.09', |
| 28 | + 'version' => '1.091', |
29 | 29 | 'url' => 'http://www.mediawiki.org/wiki/Extension:FlaggedRevs', |
30 | 30 | 'descriptionmsg' => 'flaggedrevs-desc', |
31 | 31 | ); |
— | — | @@ -201,6 +201,7 @@ |
202 | 202 | # Flagged revisions are always visible to users with rights below. |
203 | 203 | # Use '*' for non-user accounts. |
204 | 204 | $wgFlaggedRevsVisible = array(); |
| 205 | +# If $wgFlaggedRevsVisible is populated, it is applied to talk pages too |
205 | 206 | $wgFlaggedRevsTalkVisible = true; |
206 | 207 | |
207 | 208 | # End of configuration variables. |
— | — | @@ -280,7 +281,6 @@ |
281 | 282 | # Check on undelete/merge/revisiondelete for changes to stable version |
282 | 283 | $wgHooks['ArticleRevisionVisiblitySet'][] = 'FlaggedRevs::titleLinksUpdate'; |
283 | 284 | $wgHooks['ArticleMergeComplete'][] = 'FlaggedRevs::updateFromMerge'; |
284 | | -# Clean up after undeletion |
285 | 285 | $wgHooks['ArticleRevisionUndeleted'][] = 'FlaggedRevs::updateFromRestore'; |
286 | 286 | # Parser hooks, selects the desired images/templates |
287 | 287 | $wgHooks['ParserClearState'][] = 'FlaggedRevs::parserAddFields'; |
— | — | @@ -297,17 +297,13 @@ |
298 | 298 | $wgHooks['userCan'][] = 'FlaggedRevs::userCanMove'; |
299 | 299 | # Log parameter |
300 | 300 | $wgHooks['LogLine'][] = 'FlaggedRevs::reviewLogLine'; |
301 | | -# Disable auto-promotion |
| 301 | +# Disable auto-promotion for demoted users |
302 | 302 | $wgHooks['UserRights'][] = 'FlaggedRevs::recordDemote'; |
303 | 303 | # Local user account preference |
304 | 304 | $wgHooks['RenderPreferencesForm'][] = 'FlaggedRevs::injectPreferences'; |
305 | 305 | $wgHooks['InitPreferencesForm'][] = 'FlaggedRevs::injectFormPreferences'; |
306 | 306 | $wgHooks['ResetPreferences'][] = 'FlaggedRevs::resetPreferences'; |
307 | 307 | $wgHooks['SavePreferences'][] = 'FlaggedRevs::savePreferences'; |
308 | | -# Special page CSS |
309 | | -$wgHooks['BeforePageDisplay'][] = 'FlaggedRevs::InjectStyleForSpecial'; |
310 | | -# Image version display |
311 | | -$wgHooks['ImagePageFindFile'][] = 'FlaggedRevs::imagePageFindFile'; |
312 | 308 | # Show unreviewed pages links |
313 | 309 | $wgHooks['CategoryPageView'][] = 'FlaggedRevs::unreviewedPagesLinks'; |
314 | 310 | # Backlog notice |
— | — | @@ -318,19 +314,15 @@ |
319 | 315 | |
320 | 316 | # Override current revision, add patrol links, set cache... |
321 | 317 | $wgHooks['ArticleViewHeader'][] = 'FlaggedRevs::onArticleViewHeader'; |
| 318 | +$wgHooks['ImagePageFindFile'][] = 'FlaggedRevs::imagePageFindFile'; |
322 | 319 | # Override redirect behavoir... |
323 | 320 | $wgHooks['InitializeArticleMaybeRedirect'][] = 'FlaggedRevs::overrideRedirect'; |
324 | 321 | # Sets tabs and permalink |
325 | 322 | $wgHooks['SkinTemplateTabs'][] = 'FlaggedRevs::setActionTabs'; |
326 | | -# Change last-modified footer |
327 | | -$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'FlaggedRevs::setLastModified'; |
328 | | -# Add page notice |
329 | | -$wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink'][] = 'FlaggedRevs::setPermaLink'; |
330 | 323 | # Add tags do edit view |
331 | 324 | $wgHooks['EditPage::showEditForm:initial'][] = 'FlaggedRevs::addToEditView'; |
332 | | -# Add review form |
333 | | -$wgHooks['BeforePageDisplay'][] = 'FlaggedRevs::addReviewForm'; |
334 | | -$wgHooks['BeforePageDisplay'][] = 'FlaggedRevs::addVisibilityLink'; |
| 325 | +# Add review form and visiblity settings link |
| 326 | +$wgHooks['BeforePageDisplay'][] = 'FlaggedRevs::onBeforePageDisplay'; |
335 | 327 | # Mark of items in page history |
336 | 328 | $wgHooks['PageHistoryPager::getQueryInfo'][] = 'FlaggedRevs::addToHistQuery'; |
337 | 329 | $wgHooks['PageHistoryLineEnding'][] = 'FlaggedRevs::addToHistLine'; |
— | — | @@ -341,10 +333,12 @@ |
342 | 334 | $wgHooks['DiffViewHeader'][] = 'FlaggedRevs::onDiffViewHeader'; |
343 | 335 | # Autoreview stuff |
344 | 336 | $wgHooks['EditPage::showEditForm:fields'][] = 'FlaggedRevs::addRevisionIDField'; |
345 | | -# Add CSS/JS |
| 337 | + |
| 338 | +# Add CSS/JS as needed |
346 | 339 | $wgHooks['OutputPageParserOutput'][] = 'FlaggedRevs::injectStyleAndJS'; |
347 | 340 | $wgHooks['EditPage::showEditForm:initial'][] = 'FlaggedRevs::injectStyleAndJS'; |
348 | 341 | $wgHooks['PageHistoryBeforeList'][] = 'FlaggedRevs::injectStyleAndJS'; |
| 342 | +$wgHooks['BeforePageDisplay'][] = 'FlaggedRevs::InjectStyleForSpecial'; |
349 | 343 | |
350 | 344 | # Set aliases |
351 | 345 | $wgHooks['LanguageGetSpecialPageAliases'][] = 'FlaggedRevs::addLocalizedSpecialPageNames'; |
— | — | @@ -381,6 +375,7 @@ |
382 | 376 | # B/C ... |
383 | 377 | $wgLogActions['rights/erevoke'] = 'rights-editor-revoke'; |
384 | 378 | |
| 379 | +# Schema changes |
385 | 380 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efFlaggedRevsSchemaUpdates'; |
386 | 381 | |
387 | 382 | function efFlaggedRevsSchemaUpdates() { |
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -1387,72 +1387,6 @@ |
1388 | 1388 | } |
1389 | 1389 | return true; |
1390 | 1390 | } |
1391 | | - |
1392 | | - /** |
1393 | | - * Set permalink to stable version if we are viewing a stable version. |
1394 | | - * Also sets the citation link if that extension is on. |
1395 | | - */ |
1396 | | - public function setPermaLink( $skin, &$navUrls, &$revId, &$id ) { |
1397 | | - # Non-content pages cannot be validated |
1398 | | - if( !$this->pageOverride() ) |
1399 | | - return true; |
1400 | | - # Check for an overridabe revision |
1401 | | - $frev = $this->getStableRev( true ); |
1402 | | - if( !$frev ) |
1403 | | - return true; |
1404 | | - # Replace "permalink" with an actual permanent link |
1405 | | - $navUrls['permalink'] = array( |
1406 | | - 'text' => wfMsg( 'permalink' ), |
1407 | | - 'href' => $this->parent->getTitle()->getFullURL( "stableid={$frev->getRevId()}" ) |
1408 | | - ); |
1409 | | - # Are we using the popular cite extension? |
1410 | | - global $wgHooks; |
1411 | | - if( in_array('wfSpecialCiteNav',$wgHooks['SkinTemplateBuildNavUrlsNav_urlsAfterPermalink']) ) { |
1412 | | - if( $this->isReviewable() && $revId !== 0 ) { |
1413 | | - $navUrls['cite'] = array( |
1414 | | - 'text' => wfMsg( 'cite_article_link' ), |
1415 | | - 'href' => $skin->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$skin->thispage}" ) . "&id={$frev->getRevId()}" ) |
1416 | | - ); |
1417 | | - } |
1418 | | - } |
1419 | | - return true; |
1420 | | - } |
1421 | | - |
1422 | | - /** |
1423 | | - * If viewing a stable version, adjust the last modified header |
1424 | | - */ |
1425 | | - public function setLastModified( $skin, &$tpl ) { |
1426 | | - global $wgLang, $wgRequest; |
1427 | | - # Non-content pages cannot be validated |
1428 | | - if( !$this->isReviewable() ) |
1429 | | - return true; |
1430 | | - # Old stable versions |
1431 | | - if( $wgRequest->getIntOrNull('stableid') ) { |
1432 | | - $tpl->set('lastmod', false); |
1433 | | - return true; |
1434 | | - } |
1435 | | - # Check for an overridabe revision |
1436 | | - if( !$this->pageOverride() ) |
1437 | | - return true; |
1438 | | - $frev = $this->getStableRev( true ); |
1439 | | - if( !$frev || $frev->getRevId() == $this->parent->getLatest() ) |
1440 | | - return true; |
1441 | | - # Get the timestamp of this revision |
1442 | | - $timestamp = $frev->getRevTimestamp(); |
1443 | | - if( $timestamp ) { |
1444 | | - $d = $wgLang->date( $timestamp, true ); |
1445 | | - $t = $wgLang->time( $timestamp, true ); |
1446 | | - $s = ' ' . wfMsg( 'lastmodifiedat', $d, $t ); |
1447 | | - } else { |
1448 | | - $s = ''; |
1449 | | - } |
1450 | | - if( wfGetLB()->getLaggedSlaveMode() ) { |
1451 | | - $s .= ' <strong>' . wfMsg( 'laggedslavemode' ) . '</strong>'; |
1452 | | - } |
1453 | | - $tpl->set( 'lastmod', $s ); |
1454 | | - |
1455 | | - return true; |
1456 | | - } |
1457 | 1391 | |
1458 | 1392 | /** |
1459 | 1393 | * Updates parser cache output to included needed versioning params. |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1985,7 +1985,7 @@ |
1986 | 1986 | return true; |
1987 | 1987 | } |
1988 | 1988 | |
1989 | | - static function setActionTabs( $skin, &$contentActions ) { |
| 1989 | + public static function setActionTabs( $skin, &$contentActions ) { |
1990 | 1990 | $fa = FlaggedArticle::getGlobalInstance(); |
1991 | 1991 | if ( $fa ) { |
1992 | 1992 | $fa->setActionTabs( $skin, $contentActions ); |
— | — | @@ -1993,15 +1993,7 @@ |
1994 | 1994 | return true; |
1995 | 1995 | } |
1996 | 1996 | |
1997 | | - static function setLastModified( $skin, &$tpl ) { |
1998 | | - $fa = FlaggedArticle::getGlobalInstance(); |
1999 | | - if ( $fa ) { |
2000 | | - $fa->setLastModified( $skin, $tpl ); |
2001 | | - } |
2002 | | - return true; |
2003 | | - } |
2004 | | - |
2005 | | - static function onArticleViewHeader( $article, &$outputDone, &$pcache ) { |
| 1997 | + public static function onArticleViewHeader( $article, &$outputDone, &$pcache ) { |
2006 | 1998 | $flaggedArticle = FlaggedArticle::getInstance( $article ); |
2007 | 1999 | $flaggedArticle->maybeUpdateMainCache( $outputDone, $pcache ); |
2008 | 2000 | $flaggedArticle->addStableLink( $outputDone, $pcache ); |
— | — | @@ -2010,7 +2002,7 @@ |
2011 | 2003 | return true; |
2012 | 2004 | } |
2013 | 2005 | |
2014 | | - static function overrideRedirect( &$title, $request, &$ignoreRedirect, &$target ) { |
| 2006 | + public static function overrideRedirect( &$title, $request, &$ignoreRedirect, &$target ) { |
2015 | 2007 | if( $request->getVal( 'stableid' ) ) { |
2016 | 2008 | $ignoreRedirect = true; |
2017 | 2009 | } else { |
— | — | @@ -2029,39 +2021,24 @@ |
2030 | 2022 | return true; |
2031 | 2023 | } |
2032 | 2024 | |
2033 | | - static function setPermaLink( $skin, &$navUrls, &$revId, &$id ) { |
2034 | | - $fa = FlaggedArticle::getGlobalInstance(); |
2035 | | - if ( $fa ) { |
2036 | | - $fa->setPermaLink( $skin, $navUrls, $revId, $id ); |
2037 | | - } |
2038 | | - return true; |
2039 | | - } |
2040 | | - |
2041 | | - static function addToEditView( $editPage ) { |
| 2025 | + public static function addToEditView( $editPage ) { |
2042 | 2026 | return FlaggedArticle::getInstance( $editPage->mArticle )->addToEditView( $editPage ); |
2043 | 2027 | } |
2044 | 2028 | |
2045 | | - static function unreviewedPagesLinks( $category ) { |
| 2029 | + public static function unreviewedPagesLinks( $category ) { |
2046 | 2030 | return FlaggedArticle::getInstance( $category )->addToCategoryView(); |
2047 | 2031 | } |
2048 | 2032 | |
2049 | | - static function addReviewForm( $out ) { |
| 2033 | + public static function onBeforePageDisplay( $out ) { |
2050 | 2034 | $fa = FlaggedArticle::getGlobalInstance(); |
2051 | 2035 | if ( $fa && $out->isArticleRelated() ) { |
2052 | 2036 | $fa->addReviewForm( $out ); |
2053 | | - } |
2054 | | - return true; |
2055 | | - } |
2056 | | - |
2057 | | - static function addVisibilityLink( $out ) { |
2058 | | - $fa = FlaggedArticle::getGlobalInstance(); |
2059 | | - if ( $fa && $out->isArticleRelated() ) { |
2060 | 2037 | $fa->addVisibilityLink( $out ); |
2061 | 2038 | } |
2062 | 2039 | return true; |
2063 | 2040 | } |
2064 | 2041 | |
2065 | | - static function addToHistQuery( $pager, &$queryInfo ) { |
| 2042 | + public static function addToHistQuery( $pager, &$queryInfo ) { |
2066 | 2043 | $flaggedArticle = FlaggedArticle::getTitleInstance( $pager->mPageHistory->getTitle() ); |
2067 | 2044 | if( $flaggedArticle->isReviewable() ) { |
2068 | 2045 | $queryInfo['tables'][] = 'flaggedrevs'; |
— | — | @@ -2072,7 +2049,7 @@ |
2073 | 2050 | return true; |
2074 | 2051 | } |
2075 | 2052 | |
2076 | | - static function addToFileHistQuery( $file, &$tables, &$fields, &$conds, &$opts, &$join_conds ) { |
| 2053 | + public static function addToFileHistQuery( $file, &$tables, &$fields, &$conds, &$opts, &$join_conds ) { |
2077 | 2054 | if( $file->isLocal() ) { |
2078 | 2055 | $tables[] = 'flaggedrevs'; |
2079 | 2056 | $fields[] = 'fr_quality'; |
— | — | @@ -2081,19 +2058,19 @@ |
2082 | 2059 | return true; |
2083 | 2060 | } |
2084 | 2061 | |
2085 | | - static function addToHistLine( $history, $row, &$s ) { |
| 2062 | + public static function addToHistLine( $history, $row, &$s ) { |
2086 | 2063 | return FlaggedArticle::getInstance( $history->getArticle() )->addToHistLine( $history, $row, $s ); |
2087 | 2064 | } |
2088 | 2065 | |
2089 | | - static function addToFileHistLine( $hist, $file, &$s, &$rowClass ) { |
| 2066 | + public static function addToFileHistLine( $hist, $file, &$s, &$rowClass ) { |
2090 | 2067 | return FlaggedArticle::getInstance( $hist->getImagePage() )->addToFileHistLine( $hist, $file, $s, $rowClass ); |
2091 | 2068 | } |
2092 | 2069 | |
2093 | | - static function injectReviewDiffURLParams( $article, &$sectionAnchor, &$extraQuery ) { |
| 2070 | + public static function injectReviewDiffURLParams( $article, &$sectionAnchor, &$extraQuery ) { |
2094 | 2071 | return FlaggedArticle::getInstance( $article )->injectReviewDiffURLParams( $sectionAnchor, $extraQuery ); |
2095 | 2072 | } |
2096 | 2073 | |
2097 | | - static function onDiffViewHeader( $diff, $oldRev, $newRev ) { |
| 2074 | + public static function onDiffViewHeader( $diff, $oldRev, $newRev ) { |
2098 | 2075 | self::injectStyleAndJS(); |
2099 | 2076 | $flaggedArticle = FlaggedArticle::getTitleInstance( $diff->getTitle() ); |
2100 | 2077 | $flaggedArticle->addPatrolAndDiffLink( $diff, $oldRev, $newRev ); |
— | — | @@ -2101,11 +2078,11 @@ |
2102 | 2079 | return true; |
2103 | 2080 | } |
2104 | 2081 | |
2105 | | - static function addRevisionIDField( $editPage, $out ) { |
| 2082 | + public static function addRevisionIDField( $editPage, $out ) { |
2106 | 2083 | return FlaggedArticle::getInstance( $editPage->mArticle )->addRevisionIDField( $editPage, $out ); |
2107 | 2084 | } |
2108 | 2085 | |
2109 | | - static function addBacklogNotice( &$notice ) { |
| 2086 | + public static function addBacklogNotice( &$notice ) { |
2110 | 2087 | global $wgUser, $wgTitle, $wgFlaggedRevsBacklog; |
2111 | 2088 | $watchlist = SpecialPage::getTitleFor( 'Watchlist' ); |
2112 | 2089 | $recentchanges = SpecialPage::getTitleFor( 'Recentchanges' ); |
— | — | @@ -2120,7 +2097,7 @@ |
2121 | 2098 | return true; |
2122 | 2099 | } |
2123 | 2100 | |
2124 | | - static function addLocalizedSpecialPageNames( &$extendedSpecialPageAliases, $code ) { |
| 2101 | + public static function addLocalizedSpecialPageNames( &$extendedSpecialPageAliases, $code ) { |
2125 | 2102 | wfLoadExtensionMessages( 'FlaggedRevsAliases' ); |
2126 | 2103 | # The localized title of the special page is among the messages of the extension: |
2127 | 2104 | $specialPages = array( 'QualityOversight', 'DepreciationOversight', 'UnreviewedPages', |