r66058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66057‎ | r66058 | r66059 >
Date:01:00, 8 May 2010
Author:werdna
Status:deferred
Tags:
Comment:
Move StrategyWiki extensions into 1.16wmf4 in preparation for deployment
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/StrategyWiki (added) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/StrategyWiki/ActiveTaskForces/ActiveTaskForces_body.php
@@ -0,0 +1,76 @@
 2+<?php
 3+
 4+class ActiveTaskForcesSP extends SpecialPage {
 5+ function __construct() {
 6+ parent::__construct( 'ActiveTaskForces' );
 7+ }
 8+
 9+ function execute() {
 10+ global $wgOut, $wgLang, $wgActiveTaskForcesPeriod;
 11+ $this->setHeaders();
 12+ $wgOut->addWikiMsg( 'active-task-forces-intro',
 13+ $wgLang->formatNum( round( $wgActiveTaskForcesPeriod / 86400, 1 ) ) );
 14+ $qp = new ActiveTaskForcesQP;
 15+ list( $limit, $offset ) = wfCheckLimits();
 16+ $qp->doQuery( $offset, $limit );
 17+ }
 18+}
 19+
 20+class ActiveTaskForcesQP extends QueryPage {
 21+ function getName() {
 22+ return 'ActiveTaskForces';
 23+ }
 24+
 25+ function isExpensive() {
 26+ return true;
 27+ }
 28+
 29+ function isSyndicated() {
 30+ return false;
 31+ }
 32+
 33+ function getSQL() {
 34+ global $wgActiveTaskForcesPeriod;
 35+
 36+ $dbr = wfGetDB( DB_SLAVE );
 37+ $revisionTable = $dbr->tableName( 'revision' );
 38+ $pageTable = $dbr->tableName( 'page' );
 39+ $start = time() - $wgActiveTaskForcesPeriod;
 40+ $encPeriodStart = $dbr->addQuotes( $dbr->timestamp( $start ) );
 41+
 42+ $sql = <<<SQL
 43+ SELECT
 44+ 'ActiveTaskForces' AS type,
 45+ page_namespace AS namespace,
 46+ page_title AS title,
 47+ COUNT(*) AS value
 48+ FROM $revisionTable
 49+ JOIN $pageTable ON page_id = rev_page
 50+ WHERE
 51+ page_namespace = 0 AND
 52+ page_title LIKE 'Task_force/%' AND
 53+ rev_timestamp > $encPeriodStart
 54+ GROUP BY page_namespace, page_title
 55+SQL;
 56+ $sql = strtr( $sql, "\r\n\t", ' ' );
 57+ return $sql;
 58+ }
 59+
 60+ function formatResult( $skin, $result ) {
 61+ global $wgContLang, $wgLang;
 62+
 63+ $title = Title::makeTitle( $result->namespace, $result->title );
 64+ $text = $wgContLang->convert( $title->getPrefixedText() );
 65+ $pageLink = $skin->linkKnown( $title, $text );
 66+
 67+ $numberLink = $skin->linkKnown(
 68+ $title,
 69+ wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
 70+ $wgLang->formatNum( $result->value ),
 71+ array(),
 72+ array( 'action' => 'history' )
 73+ ) );
 74+ return wfSpecialList( $pageLink, $numberLink );
 75+ }
 76+}
 77+
Property changes on: branches/wmf/1.16wmf4/extensions/StrategyWiki/ActiveTaskForces/ActiveTaskForces_body.php
___________________________________________________________________
Name: svn:eol-style
178 + native
Index: branches/wmf/1.16wmf4/extensions/StrategyWiki/ActiveTaskForces/ActiveTaskForces.i18n.php
@@ -0,0 +1,161 @@
 2+<?php
 3+
 4+$messages = array();
 5+$messages['en'] = array(
 6+ 'activetaskforces' => 'Active task forces',
 7+ 'active-task-forces-intro' => 'Number of edits to task force pages in the last {{PLURAL:$1|$1 day|$1 days}}.',
 8+);
 9+
 10+/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
 11+ * @author EugeneZelenko
 12+ * @author Jim-by
 13+ */
 14+$messages['be-tarask'] = array(
 15+ 'activetaskforces' => 'Актыўныя працоўныя групы',
 16+ 'active-task-forces-intro' => 'Колькасьць рэдагаваньняў старонак працоўнай групай за $1 {{PLURAL:$1|апошні дзень|апошнія дні|апошніх дзён}}.',
 17+);
 18+
 19+/** Breton (Brezhoneg)
 20+ * @author Y-M D
 21+ */
 22+$messages['br'] = array(
 23+ 'activetaskforces' => 'Strolladoù labour oberient',
 24+ 'active-task-forces-intro' => 'Niver a gemm pajennoù evit ar strollad labour e-kerzh an {{PLURAL:$1|devezh ziwezhañ|$1 zevezh ziwezhañ}}.',
 25+);
 26+
 27+/** German (Deutsch)
 28+ * @author Kghbln
 29+ */
 30+$messages['de'] = array(
 31+ 'activetaskforces' => 'Aktive Arbeitsgruppen',
 32+ 'active-task-forces-intro' => 'Anzahl der Bearbeitungen auf den Seiten der Arbeitsgruppen während {{PLURAL:$1|des letzten Tages|der letzten $1 Tage}}.',
 33+);
 34+
 35+/** Lower Sorbian (Dolnoserbski)
 36+ * @author Michawiki
 37+ */
 38+$messages['dsb'] = array(
 39+ 'activetaskforces' => 'Aktiwne źěłowe kupki',
 40+ 'active-task-forces-intro' => 'Licba změnow na źěłowych kupkach za {{PLURAL:$1|zachadny $1 źeń|zachadnej $1 dnja|zachadne $1 dny|zachadnych $1 dnjow}}.',
 41+);
 42+
 43+/** Spanish (Español)
 44+ * @author Ascánder
 45+ */
 46+$messages['es'] = array(
 47+ 'activetaskforces' => 'Fuerzas de trabajo activas',
 48+ 'active-task-forces-intro' => 'Número de ediciones a las páginas del grupo de trabajo en los últimos {{PLURAL:$1|$1 día|$1 días}}.',
 49+);
 50+
 51+/** French (Français)
 52+ * @author Peter17
 53+ */
 54+$messages['fr'] = array(
 55+ 'activetaskforces' => 'Groupes de travail actifs',
 56+ 'active-task-forces-intro' => 'Nombre de modifications des pages du groupe de travail au cours {{PLURAL:$1|du dernier jour|des $1 derniers jours}}.',
 57+);
 58+
 59+/** Galician (Galego)
 60+ * @author Toliño
 61+ */
 62+$messages['gl'] = array(
 63+ 'activetaskforces' => 'Grupos de traballo activos',
 64+ 'active-task-forces-intro' => 'Número de edicións das páxinas do grupo de traballo {{PLURAL:$1|no último día|nos últimos $1 días}}.',
 65+);
 66+
 67+/** Swiss German (Alemannisch)
 68+ * @author Als-Holder
 69+ */
 70+$messages['gsw'] = array(
 71+ 'activetaskforces' => 'Aktivi Arbetsgruppe',
 72+ 'active-task-forces-intro' => 'Aazahl vu Bearbeitige an Arbetsgruppesyte {{PLURAL:$1|am letschte Tag|in dr letschte $1 Täg}}.',
 73+);
 74+
 75+/** Upper Sorbian (Hornjoserbsce)
 76+ * @author Michawiki
 77+ */
 78+$messages['hsb'] = array(
 79+ 'activetaskforces' => 'Aktiwne dźěłarnički',
 80+ 'active-task-forces-intro' => 'Ličba změnow na stronach dźěłarničkow za {{PLURAL:$1|zańdźeny $1 dźeń|zańdźenej $1 dnjej|zańdźene $1 dny|zańdźenych $1 dnjow}}.',
 81+);
 82+
 83+/** Hungarian (Magyar)
 84+ * @author Glanthor Reviol
 85+ */
 86+$messages['hu'] = array(
 87+ 'activetaskforces' => 'Aktív munkacsoportok',
 88+ 'active-task-forces-intro' => 'Szerkesztések száma a munkacsoport lapokon az elmúlt $1 napban.',
 89+);
 90+
 91+/** Interlingua (Interlingua)
 92+ * @author McDutchie
 93+ */
 94+$messages['ia'] = array(
 95+ 'activetaskforces' => 'Gruppos de labor active',
 96+ 'active-task-forces-intro' => 'Numero de modificationes in paginas de gruppos de labor in le ultime {{PLURAL:$1|die|$1 dies}}.',
 97+);
 98+
 99+/** Japanese (日本語)
 100+ * @author Aotake
 101+ */
 102+$messages['ja'] = array(
 103+ 'activetaskforces' => '活動中の特別チーム',
 104+ 'active-task-forces-intro' => '最近$1日間に特別チームのページに加えられた編集回数',
 105+);
 106+
 107+/** Luxembourgish (Lëtzebuergesch)
 108+ * @author Robby
 109+ */
 110+$messages['lb'] = array(
 111+ 'activetaskforces' => 'Aktiv Aarbechtsgruppen',
 112+ 'active-task-forces-intro' => 'Zuel vun den Ännerungen op Säite vum Aarbechtsgrupp {{PLURAL:$1|de leschten Dag|an de leschten $1 Deeg}}.',
 113+);
 114+
 115+/** Macedonian (Македонски)
 116+ * @author Bjankuloski06
 117+ */
 118+$messages['mk'] = array(
 119+ 'activetaskforces' => 'Активни работни групи',
 120+ 'active-task-forces-intro' => 'Број на уредувања на страници на работни групи во {{PLURAL:$1|изминатиот $1 ден|изминатите $1 дена}}.',
 121+);
 122+
 123+/** Dutch (Nederlands)
 124+ * @author Siebrand
 125+ */
 126+$messages['nl'] = array(
 127+ 'activetaskforces' => 'Actieve taskforces',
 128+ 'active-task-forces-intro' => "Aantal bewerkingen aan taskforcepagina's in de afgelopen {{PLURAL:$1|dag|$1 dagen}}.",
 129+);
 130+
 131+/** Occitan (Occitan)
 132+ * @author Cedric31
 133+ */
 134+$messages['oc'] = array(
 135+ 'activetaskforces' => 'Gropes de trabalh actius',
 136+ 'active-task-forces-intro' => 'Nombre de modificacions de las paginas del grop de trabalh al cors {{PLURAL:$1|del darrièr jorn|dels $1 darrièrs jorns}}.',
 137+);
 138+
 139+/** Piedmontese (Piemontèis)
 140+ * @author Borichèt
 141+ */
 142+$messages['pms'] = array(
 143+ 'activetaskforces' => 'Echip ëd travaj ative',
 144+ 'active-task-forces-intro' => "Nùmer ëd modìfiche a le pàgine dl'echip ëd travaj ant {{PLURAL:$1|l'ùltim di|j'ùltim $1 di}}.",
 145+);
 146+
 147+/** Portuguese (Português)
 148+ * @author Hamilton Abreu
 149+ */
 150+$messages['pt'] = array(
 151+ 'activetaskforces' => 'Grupos de trabalho activos',
 152+ 'active-task-forces-intro' => 'Número de edições às páginas dos grupos de trabalho {{PLURAL:$1|no último dia|nos últimos $1 dias}}.',
 153+);
 154+
 155+/** Russian (Русский)
 156+ * @author Александр Сигачёв
 157+ */
 158+$messages['ru'] = array(
 159+ 'activetaskforces' => 'Активные комиссии',
 160+ 'active-task-forces-intro' => 'Количество правок страниц комиссий за {{PLURAL:$1|последний $1 день|последние $1 дня|последние $1 дней}}.',
 161+);
 162+
Property changes on: branches/wmf/1.16wmf4/extensions/StrategyWiki/ActiveTaskForces/ActiveTaskForces.i18n.php
___________________________________________________________________
Name: svn:eol-style
1163 + native
Index: branches/wmf/1.16wmf4/extensions/StrategyWiki/ActiveTaskForces/ActiveTaskForces.php
@@ -0,0 +1,20 @@
 2+<?php
 3+
 4+/**
 5+ * Period for edit counts, in seconds
 6+ */
 7+$wgActiveTaskForcesPeriod = 7 * 86400;
 8+
 9+
 10+/* Registration */
 11+$wgHooks['wgQueryPages'][] = 'wfActiveTaskForcesRegister';
 12+$wgSpecialPages['ActiveTaskForces'] = 'ActiveTaskForcesSP';
 13+$wgExtensionMessagesFiles['ActiveTaskForces'] = dirname( __FILE__ ) .'/ActiveTaskForces.i18n.php';
 14+$wgAutoloadClasses['ActiveTaskForcesSP']
 15+ = $wgAutoloadClasses['ActiveTaskForcesQP']
 16+ = dirname( __FILE__ ) .'/ActiveTaskForces_body.php';
 17+
 18+function wfActiveTaskForcesRegister( &$pages ) {
 19+ $pages[] = array( 'ActiveTaskForcesQP', 'ActiveTaskForces' );
 20+ return true;
 21+}
Property changes on: branches/wmf/1.16wmf4/extensions/StrategyWiki/ActiveTaskForces/ActiveTaskForces.php
___________________________________________________________________
Name: svn:eol-style
122 + native
Index: branches/wmf/1.16wmf4/extensions/StrategyWiki/README
@@ -0,0 +1 @@
 2+Extensions for strategy.wikimedia.org
Property changes on: branches/wmf/1.16wmf4/extensions/StrategyWiki/README
___________________________________________________________________
Name: svn:eol-style
13 + native

Status & tagging log