http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66342
Revision: 66342 Author: aaron Date: 2010-05-13 13:51:30 +0000 (Thu, 13 May 2010) Log Message: ----------- MFT r66185-r66309 Modified Paths: -------------- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.class.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.hooks.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevsXML.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/client/flaggedrevs.js branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/ConfiguredPages.i18n.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/FlaggedRevs.i18n.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/Stabilization.i18n.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/ConfiguredPages_body.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/Stabilization_body.php branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/StablePages_body.php Removed Paths: ------------- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/UnstablePages_body.php Property Changed: ---------------- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/ Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha ___________________________________________________________________ Modified: svn:mergeinfo - /branches/REL1_15/phase3/extensions/FlaggedRevs_alpha:51646 /trunk/extensions/FlaggedRevs:63266-63443,63460-63926,63929,63938,63940-64497,64515-64768,64916-65417,65459-65601,65668-65727,65995 /trunk/extensions/FlaggedRevs_alpha:56207,56209,56296,56333,56355 /trunk/phase3/extensions/FlaggedRevs_alpha:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816 + /branches/REL1_15/phase3/extensions/FlaggedRevs_alpha:51646 /trunk/extensions/FlaggedRevs:63266-63443,63460-63926,63929,63938,63940-64497,64515-64768,64916-65417,65459-65601,65668-65727,65995,66185-66309 /trunk/extensions/FlaggedRevs_alpha:56207,56209,56296,56333,56355 /trunk/phase3/extensions/FlaggedRevs_alpha:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816 Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.class.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.class.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.class.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -749,16 +749,20 @@ ParserOutput $currentOutput = null ) { global $wgMemc, $wgEnableParserCache, $wgUser; - # Must be the same revision as the current + # Stable text revision must be the same as the current if ( $srev->getRevId() < $article->getTitle()->getLatestRevID() ) { return false; } - # Must have same file + # Stable file revision must be the same as the current if ( $article instanceof ImagePage && $article->getFile() ) { if ( $srev->getFileTimestamp() < $article->getFile()->getTimestamp() ) { return false; } } + # If using the current version of includes, there is nothing else to check. + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) { + return true; + } # Try the cache... $key = wfMemcKey( 'flaggedrevs', 'includesSynced', $article->getId() ); $value = self::getMemcValue( $wgMemc->get( $key ), $article ); @@ -854,31 +858,41 @@ } /** + * Get number of revs since the stable revision * @param Article $article - * @param int $revId, the *stable* rev ID - * @param bool $forUpdate, use master? - * @return int - * Get number of revs since the stable revision + * @param int $sRevId, the *stable* rev ID + * @param int $flags FR_MASTER + * @returns int */ - public static function getRevCountSince( Article $article, $revId, $forUpdate = false ) { + public static function getRevCountSince( Article $article, $sRevId, $flags = 0 ) { global $wgMemc, $wgParserCacheExpireTime; - # Try the cache $count = null; - $key = wfMemcKey( 'flaggedrevs', 'unreviewedrevs', $article->getId() ); - if ( !$forUpdate ) { - $val = $wgMemc->get( $key ); - if ( is_integer( $val ) ) $count = $val; + # Try the cache... + $key = wfMemcKey( 'flaggedrevs', 'countPending', $article->getId() ); + if ( !( $flags & FR_MASTER ) ) { + $tuple = self::getMemcValue( $wgMemc->get( $key ), $article ); + # Items is cached and newer that page_touched... + if ( $tuple !== false ) { + # Confirm that cache value was made against the same stable rev Id. + # This avoids lengthy cache pollution if $sRevId is outdated. + list( $cRevId, $cPending ) = explode( '-', $tuple, 2 ); + if ( $cRevId == $sRevId ) { + $count = (int)$cPending; + } + } } - # Otherwise, fetch from DB as needed + # Otherwise, fetch result from DB as needed... if ( is_null( $count ) ) { - $db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE ); - $count = (int)$db->selectField( 'revision', 'COUNT(*)', - array( 'rev_page' => $article->getId(), "rev_id > " . intval( $revId ) ), + $db = ( $flags & FR_MASTER ) + ? wfGetDB( DB_MASTER ) + : wfGetDB( DB_SLAVE ); + $count = $db->selectField( 'revision', + 'COUNT(*)', + array( 'rev_page' => $article->getId(), 'rev_id > ' . (int)$sRevId ), __METHOD__ ); - # Save to cache if there are such edits - if ( $count ) { - $wgMemc->set( $key, $count, $wgParserCacheExpireTime ); - } + # Save result to cache... + $data = self::makeMemcObj( "{$sRevId}-{$count}" ); + $wgMemc->set( $key, $data, $wgParserCacheExpireTime ); } return $count; } @@ -925,15 +939,17 @@ # Alter table metadata $dbw->replace( 'flaggedpages', array( 'fp_page_id' ), - array( 'fp_stable' => $revId, + array( + 'fp_stable' => $revId, 'fp_reviewed' => ( $latest == $revId ) ? 1 : 0, 'fp_quality' => ( $maxQuality === false ) ? null : $maxQuality, 'fp_page_id' => $article->getId(), - 'fp_pending_since' => $nextTimestamp ? $dbw->timestamp( $nextTimestamp ) : null ), + 'fp_pending_since' => $nextTimestamp ? $dbw->timestamp( $nextTimestamp ) : null + ), __METHOD__ ); # Reset cache of # of unreviewed revs - self::getRevCountSince( $article, $revId, true ); + self::getRevCountSince( $article, $revId, FR_MASTER ); # Alter pending edit tracking table self::updatePendingList( $article, $latest ); return true; Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.hooks.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.hooks.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.hooks.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -1782,11 +1782,8 @@ } public static function addToRCQuery( &$conds, &$tables, &$join_conds, $opts ) { - global $wgUser; - if ( $wgUser->isAllowed( 'review' ) ) { - $tables[] = 'flaggedpages'; - $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' ); - } + $tables[] = 'flaggedpages'; + $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' ); return true; } @@ -2101,7 +2098,8 @@ # Includes restriction dropdown and expiry dropdown & field. $output .= "<tr><td>"; $output .= Xml::openElement( 'fieldset' ); - $output .= Xml::element( 'legend', null, wfMsg( 'flaggedrevs-protect-legend' ) ); + $legendMsg = wfMsgExt( 'flaggedrevs-protect-legend', 'parseinline' ); + $output .= "<legend>{$legendMsg}</legend>"; # Add a "no restrictions" level $effectiveLevels = FlaggedRevs::getRestrictionLevels(); array_unshift( $effectiveLevels, "none" ); Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevs.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -301,7 +301,7 @@ $wgAvailableRights[] = 'stablesettings'; # Bump this number every time you change flaggedrevs.css/flaggedrevs.js -$wgFlaggedRevStyleVersion = 71; +$wgFlaggedRevStyleVersion = 72; $wgExtensionFunctions[] = 'efLoadFlaggedRevs'; Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevsXML.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevsXML.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/FlaggedRevsXML.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -295,7 +295,14 @@ $box = '<div class="flaggedrevs_short_basic">' . $shtml . ' ' . self::ratingArrow() . "</div>\n"; $box .= '<div style="position: relative;">'; // for rel-absolute child div - $box .= '<div id="mw-fr-revisionratings" class="flaggedrevs_short_details">'; + $box .= Html::openElement( 'div', + array( + 'id' => 'mw-fr-revisionratings', + 'class' => 'flaggedrevs_short_details', + 'onMouseOver' => 'FlaggedRevs.showBoxDetails()', + 'onMouseOut' => 'FlaggedRevs.hideBoxDetails()' + ) + ); $box .= $html; // details text # Add any rating tags as needed... if ( $flags && !FlaggedRevs::binaryFlagging() ) { @@ -304,7 +311,8 @@ $box .= '<p>' . self::addTagRatings( $flags, true, $color ) . '</p>'; } } - $box .= "</div></div>\n"; + $box .= Html::closeElement( 'div' ); + $box .= "</div>\n"; return $box; } @@ -314,11 +322,13 @@ */ public static function ratingArrow() { $encPath = htmlspecialchars( FlaggedRevs::styleUrlPath() . '/img' ); - return "<img id=\"mw-fr-revisiontoggle\" class=\"fr-toggle-arrow\"" . - " src=\"{$encPath}/arrow-up.png\" style=\"display:none;\" " . - " onclick=\"FlaggedRevs.toggleRevRatings()\" title=\"" . - wfMsgHtml( 'revreview-toggle-title' ) . "\" alt=\"" . - wfMsgHtml( 'revreview-toggle-show' ) . "\" />"; + $img = '<img id="mw-fr-revisiontoggle" class="fr-toggle-arrow"'; + $img .= " src=\"{$encPath}/arrow-down.png\" style=\"display:none;\""; + $img .= ' onMouseOver="FlaggedRevs.showBoxDetails()"'; + $img .= ' onMouseOut="FlaggedRevs.hideBoxDetails()"'; + $img .= ' title="' . wfMsgHtml( 'revreview-toggle-title' ) . '"'; + $img .= ' alt="' . wfMsgHtml( 'revreview-toggle-show' ) . '" />'; + return $img; } /** @@ -327,7 +337,7 @@ */ public static function ratingToggle() { return '<a id="mw-fr-revisiontoggle" class="fr-toggle-symbol"' . - ' style="display:none;" onclick="FlaggedRevs.toggleRevRatings()" title="' . + ' style="display:none;" onclick="FlaggedRevs.toggleBoxDetails()" title="' . wfMsgHtml( 'revreview-toggle-title' ) . '" >' . wfMsgHtml( 'revreview-toggle-show' ) . '</a>'; } Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/client/flaggedrevs.js =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/client/flaggedrevs.js 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/client/flaggedrevs.js 2010-05-13 13:51:30 UTC (rev 66342) @@ -15,6 +15,7 @@ }, /* Hide rating/diff clutter */ 'enableShowhide': function() { + // Rating detail box var toggle = document.getElementById('mw-fr-revisiontoggle'); if( toggle ) { toggle.style.display = 'inline'; @@ -23,6 +24,7 @@ ratings.style.display = 'none'; } } + // Diff detail box toggle = document.getElementById('mw-fr-difftoggle'); if( toggle ) { toggle.style.display = 'inline'; @@ -31,6 +33,7 @@ diff.style.display = 'none'; } } + // Log detail box toggle = document.getElementById('mw-fr-logtoggle'); if( toggle ) { toggle.style.display = 'inline'; @@ -41,30 +44,36 @@ } }, - /* Toggles ratings */ - 'toggleRevRatings': function() { + /* Expands ratings */ + 'showBoxDetails': function() { var ratings = document.getElementById('mw-fr-revisionratings'); if( !ratings ) return; var toggle = document.getElementById('mw-fr-revisiontoggle'); if( !toggle ) return; + ratings.style.display = 'block'; + toggle.innerHTML = this.messages.toggleHide; + }, + + /* Collapses ratings */ + 'hideBoxDetails': function() { + var ratings = document.getElementById('mw-fr-revisionratings'); + if( !ratings ) return; + var toggle = document.getElementById('mw-fr-revisiontoggle'); + if( !toggle ) return; + ratings.style.display = 'none'; + toggle.innerHTML = this.messages.toggleShow; + }, + + /* Toggles ratings */ + 'toggleBoxDetails': function() { + var ratings = document.getElementById('mw-fr-revisionratings'); + if( !ratings ) return; // Collapsed -> expand if( ratings.style.display == 'none' ) { - ratings.style.display = 'block'; - if( toggle.tagName == 'IMG' ) { // arrow - toggle.alt = this.messages.toggleHide; // fallback text - toggle.src = toggle.src.replace( 'arrow-up.png', 'arrow-down.png' ); - } else { // text - toggle.innerHTML = this.messages.toggleHide; - } + this.showBoxDetails(); // Expanded -> collapse } else { - ratings.style.display = 'none'; - if( toggle.tagName == 'IMG' ) { // arrow - toggle.alt = this.messages.toggleShow; // fallback text - toggle.src = toggle.src.replace( 'arrow-down.png', 'arrow-up.png' ); - } else { // text - toggle.innerHTML = this.messages.toggleShow; - } + this.hideBoxDetails(); } }, Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/ConfiguredPages.i18n.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/ConfiguredPages.i18n.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/ConfiguredPages.i18n.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -149,11 +149,16 @@ 'configuredpages-def-stable' => 'wózjawjona wersija', ); -/** Greek (Ελληνικά) */ +/** Greek (Ελληνικά) + * @author Crazymadlover + */ $messages['el'] = array( + 'configuredpages-config' => 'Διαμόρφωση', + 'configuredpages-precedence' => 'Προνομίων:', 'configuredpages-prec-none' => 'χωρίς προτεραιότητα', 'configuredpages-prec-quality' => 'προτεραιότητα ποιότητας', 'configuredpages-prec-pristine' => 'προτεραιότητα μη αλλοίωσης', + 'configuredpages-def-draft' => 'τελευταία έκδοση', ); /** Esperanto (Esperanto) @@ -510,11 +515,17 @@ 'configuredpages-def-stable' => 'publisert versjon', ); -/** Occitan (Occitan) */ +/** Occitan (Occitan) + * @author Cedric31 + */ $messages['oc'] = array( + 'configuredpages-config' => 'Configuracion', + 'configuredpages-precedence' => 'Prioritat :', 'configuredpages-prec-none' => 'pas cap de prioritat', 'configuredpages-prec-quality' => 'preferéncia per la qualitat', 'configuredpages-prec-pristine' => 'prioritat vèrja', + 'configuredpages-def-draft' => 'darrièra version', + 'configuredpages-def-stable' => 'version publicada', ); /** Polish (Polski) @@ -626,6 +637,7 @@ /** Swedish (Svenska) * @author Ainali + * @author Dafer45 */ $messages['sv'] = array( 'configuredpages-none' => 'Det finns inga sidor i den här listan.', @@ -634,6 +646,7 @@ 'configuredpages-prec-quality' => 'kvalitetsordning', 'configuredpages-prec-pristine' => 'företräde för orörda', 'configuredpages-def-draft' => 'senaste versionen', + 'configuredpages-def-stable' => 'Publicerad version', ); /** Turkmen (Türkmençe) */ Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/FlaggedRevs.i18n.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/FlaggedRevs.i18n.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/FlaggedRevs.i18n.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -233,7 +233,7 @@ 'tooltip-ca-stable' => 'View the published version of this page', 'tooltip-ca-default' => 'Quality assurance settings', - 'flaggedrevs-protect-legend' => 'Publish edits', + 'flaggedrevs-protect-legend' => 'Publish edits ([[{{MediaWiki:Validationpage}}|?]])', 'flaggedrevs-protect-none' => 'Allow all users', 'flaggedrevs-protect-basic' => 'Default settings', @@ -10066,6 +10066,7 @@ * @author Jfblanc */ $messages['oc'] = array( + 'action-review' => 'Repassar las versions', 'editor' => 'Contributor', 'flaggedrevs' => 'Revisions marcadas', 'flaggedrevs-backlog' => "I a actualament de prètfaches tardièrs dins la [[Special:OldReviewedPages|Lista de las modificacions en espèra]] de las paginas revisadas. '''Aquò necessita vòstra atencion !'''", @@ -10095,6 +10096,13 @@ 'revreview-hist-quality-user' => '[{{fullurl:$1|stableid=$2}} validada] per [[User:$3|$3]]', 'revreview-hist-basic-user' => '[{{fullurl:$1|stableid=$2}} visada] per [[User:$3|$3]]', 'revreview-hist-basic-auto' => '[{{fullurl:$1|stableid=$2}} revista automaticament]', + 'revreview-diff-toggle-show' => 'far veire los cambiaments', + 'revreview-diff-toggle-hide' => 'amagar los cambiaments', + 'revreview-diff-toggle-title' => "Bascuolar l'afichatge entre las modificacions en espèra e la version publicada", + 'revreview-log-toggle-show' => "far veire lo jornal d'estabilitat", + 'revreview-log-toggle-hide' => "amagar lo jornal d'estabilitat", + 'revreview-log-details-show' => 'far veire los detalhs', + 'revreview-log-details-hide' => 'amagar los detalhs', 'review-diff2stable' => 'Vejatz las modificacions entre las versions establas e actualas.', 'review-logentry-app' => 'a revist v$2 de [[$1]]', 'review-logentry-dis' => 'a depreciat v$2 de [[$1]]', @@ -10186,7 +10194,11 @@ 'revreview-style-3' => 'Concisa', 'revreview-style-4' => 'Remirabla', 'revreview-submit' => 'Salvar', + 'revreview-submit-review' => 'Aprovar', + 'revreview-submit-unreview' => 'Desaprovar', 'revreview-submitting' => 'Somission…', + 'revreview-submit-reviewed' => 'Fach. Aprovat !', + 'revreview-submit-unreviewed' => 'Fach. Desaprovat!', 'revreview-successful' => "'''La version seleccionada de [[:$1|$1]], es estada marcada d'una bandièra amb succès ([{{fullurl:{{#Special:ReviewedVersions}}|page=$2}} Vejatz totas las versions establas])'''", 'revreview-successful2' => "La version de [[:$1|$1]] a pogut se veire levar son drapèu amb succès.'''", 'revreview-text' => "''[[{{MediaWiki:Validationpage}}|Las versions establas]] son causidas per defaut pels revisaires puslèu que las mai recentas.''", @@ -10214,22 +10226,31 @@ 'stable-logpage' => 'Jornal de las versions establas', 'stable-logpagetext' => 'Vaquí lo jornal de las modificacions per la [[{{MediaWiki:Validationpage}}|version establa]] de la configuracion de las presentas paginas.', 'revreview-filter-all' => 'Tot', - 'revreview-filter-stable' => 'estable', - 'revreview-statusfilter' => "Cambiament d'estatut :", + 'revreview-filter-stable' => 'publicat', + 'revreview-statusfilter' => "Accion d'aprobacion :", 'revreview-filter-approved' => 'Aprovat', 'revreview-filter-reapproved' => 'Aprovat tornamai', - 'revreview-filter-unapproved' => 'Pas aprovat', + 'revreview-filter-unapproved' => 'Desaprovar', 'revreview-typefilter' => 'Tipe :', 'revreview-filter-auto' => 'Automatic', 'revreview-filter-manual' => 'Manual', 'revreview-levelfilter' => 'Nivèl :', 'revreview-precedencefilter' => 'Prioritat :', - 'revreview-lev-basic' => 'visada', + 'revreview-lev-all' => 'totes', + 'revreview-lev-basic' => 'verificada', 'revreview-lev-quality' => 'qualitat', 'revreview-lev-pristine' => 'primitiva', - 'revreview-reviewlink' => 'Tornar veire', + 'revreview-defaultfilter' => 'Version per defaut :', + 'revreview-def-all' => 'totas', + 'revreview-def-draft' => 'darrièra', + 'revreview-def-stable' => 'publicada', + 'revreview-restrictfilter' => 'Nivèl de restriccion :', + 'revreview-restriction-any' => 'totes', + 'revreview-restriction-none' => 'pas cap', + 'revreview-reviewlink' => 'modificacions en espèra', + 'revreview-unreviewedpage' => 'Pagina pas verificada', 'tooltip-ca-current' => "Veire l'esbòs corrent d'aquesta pagina", - 'tooltip-ca-stable' => "Veire la version establa d'aquesta pagina", + 'tooltip-ca-stable' => "Veire la version publicada d'aquesta pagina", 'tooltip-ca-default' => "Paramètres per l'assegurança-qualitat", 'flaggedrevs-protect-legend' => 'Publicar los cambiaments', 'flaggedrevs-protect-none' => 'Permetre a totes', @@ -12480,6 +12501,7 @@ 'revreview-diff-toggle-show' => '(visa ändringar)', 'revreview-diff-toggle-hide' => '(dölj ändringar)', 'revreview-log-details-show' => '(visa detaljer)', + 'revreview-log-details-hide' => 'dölj detaljer', 'review-diff2stable' => 'Visa ändringar mellan den stabila och den senaste versionen', 'review-logentry-app' => 'granskat en version av [[$1]]', 'review-logentry-dis' => 'degraderade en version av [[$1]]', Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/Stabilization.i18n.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/Stabilization.i18n.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/language/Stabilization.i18n.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -653,6 +653,7 @@ * @author Als-Holder * @author Metalhead64 * @author Purodha + * @author Steef389 * @author Umherirrender */ $messages['de'] = array( Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/ConfiguredPages_body.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/ConfiguredPages_body.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/ConfiguredPages_body.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -59,8 +59,6 @@ protected function showPageList() { global $wgOut; - # Take this opportunity to purge out expired configurations - FlaggedRevs::purgeExpiredConfigurations(); $pager = new ConfiguredPagesPager( $this, array(), $this->namespace, $this->override, $this->precedence, $this->autoreview ); if ( $pager->getNumRows() ) { @@ -70,6 +68,8 @@ } else { $wgOut->addHTML( wfMsgExt( 'configuredpages-none', array( 'parse' ) ) ); } + # Take this opportunity to purge out expired configurations + FlaggedRevs::purgeExpiredConfigurations(); } public function formatRow( $row ) { @@ -178,13 +178,17 @@ if ( $this->precedence !== null ) { $conds['fpc_select'] = $this->precedence; } - if( $this->autoreview !== null ) { + if ( $this->autoreview !== null ) { $conds['fpc_level'] = $this->autoreview; } $conds['page_namespace'] = $this->namespace; + # Be sure not to include expired items + $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() ); + $conds[] = "fpc_expiry > {$encCutoff}"; return array( 'tables' => array( 'flaggedpage_config', 'page' ), - 'fields' => 'page_namespace,page_title,fpc_override,fpc_expiry,fpc_page_id,fpc_select,fpc_level', + 'fields' => array( 'page_namespace', 'page_title', 'fpc_override', + 'fpc_expiry', 'fpc_page_id', 'fpc_select', 'fpc_level' ), 'conds' => $conds, 'options' => array() ); Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/Stabilization_body.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/Stabilization_body.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/Stabilization_body.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -93,6 +93,7 @@ /** * Verify and clean up parameters and preload data from DB. * Note: if false is returned items may not all be set. + * TODO: return error keywords? * @return bool success */ public function handleParams() { Modified: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/StablePages_body.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/StablePages_body.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/StablePages_body.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -51,8 +51,6 @@ protected function showPageList() { global $wgOut; - # Take this opportunity to purge out expired configurations - FlaggedRevs::purgeExpiredConfigurations(); $pager = new StablePagesPager( $this, array(), $this->namespace, $this->autoreview ); if ( $pager->getNumRows() ) { $wgOut->addHTML( $pager->getNavigationBar() ); @@ -61,6 +59,8 @@ } else { $wgOut->addHTML( wfMsgExt( 'configuredpages-none', array( 'parse' ) ) ); } + # Take this opportunity to purge out expired configurations + FlaggedRevs::purgeExpiredConfigurations(); } public function formatRow( $row ) { @@ -134,9 +134,13 @@ $conds['fpc_level'] = $this->autoreview; } $conds['page_namespace'] = $this->namespace; + # Be sure not to include expired items + $encCutoff = $this->mDb->addQuotes( $this->mDb->timestamp() ); + $conds[] = "fpc_expiry > {$encCutoff}"; return array( 'tables' => array( 'flaggedpage_config', 'page' ), - 'fields' => 'page_namespace,page_title,fpc_override,fpc_expiry,fpc_page_id,fpc_select,fpc_level', + 'fields' => array( 'page_namespace', 'page_title', 'fpc_override', + 'fpc_expiry', 'fpc_page_id', 'fpc_level' ), 'conds' => $conds, 'options' => array() ); Deleted: branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/UnstablePages_body.php =================================================================== --- branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/UnstablePages_body.php 2010-05-13 13:50:44 UTC (rev 66341) +++ branches/wmf/1.16wmf4/extensions/FlaggedRevs_alpha/specialpages/UnstablePages_body.php 2010-05-13 13:51:30 UTC (rev 66342) @@ -1,138 +0,0 @@ -<?php -if ( !defined( 'MEDIAWIKI' ) ) { - echo "FlaggedRevs extension\n"; - exit( 1 ); -} - -class Unstablepages extends SpecialPage -{ - public function __construct() { - parent::__construct( 'UnstablePages' ); - } - - public function execute( $par ) { - global $wgRequest, $wgUser; - - $this->setHeaders(); - $this->skin = $wgUser->getSkin(); - - $this->namespace = $wgRequest->getInt( 'namespace' ); - - $this->showForm(); - $this->showPageList(); - } - - protected function showForm() { - global $wgOut, $wgScript; - $namespaces = FlaggedRevs::getReviewNamespaces(); - $wgOut->addHTML( wfMsgExt( 'unstablepages-text', array( 'parseinline' ) ) ); - if ( count( $namespaces ) > 1 ) { - $form = Xml::openElement( 'form', array( 'name' => 'unstablepages', - 'action' => $wgScript, 'method' => 'get' ) ); - $form .= "<fieldset><legend>" . wfMsg( 'unstablepages' ) . "</legend>\n"; - $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' '; - $form .= " " . Xml::submitButton( wfMsg( 'go' ) ); - $form .= Xml::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ); - $form .= "</fieldset></form>\n"; - $wgOut->addHTML( $form ); - } - } - - protected function showPageList() { - global $wgOut, $wgUser, $wgLang; - # Take this opportunity to purge out expired configurations - FlaggedRevs::purgeExpiredConfigurations(); - $pager = new unstablepagesPager( $this, array(), $this->namespace ); - if ( $pager->getNumRows() ) { - $wgOut->addHTML( $pager->getNavigationBar() ); - $wgOut->addHTML( $pager->getBody() ); - $wgOut->addHTML( $pager->getNavigationBar() ); - } else { - $wgOut->addHTML( wfMsgExt( 'unstablepages-none', array( 'parse' ) ) ); - } - } - - public function formatRow( $row ) { - global $wgLang, $wgUser; - - $title = Title::makeTitle( $row->page_namespace, $row->page_title ); - $link = $this->skin->makeKnownLinkObj( $title, $title->getPrefixedText() ); - - $stitle = SpecialPage::getTitleFor( 'Stabilization' ); - $config = $this->skin->makeKnownLinkObj( $stitle, wfMsgHtml( 'unstablepages-config' ), - 'page=' . $title->getPrefixedUrl() ); - $stable = $this->skin->makeKnownLinkObj( $title, wfMsgHtml( 'unstablepages-stable' ), - 'stable=1' ); - if ( $row->fpc_expiry != 'infinity' && strlen( $row->fpc_expiry ) ) { - $expiry_description = " (" . wfMsgForContent( - 'protect-expiring', - $wgLang->timeanddate( $row->fpc_expiry ), - $wgLang->date( $row->fpc_expiry ), - $wgLang->time( $row->fpc_expiry ) - ) . ")"; - } else { - $expiry_description = ""; - } - - return "<li>{$link} ({$config}) [{$stable}]{$expiry_description}</li>"; - } -} - -/** - * Query to list out stable versions for a page - */ -class UnstablePagesPager extends AlphabeticPager { - public $mForm, $mConds, $namespace; - - function __construct( $form, $conds = array(), $namespace = 0 ) { - $this->mForm = $form; - $this->mConds = $conds; - # Must be a content page... - if ( !is_null( $namespace ) ) { - $namespace = intval( $namespace ); - } - $vnamespaces = FlaggedRevs::getReviewNamespaces(); - if ( is_null( $namespace ) || !in_array( $namespace, $vnamespaces ) ) { - $namespace = !$vnamespaces ? - 1 : $vnamespaces[0]; - } - $this->namespace = $namespace; - parent::__construct(); - } - - function formatRow( $row ) { - return $this->mForm->formatRow( $row ); - } - - function getQueryInfo() { - $conds = $this->mConds; - $conds[] = 'page_id = fpc_page_id'; - $conds['fpc_override'] = 0; - $conds['page_namespace'] = $this->namespace; - return array( - 'tables' => array( 'flaggedpage_config', 'page' ), - 'fields' => 'page_namespace,page_title,fpc_expiry,fpc_page_id', - 'conds' => $conds, - 'options' => array() - ); - } - - function getIndexField() { - return 'fpc_page_id'; - } - - function getStartBody() { - wfProfileIn( __METHOD__ ); - # Do a link batch query - $lb = new LinkBatch(); - while ( $row = $this->mResult->fetchObject() ) { - $lb->add( $row->page_namespace, $row->page_title ); - } - $lb->execute(); - wfProfileOut( __METHOD__ ); - return '<ul>'; - } - - function getEndBody() { - return '</ul>'; - } -} _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs