r67042 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67041‎ | r67042 | r67043 >
Date:14:28, 29 May 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Tweak messages 'purewikideletion-blanked' and 'blank-log-link'
Modified paths:
  • /trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php (modified) (history)
  • /trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PureWikiDeletion/PureWikiDeletion.i18n.php
@@ -1,6 +1,12 @@
22 <?php
 3+/**
 4+ * Internationalisation file for extension AbsenteeLandlord.
 5+ */
 6+
37 $messages = array();
4 -
 8+
 9+/** English
 10+ */
511 $messages['en'] = array(
612 'purewikideletion' => 'Pure wiki deletion',
713 'randomexcludeblank' => 'Random page (exclude blank)',
@@ -8,8 +14,8 @@
915 'purewikideletion-desc' => 'Among other things, causes blanked pages to be redlinked',
1016 'purewikideletion-pref-watchblank' => 'Add pages I blank to my watchlist',
1117 'purewikideletion-pref-watchunblank' => 'Add pages I unblank to my watchlist',
12 - 'purewikideletion-blanked' => "A former version of this page was blanked by [[User:$1|$1]] ([[User talk:$1|talk]]) ([[Special:Contributions/$1|contribs]]) on $2
13 -
 18+ 'purewikideletion-blanked' => "A former version of this page was blanked by [[User:$1|$1]] ([[User talk:$1|talk]]) ([[Special:Contributions/$1|contribs]]) on $5 at $6.
 19+
1420 The reason given for blanking was: ''<nowiki>$3</nowiki>''.
1521
1622 You may [{{fullurl:{{FULLPAGENAMEE}}|action=history}} view the article's history], [{{fullurl:{{FULLPAGENAMEE}}|oldid=$4&action=edit}} edit the last version], or type new page into the white space below.",
@@ -18,7 +24,7 @@
1925 'blank-log-header' => 'Below is a list of page blankings and unblankings.',
2026 'blank-log-entry-blank' => 'blanked $1',
2127 'blank-log-entry-unblank' => 'unblanked $1',
22 - 'blank-log-link' => '[[Special:Log/blank|blank log]]',
 28+ 'blank-log-link' => '[[{{#Special:Log}}/blank|blank log]]',
2329 'purewikideletion-blanknologin' => 'Not logged in',
2430 'purewikideletion-blanknologintext' => 'You must be a registered user and [[Special:UserLogin|logged in]] to blank a page.',
2531 'purewikideletion-unblanknologintext' => 'You must be a registered user and [[Special:UserLogin|logged in]] to unblank a page.',
@@ -37,7 +43,7 @@
3844 'purewikideletion-pref-watchblank' => 'أضف الفصفحات التي أفرغها إلى قائمة مراقبتي',
3945 'purewikideletion-pref-watchunblank' => 'أضف الصفحات التي أملؤها إلى قائمة مراقبتي',
4046 'purewikideletion-blanked' => "نسخة سابقة من هذه الصفحة تم إفراغها بواسطة [[User:$1|$1]] ([[User talk:$1|نقاش]]) ([[Special:Contributions/$1|مساهمات]]) في $2
41 -
 47+
4248 السبب المعطى للإفراغ كان: ''<nowiki>$3</nowiki>''.
4349
4450 يمكنك [{{fullurl:{{FULLPAGENAMEE}}|action=history}} رؤية تاريخ المقالة], [{{fullurl:{{FULLPAGENAMEE}}|oldid=$4&action=edit}} تعديل آخر نسخة]،
@@ -63,7 +69,7 @@
6470 'purewikideletion-pref-watchblank' => 'Дадаваць у мой сьпіс назіраньня старонкі, якія я буду ачышчаць',
6571 'purewikideletion-pref-watchunblank' => 'Дадаваць у мой сьпіс назіраньня старонкі, у якіх я буду адмяняць ачыстку',
6672 'purewikideletion-blanked' => "Папярэдняя вэрсія гэтай старонкі была ачышчаная [[User:$1|$1]] ([[User talk:$1|гутаркі]]) ([[Special:Contributions/$1|унёсак]]) $2
67 -
 73+
6874 Пададзеная прычына ачысткі была: ''<nowiki>$3</nowiki>''.
6975
7076 Вы можаце [{{fullurl:{{FULLPAGENAMEE}}|action=history}} праглядзець гісторыю старонкі], [{{fullurl:{{FULLPAGENAMEE}}|oldid=$4&action=edit}} рэдагаваць апошнюю вэрсію], альбо ўвесьці тэкст новай старонкі ў белае поле ніжэй.",
@@ -211,7 +217,7 @@
212218 'purewikideletion-pref-watchblank' => 'Додавај ги страниците што ги празнам во мојата листа на набљудувања',
213219 'purewikideletion-pref-watchunblank' => 'Додавај ги испразнетите страници што ги враќам во мојата листа на набљудувања',
214220 'purewikideletion-blanked' => "Претходна верзија на оваа страница беше испразнета од [[User:$1|$1]] ([[User talk:$1|разговор]]) ([[Special:Contributions/$1|придонеси]]) на $2
215 -
 221+
216222 За испразнувањето беше наведена следнава причина: ''<nowiki>$3</nowiki>''.
217223
218224 Можете да ја [{{fullurl:{{FULLPAGENAMEE}}|action=history}} погледате историјата на статијата], да ја [{{fullurl:{{FULLPAGENAMEE}}|oldid=$4&action=edit}} уредите најновата верзија], или пак да напишете нова содржина за страницата во просторот подолу.",
Index: trunk/extensions/PureWikiDeletion/PureWikiDeletion.hooks.php
@@ -8,7 +8,7 @@
99 }
1010
1111 class PureWikiDeletionHooks {
12 -
 12+
1313 public static function PureWikiDeletionOutputPageParserOutputHook( &$out, $parseroutput ) {
1414 $dbr = wfGetDB( DB_SLAVE );
1515 $target = $out->getTitle();
@@ -28,11 +28,11 @@
2929 if ( $out->getPageTitle() == $target->getPrefixedText() ) {
3030 $out->redirect( $target->getEditURL() );
3131 }
32 -
 32+
3333 $out->setPageTitle( $out->getPageTitle() );
3434 return true;
3535 }
36 -
 36+
3737 public static function PureWikiDeletionSaveCompleteHook( &$article, &$user, $text, $summary,
3838 $minoredit, &$watchthis, $sectionanchor, &$flags, $revision, &$status, $baseRevId,
3939 &$redirect ) {
@@ -106,8 +106,8 @@
107107 }
108108 return true;
109109 }
110 -
111 -
 110+
 111+
112112 public static function PureWikiDeletionLink( $skin, $target, &$text, &$customAttribs, &$query, &$options
113113 , &$ret ) {
114114 global $wgPureWikiDeletionBlankLinkStyle;
@@ -135,7 +135,7 @@
136136 }
137137 return true;
138138 }
139 -
 139+
140140 public static function PureWikiDeletionEditHook( &$editPage ) {
141141 global $wgLang, $wgUser;
142142 wfLoadExtensionMessages( 'PureWikiDeletion' );
@@ -148,13 +148,13 @@
149149 'blank_summary',
150150 'blank_parent_id'
151151 );
152 -
 152+
153153 $result = $dbr->selectRow( 'blanked_page', $blank_row, array
154154 ( 'blank_page_id' => $blank_page_id ) );
155155 if ( !$result ) {
156156 return true;
157157 }
158 -
 158+
159159 $blank_user_id = $result->blank_user_id;
160160 if ( $blank_user_id == 0 ) {
161161 $blank_user_name = $result->blank_user_name;
@@ -162,21 +162,23 @@
163163 $blanking_user = User::newFromId( $blank_user_id );
164164 $blank_user_name = $blanking_user->getName();
165165 }
166 - $html = wfMsgExt( 'purewikideletion-blanked', 'parse', array
167 - ( $blank_user_name
168 - , $wgLang->timeanddate( wfTimestamp( TS_MW
169 - , $result->blank_timestamp ), true )
170 - , $result->blank_summary
171 - , $result->blank_parent_id ) );
172 - $editPage->editFormPageTop .= $html;
173 -
 166+ $html = wfMsgExt( 'purewikideletion-blanked', 'parse', array(
 167+ $blank_user_name,
 168+ $wgLang->timeanddate( wfTimestamp( TS_MW, $result->blank_timestamp ), true ),
 169+ $result->blank_summary,
 170+ $result->blank_parent_id,
 171+ $wgLang->date( wfTimestamp( TS_MW, $result->blank_timestamp ), true ),
 172+ $wgLang->time( wfTimestamp( TS_MW, $result->blank_timestamp ), true )
 173+ ) );
 174+ $editPage->editFormPageTop .= $html;
 175+
174176 if ($wgUser->getOption( 'watchunblank' )){
175177 $editPage->watchthis = true;
176178 }
177 -
 179+
178180 return true;
179181 }
180 -
 182+
181183 public static function PureWikiDeletionDeleteHook( &$article, &$user, $reason, $id )
182184 {
183185 $dbr = wfGetDB( DB_SLAVE );
@@ -190,7 +192,7 @@
191193 }
192194 return true;
193195 }
194 -
 196+
195197 public static function PureWikiDeletionUndeleteHook( $title, $create ) {
196198 $dbr = wfGetDB( DB_SLAVE );
197199 $myRevision = Revision::loadFromTitle( $dbr, $title );
@@ -208,14 +210,14 @@
209211 }
210212 return true;
211213 }
212 -
 214+
213215 public static function efPureWikiDeletionParserFunction_Setup( $parser ) {
214216 # Set a function hook associating the "example" magic word with our function
215217 $parser->setFunctionHook( 'ifnotblank', 'PureWikiDeletionHooks::efPureWikiDeletionParserFunction_RenderNotBlank' );
216218 $parser->setFunctionHook( 'ifblank', 'PureWikiDeletionHooks::efPureWikiDeletionParserFunction_RenderBlank' );
217219 return true;
218220 }
219 -
 221+
220222 public static function efPureWikiDeletionParserFunction_Magic( &$magicWords, $langCode ) {
221223 # Add the magic word
222224 # The first array element is whether to be case sensitive, in this case (0) it is not case
@@ -226,15 +228,15 @@
227229 # unless we return true, other parser functions extensions won't get loaded.
228230 return true;
229231 }
230 -
 232+
231233 public static function efPureWikiDeletionParserFunction_RenderBlank( $parser, $param1 = '', $param2 = '', $param3 = '' ) {
232234 return PureWikiDeletionHooks::evaluateBlankness ( $parser, $param1, $param2, $param3 );
233235 }
234 -
 236+
235237 public static function efPureWikiDeletionParserFunction_RenderNotBlank( $parser, $param1 = '', $param2 = '', $param3 = '' ) {
236238 return PureWikiDeletionHooks::evaluateBlankness ( $parser, $param1, $param3, $param2 );
237239 }
238 -
 240+
239241 public static function evaluateBlankness ( $parser, $param1 = '', $param2 = '', $param3 = '' ) {
240242 global $wgNamespaceAliases, $wgExpensiveParserFunctionLimit;
241243 if ( $parser->incrementExpensiveFunctionCount() ) {
@@ -262,7 +264,7 @@
263265 }
264266 return false; // If too many expensive functions have been run
265267 }
266 -
 268+
267269 public static function PureWikiDeletionCreateTable() {
268270 global $wgExtNewTables;
269271 $wgExtNewTables[] = array(
@@ -270,4 +272,4 @@
271273 dirname( __FILE__ ) . '/purewikideletiontable.sql' );
272274 return true;
273275 }
274 -}
\ No newline at end of file
 276+}

Status & tagging log