r19454 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19453‎ | r19454 | r19455 >
Date:15:13, 18 January 2007
Author:robchurch
Status:old
Tags:
Comment:
* Fix description for BookInformation
* Better descriptions for Contributors and MakeBot
* Descriptions for CountEdits, ProfileMonitor, RandomImage and Vote
* (Some additional minor restructuring here and there)
Modified paths:
  • /trunk/extensions/BookInformation/BookInformation.php (modified) (history)
  • /trunk/extensions/Contributors/Contributors.php (modified) (history)
  • /trunk/extensions/CountEdits/CountEdits.php (modified) (history)
  • /trunk/extensions/Makebot/Makebot.php (modified) (history)
  • /trunk/extensions/ProfileMonitor/ProfileMonitor.php (modified) (history)
  • /trunk/extensions/RandomImage/RandomImage.php (modified) (history)
  • /trunk/extensions/Vote/Vote.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Vote/Vote.php
@@ -12,10 +12,14 @@
1313
1414 if( defined( 'MEDIAWIKI' ) ) {
1515
16 - $wgExtensionCredits['specialpage'][] = array( 'name' => 'Vote', 'author' => 'Rob Church' );
17 - $wgExtensionFunctions[] = 'efVote';
1816 $wgAutoloadClasses['SpecialVote'] = dirname( __FILE__ ) . '/Vote.page.php';
1917 $wgSpecialPages['Vote'] = 'SpecialVote';
 18+ $wgExtensionFunctions[] = 'efVote';
 19+ $wgExtensionCredits['specialpage'][] = array(
 20+ 'name' => 'Vote',
 21+ 'author' => 'Rob Church',
 22+ 'description' => 'Provides simple polling capabilities',
 23+ );
2024
2125 /**
2226 * Users who can vote
Index: trunk/extensions/RandomImage/RandomImage.php
@@ -13,7 +13,12 @@
1414 if( defined( 'MEDIAWIKI' ) ) {
1515
1616 $wgExtensionFunctions[] = 'efRandomImage';
17 - $wgExtensionCredits['parserhook'][] = array( 'name' => 'RandomImage', 'author' => 'Rob Church', 'url' => 'http://meta.wikimedia.org/wiki/RandomImage' );
 17+ $wgExtensionCredits['parserhook'][] = array(
 18+ 'name' => 'RandomImage',
 19+ 'author' => 'Rob Church',
 20+ 'url' => 'http://meta.wikimedia.org/wiki/RandomImage',
 21+ 'description' => 'Provides a random media picker using <code><nowiki><randomimage /></nowiki></code>',
 22+ );
1823
1924 /**
2025 * Set this to true to disable the parser cache for pages which
Index: trunk/extensions/Contributors/Contributors.php
@@ -10,12 +10,12 @@
1111
1212 if( defined( 'MEDIAWIKI' ) ) {
1313
 14+ $wgExtensionFunctions[] = 'efContributors';
1415 $wgExtensionCredits['specialpage'][] = array(
1516 'name' => 'Contributors',
1617 'author' => 'Rob Church',
17 - 'description' => 'Lists the ten most prominent [[Special:Contributors|contributors]] to an article and adds toolbox link',
 18+ 'description' => 'Summarises the main contributors to an article',
1819 );
19 - $wgExtensionFunctions[] = 'efContributors';
2020
2121 $wgAutoloadClasses['SpecialContributors'] = dirname( __FILE__ ) . '/Contributors.page.php';
2222 $wgSpecialPages['Contributors'] = 'SpecialContributors';
Index: trunk/extensions/BookInformation/BookInformation.php
@@ -23,7 +23,7 @@
2424 $wgExtensionCredits['other'][] = array(
2525 'name' => 'Book Information',
2626 'author' => 'Rob Church',
27 - 'desc' => 'Expands [[Special:Booksources]] with information from a web service',
 27+ 'description' => 'Expands [[Special:Booksources]] with information from a web service',
2828 );
2929
3030 /**
Index: trunk/extensions/CountEdits/CountEdits.php
@@ -10,8 +10,12 @@
1111
1212 if( defined( 'MEDIAWIKI' ) ) {
1313
14 - $wgExtensionCredits['specialpage'][] = array( 'name' => 'Count Edits', 'author' => 'Rob Church' );
1514 $wgExtensionFunctions[] = 'efCountEdits';
 15+ $wgExtensionCredits['specialpage'][] = array(
 16+ 'name' => 'Count Edits',
 17+ 'author' => 'Rob Church',
 18+ 'description' => 'Special page that counts user edits and provides a top-ten contributor list',
 19+ );
1620
1721 /* This line will have no effect on pre-1.7 wikis */
1822 $wgAutoloadClasses['SpecialCountEdits'] = dirname( __FILE__ ) . '/CountEdits.page.php';
Index: trunk/extensions/ProfileMonitor/ProfileMonitor.php
@@ -14,8 +14,12 @@
1515 $wgAutoloadClasses['ProfileMonitor'] = dirname( __FILE__ ) . '/ProfileMonitor.class.php';
1616 $wgSpecialPages['Profiling'] = 'ProfileMonitor';
1717
18 - $wgExtensionCredits['specialpage'][] = array( 'name' => 'ProfileMonitor', 'author' => 'Rob Church' );
1918 $wgExtensionFunctions[] = 'efProfileMonitor';
 19+ $wgExtensionCredits['specialpage'][] = array(
 20+ 'name' => 'ProfileMonitor',
 21+ 'author' => 'Rob Church',
 22+ 'description' => 'Special page to expose profiling data',
 23+ );
2024
2125 function efProfileMonitor() {
2226 global $wgMessageCache, $wgHooks;
Index: trunk/extensions/Makebot/Makebot.php
@@ -10,56 +10,55 @@
1111 * @copyright © 2006 Rob Church
1212 * @licence GNU General Public Licence 2.0 or later
1313 */
14 -
15 -if( !defined( 'MEDIAWIKI' ) ) {
16 - echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
17 - die( 1 );
18 -}
1914
20 -define( 'MW_MAKEBOT_GRANT', 1 );
21 -define( 'MW_MAKEBOT_REVOKE', 2 );
 15+if( defined( 'MEDIAWIKI' ) ) {
2216
23 -$wgExtensionFunctions[] = 'efMakeBot';
24 -$wgAvailableRights[] = 'makebot';
25 -$wgExtensionCredits['specialpage'][] = array(
26 - 'name' => 'MakeBot',
27 - 'author' => 'Rob Church',
28 - 'url' => 'http://www.mediawiki.org/wiki/Extension:MakeBot',
29 - 'description' => 'Allow users bot flag granting and revoking',
30 - );
31 -
32 -/**
33 - * Determines who can use the extension; as a default, bureaucrats are permitted
34 - */
35 -$wgGroupPermissions['bureaucrat']['makebot'] = true;
36 -
37 -/**
38 - * Toggles whether or not a bot flag can be given to a user who is also a sysop or bureaucrat
39 - */
40 -$wgMakeBotPrivileged = false;
41 -
42 -/**
43 - * Register the special page
44 - */
45 -$wgAutoloadClasses['Makebot'] = dirname( __FILE__ ) . '/Makebot.class.php';
46 -$wgSpecialPages['Makebot'] = 'Makebot';
47 -
48 -/**
49 - * Populate the message cache and set up the auditing
50 - */
51 -function efMakeBot() {
52 - global $wgMessageCache, $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
 17+ define( 'MW_MAKEBOT_GRANT', 1 );
 18+ define( 'MW_MAKEBOT_REVOKE', 2 );
5319
54 - require_once( 'Makebot.i18n.php' );
55 - foreach( efMakeBotMessages() as $lang => $messages )
56 - $wgMessageCache->addMessages( $messages, $lang );
 20+ $wgExtensionFunctions[] = 'efMakeBot';
 21+ $wgAvailableRights[] = 'makebot';
 22+ $wgExtensionCredits['specialpage'][] = array(
 23+ 'name' => 'MakeBot',
 24+ 'author' => 'Rob Church',
 25+ 'url' => 'http://www.mediawiki.org/wiki/Extension:MakeBot',
 26+ 'description' => 'Special page allows local bureaucrats to grant and revoke bot permissions',
 27+ );
5728
58 - $wgLogTypes[] = 'makebot';
59 - $wgLogNames['makebot'] = 'makebot-logpage';
60 - $wgLogHeaders['makebot'] = 'makebot-logpagetext';
61 - $wgLogActions['makebot/grant'] = 'makebot-logentrygrant';
62 - $wgLogActions['makebot/revoke'] = 'makebot-logentryrevoke';
 29+ /**
 30+ * Determines who can use the extension; as a default, bureaucrats are permitted
 31+ */
 32+ $wgGroupPermissions['bureaucrat']['makebot'] = true;
 33+
 34+ /**
 35+ * Toggles whether or not a bot flag can be given to a user who is also a sysop or bureaucrat
 36+ */
 37+ $wgMakeBotPrivileged = false;
 38+
 39+ /**
 40+ * Register the special page
 41+ */
 42+ $wgAutoloadClasses['Makebot'] = dirname( __FILE__ ) . '/Makebot.class.php';
 43+ $wgSpecialPages['Makebot'] = 'Makebot';
 44+
 45+ /**
 46+ * Populate the message cache and set up the auditing
 47+ */
 48+ function efMakeBot() {
 49+ global $wgMessageCache, $wgLogTypes, $wgLogNames, $wgLogHeaders, $wgLogActions;
 50+ require_once( dirname( __FILE__ ) . '/Makebot.i18n.php' );
 51+ foreach( efMakeBotMessages() as $lang => $messages )
 52+ $wgMessageCache->addMessages( $messages, $lang );
 53+ $wgLogTypes[] = 'makebot';
 54+ $wgLogNames['makebot'] = 'makebot-logpage';
 55+ $wgLogHeaders['makebot'] = 'makebot-logpagetext';
 56+ $wgLogActions['makebot/grant'] = 'makebot-logentrygrant';
 57+ $wgLogActions['makebot/revoke'] = 'makebot-logentryrevoke';
 58+ }
 59+
 60+} else {
 61+ echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
 62+ exit( 1 );
6363 }
6464
65 -
6665 ?>