r30804 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30803‎ | r30804 | r30805 >
Date:17:47, 10 February 2008
Author:siebrand
Status:old
Tags:
Comment:
* EditUser: use wfLoadExtensionMessages, update extension credits, add descriptionmsg, bump version
* Translate: add support for EditUser
Modified paths:
  • /trunk/extensions/EditUser/EditUser.i18n.php (modified) (history)
  • /trunk/extensions/EditUser/EditUser.php (modified) (history)
  • /trunk/extensions/EditUser/EditUser_body.php (modified) (history)
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/EditUser/EditUser_body.php
@@ -11,7 +11,7 @@
1212 var $mReset, $mPosted, $mToggles, $mUseAjaxSearch, $mSearchNs, $mRealName, $mImageSize;
1313 var $mUnderline, $mWatchlistEdits;
1414
15 - function EditUser() {
 15+ public function __construct() {
1616 SpecialPage::SpecialPage('EditUser', 'edituser');
1717 }
1818
@@ -89,12 +89,15 @@
9090 return true;
9191 }
9292
93 - function execute( $par ) {
 93+ public function execute( $par ) {
9494 global $wgOut, $wgUser, $wgRequest;
9595 if( !$wgUser->isAllowed( 'edituser' ) ) {
9696 $wgOut->permissionRequired( 'edituser' );
9797 return false;
9898 }
 99+
 100+ wfLoadExtensionMessages( 'EditUser' );
 101+
99102 $this->setHeaders();
100103 if(!isset($par))
101104 $wgOut->addHtml($this->makeSearchForm());
Index: trunk/extensions/EditUser/EditUser.i18n.php
@@ -1,23 +1,29 @@
22 <?php
 3+/**
 4+ * Internationalisation file for extension EditUser.
 5+ *
 6+ * @addtogroup Extensions
 7+*/
38
4 -function efEditUserMessages() {
5 - $messages = array(
6 -
7 - /* English (Ryan Schmidt) */
8 - 'en' => array(
9 - 'edituser' => 'Edit User',
10 - 'edituser-logout' => 'Log user out',
11 - 'edituser-username' => 'Name',
12 - 'edituser-dosearch' => 'Search',
13 - ),
14 - /* Finnish (Jack Phoenix) */
15 - 'fi' => array(
16 - 'edituser' => 'Muokkaa käyttäjää',
17 - 'edituser-logout' => 'Kirjaa käyttäjä ulos',
18 - 'edituser-username' => 'Nimi',
19 - 'edituser-dosearch' => 'Hae',
20 - ),
21 - );
 9+$messages = array();
2210
23 - return $messages;
24 -}
 11+/* English
 12+ @ author Ryan Schmidt
 13+ */
 14+$messages['en'] = array(
 15+ 'edituser-desc' => 'Allows privileged users to edit other users\' preferences',
 16+ 'edituser' => 'Edit User',
 17+ 'edituser-logout' => 'Log user out',
 18+ 'edituser-username' => 'Name',
 19+ 'edituser-dosearch' => 'Search',
 20+);
 21+
 22+/* Finnish
 23+ * @author Jack Phoenix
 24+ */
 25+$messages['fi'] = array(
 26+ 'edituser' => 'Muokkaa käyttäjää',
 27+ 'edituser-logout' => 'Kirjaa käyttäjä ulos',
 28+ 'edituser-username' => 'Nimi',
 29+ 'edituser-dosearch' => 'Hae',
 30+);
Index: trunk/extensions/EditUser/EditUser.php
@@ -9,25 +9,16 @@
1010 }
1111
1212 $wgExtensionCredits['specialpage'][] = array(
13 -'name' => 'EditUser',
14 -'description' => 'Allows privelaged users to edit other users\' preferences',
15 -'author' => 'Ryan Schmidt',
16 -'version' => '1.2',
17 -'url' => 'http://www.mediawiki.org/wiki/Extension:EditUser',
 13+ 'name' => 'EditUser',
 14+ 'version' => '1.3',
 15+ 'author' => 'Ryan Schmidt',
 16+ #'description' => 'Allows privileged users to edit other users\' preferences',
 17+ 'descriptionmsg' => 'edituser-desc',
 18+ 'url' => 'http://www.mediawiki.org/wiki/Extension:EditUser',
1819 );
1920
20 -$wgAutoloadClasses['EditUser'] = dirname(__FILE__) . '/EditUser.page.php';
 21+$dir = dirname(__FILE__) . '/';
 22+$wgExtensionMessagesFiles['EditUser'] = $dir .'EditUser.i18n.php';
 23+$wgAutoloadClasses['EditUser'] = $dir . 'EditUser_body.php';
2124 $wgSpecialPages['EditUser'] = 'EditUser';
2225 $wgAvailableRights[] = 'edituser';
23 -
24 -$wgExtensionFunctions[] = 'efEditUser';
25 -
26 -/**
27 -* Populate the message cache and register the special page
28 -*/
29 -function efEditUser() {
30 - global $wgMessageCache;
31 - require_once( dirname( __FILE__ ) . '/EditUser.i18n.php' );
32 - foreach( efEditUserMessages() as $lang => $messages )
33 - $wgMessageCache->addMessages( $messages, $lang );
34 -}
Index: trunk/extensions/Translate/Translate.php
@@ -11,7 +11,7 @@
1212 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
1313 */
1414
15 -define( 'TRANSLATE_VERSION', '8.2' );
 15+define( 'TRANSLATE_VERSION', '8.3' );
1616
1717 $wgExtensionCredits['specialpage'][] = array(
1818 'name' => 'Translate',
@@ -128,6 +128,7 @@
129129 'ext-dismissablesitenotice' => 'DismissableSiteNoticeMessageGroup',
130130 'ext-duplicator' => 'DuplicatorMessageGroup',
131131 'ext-editcount' => 'EditcountMessageGroup',
 132+'ext-edituser' => 'EditUserMessageGroup',
132133 'ext-eval' => 'EvalMessageGroup',
133134 'ext-expandtemplates' => 'ExpandTemplatesMessageGroup',
134135 'ext-farmer' => 'FarmerMessageGroup',
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1083,6 +1083,14 @@
10841084 protected $messageFile = 'Editcount/SpecialEditcount.i18n.php';
10851085 }
10861086
 1087+class EditUserMessageGroup extends ExtensionMessageGroup {
 1088+ protected $label = 'Edit User';
 1089+ protected $id = 'ext-edituser';
 1090+
 1091+ protected $arrName = 'messages';
 1092+ protected $messageFile = 'EditUser/EditUser.i18n.php';
 1093+}
 1094+
10871095 class EvalMessageGroup extends ExtensionMessageGroup {
10881096 protected $label = 'Eval';
10891097 protected $id = 'ext-eval';

Status & tagging log