http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56302
Revision: 56302
Author: aaron
Date: 2009-09-14 13:46:39 +0000 (Mon, 14 Sep 2009)
Log Message:
-----------
* Delay message loading
* More cleanups
Modified Paths:
--------------
trunk/extensions/ConfirmAccount/ConfirmAccount_body.php
Modified: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php
===================================================================
--- trunk/extensions/ConfirmAccount/ConfirmAccount_body.php 2009-09-14
13:43:07 UTC (rev 56301)
+++ trunk/extensions/ConfirmAccount/ConfirmAccount_body.php 2009-09-14
13:46:39 UTC (rev 56302)
@@ -5,10 +5,6 @@
exit( 1 );
}
-# FIXME: delay message loading!
-# Add messages
-wfLoadExtensionMessages( 'ConfirmAccount' );
-
class ConfirmAccountsPage extends SpecialPage
{
@@ -28,6 +24,8 @@
return;
}
+ # Load UI messages
+ wfLoadExtensionMessages( 'ConfirmAccount' );
$this->setHeaders();
$this->specialPageParameter = $par;
@@ -151,9 +149,9 @@
}
}
- function showQueues() {
+ protected function showQueues() {
global $wgOut, $wgAccountRequestTypes, $wgLang;
-
+ wfLoadExtensionMessages( 'ConfirmAccount' ); // load UI messages
$wgOut->addWikiText( wfMsg('confirmaccount-maintext') );
$wgOut->addHTML( '<p><strong>' .
wfMsgHtml('confirmaccount-types') . '</strong></p>' );
@@ -194,9 +192,9 @@
$wgOut->addHTML( '</ul>' );
}
- function showForm( $msg='' ) {
+ protected function showForm( $msg='' ) {
global $wgOut, $wgUser, $wgLang, $wgAccountRequestTypes;
-
+ wfLoadExtensionMessages( 'ConfirmAccount' ); // load UI messages
$titleObj = SpecialPage::getTitleFor( 'ConfirmAccounts',
$this->specialPageParameter );
$row = $this->getRequest();
@@ -376,7 +374,7 @@
/**
* Show a private file requested by the visitor.
*/
- function showFile( $key ) {
+ protected function showFile( $key ) {
global $wgOut, $wgRequest, $wgConfirmAccountFSRepos, $IP;
$wgOut->disable();
@@ -395,8 +393,9 @@
wfStreamFile( $path );
}
- function doSubmit() {
+ protected function doSubmit() {
global $wgOut, $wgUser;
+ wfLoadExtensionMessages( 'ConfirmAccount' ); // load UI messages
$titleObj = SpecialPage::getTitleFor( 'ConfirmAccounts',
$this->specialPageParameter );
$row = $this->getRequest( true );
if( !$row ) {
@@ -698,8 +697,8 @@
$db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
$row = $db->selectRow( 'account_requests', '*',
array( 'acr_id' => $this->acrID ),
- __METHOD__ );
-
+ __METHOD__
+ );
# Check if parameters are to be overridden
if( $row ) {
$this->mUsername = $this->mUsername ? $this->mUsername
: $row->acr_name;
@@ -727,6 +726,7 @@
*/
public static function parseLinks( $text ) {
global $wgParser, $wgUser;
+ wfLoadExtensionMessages( 'ConfirmAccount' ); // load UI messages
# Don't let this get flooded
$max = 10;
$count = 0;
@@ -754,12 +754,12 @@
} else {
$linkList = "<ul>{$linkList}</ul>";
}
-
return $linkList;
}
- function showSuccess( $titleObj, $name = NULL, $errors = array() ) {
+ protected function showSuccess( $titleObj, $name = NULL, $errors =
array() ) {
global $wgOut;
+ wfLoadExtensionMessages( 'ConfirmAccount' ); // load UI messages
$titleObj = SpecialPage::getTitleFor( 'ConfirmAccounts',
$this->specialPageParameter );
$wgOut->setPagetitle( wfMsgHtml('actioncomplete') );
@@ -779,8 +779,9 @@
$wgOut->returnToMain( true, $titleObj );
}
- function showList() {
+ protected function showList() {
global $wgOut, $wgUser, $wgLang;
+ wfLoadExtensionMessages( 'ConfirmAccount' ); // load UI messages
$titleObj = SpecialPage::getTitleFor( 'ConfirmAccounts',
$this->specialPageParameter );
@@ -863,7 +864,7 @@
$wgMemc->delete( $key );
}
- function formatRow( $row ) {
+ public function formatRow( $row ) {
global $wgLang, $wgUser, $wgUseRealNamesOnly, $wgAllowRealName;
$titleObj = SpecialPage::getTitleFor( 'ConfirmAccounts',
$this->specialPageParameter );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs