r39419 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39418‎ | r39419 | r39420 >
Date:18:08, 15 August 2008
Author:siebrand
Status:old
Tags:
Comment:
* remove dependency on ExtensionFunctions.php
* add $wgExtensionAliasesFiles and support in Translate
* method renamed for consistency with other extensions
* delayed message loading
Modified paths:
  • /trunk/extensions/PovWatch/PovWatch.alias.php (added) (history)
  • /trunk/extensions/PovWatch/PovWatch.php (modified) (history)
  • /trunk/extensions/PovWatch/PovWatch_body.php (modified) (history)
  • /trunk/extensions/Translate/aliases.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/PovWatch/PovWatch.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 if ( !defined( 'MEDIAWIKI' ) ):
54 ?>
65 <html>
@@ -40,9 +39,8 @@
4140 # 'povwatch_subscriber_list' => true,
4241 );
4342
44 -if ( !function_exists( 'extAddSpecialPage' ) ) {
45 - require( dirname(__FILE__) . '/../ExtensionFunctions.php' );
46 -}
47 -extAddSpecialPage( dirname(__FILE__) . '/PovWatch_body.php', 'PovWatch', 'PovWatchPage' );
4843 $dir = dirname(__FILE__) . '/';
49 -$wgExtensionMessagesFiles['povwatch'] = $dir . 'PovWatch.i18n.php';
 44+$wgExtensionMessagesFiles['PovWatch'] = $dir . 'PovWatch.i18n.php';
 45+$wgExtensionAliasesFiles['PovWatch'] = $dir . 'PovWatch.alias.php';
 46+$wgAutoloadClasses['SpecialPovWatch'] = $dir . 'PovWatch_body.php';
 47+$wgSpecialPages['PovWatch'] = 'SpecialPovWatch';
Index: trunk/extensions/PovWatch/PovWatch.alias.php
@@ -0,0 +1,11 @@
 2+<?php
 3+/**
 4+ * Aliases for special pages
 5+ *
 6+ */
 7+
 8+$aliases = array();
 9+
 10+$aliases['en'] = array(
 11+ 'PovWatch' => array( 'PovWatch' ),
 12+);
Property changes on: trunk/extensions/PovWatch/PovWatch.alias.php
___________________________________________________________________
Added: svn:eol-style
113 + native
Added: svn:keywords
214 + Id
Index: trunk/extensions/PovWatch/PovWatch_body.php
@@ -1,26 +1,7 @@
22 <?php
3 -if ( !defined( 'MEDIAWIKI' ) ):
4 -?>
5 -<html>
6 -<head><title>PovWatch Version 1.0</title></head>
7 -<body>
8 -<h1>PovWatch Version 1.0</h1>
9 -<p>
10 -This is a MediaWiki extension for pushing articles on to the watchlists of other users.
11 -To install it, add the following to the bottom of your <tt>LocalSettings.php</tt>,
12 -before the "?&gt;":</p>
13 -<pre>
14 -require_once( "$IP/extensions/PovWatch/PovWatch.php" );
15 -</pre>
16 -</body>
17 -</html>
18 -<?php
19 - exit(1);
20 -endif;
 3+if (!defined('MEDIAWIKI')) die();
214
22 - wfLoadExtensionMessages( 'povwatch' );
23 -
24 -class PovWatchPage extends SpecialPage {
 5+class SpecialPovWatch extends SpecialPage {
256 public $mPosted, $mTitleText, $mSubscribe, $mUnsubscribe, $mPush;
267 public $mComment, $mToken, $mOut;
278
@@ -35,6 +16,8 @@
3617 function execute( $subpage ) {
3718 global $wgRequest, $wgUser, $wgOut;
3819
 20+ wfLoadExtensionMessages( 'PovWatch' );
 21+
3922 $this->setHeaders();
4023
4124 if ( !$wgUser->isAllowed( 'povwatch_user' ) ) {
Index: trunk/extensions/Translate/aliases.txt
@@ -85,6 +85,9 @@
8686 Import users
8787 file = ImportUsers/SpecialImportUsers.alias.php
8888
 89+Inspect cache
 90+file = InspectCache/InspectCache.alias.php
 91+
8992 Interwiki
9093 file = Interwiki/SpecialInterwiki.alias.php
9194
@@ -115,6 +118,9 @@
116119 Oversight
117120 file = Oversight/HideRevision.alias.php
118121
 122+POV watch
 123+file = PovWatch/PovWatch.alias.php
 124+
119125 Rename user
120126 file = Renameuser/SpecialRenameuser.alias.php
121127

Status & tagging log