r62155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62154‎ | r62155 | r62156 >
Date:01:34, 9 February 2010
Author:tstarling
Status:ok
Tags:
Comment:
Fixing filename. Move only, updates to code will follow.
Modified paths:
  • /trunk/extensions/ExternalPages/ExternalPages.php (added) (history)
  • /trunk/extensions/ExternalPages/SpecialExternalPages.php (deleted) (history)

Diff [purge]

Index: trunk/extensions/ExternalPages/SpecialExternalPages.php
@@ -1,50 +0,0 @@
2 -<?php
3 -/**
4 - * A Special Page extension to retrieve and display a page
5 - * from a specified external WMF site, with optional year,
6 - * project and language parameters
7 - *
8 - * @file
9 - * @ingroup Extensions
10 - * @version 0.1
11 - * @author Ariel Glenn <ariel@wikimedia.org>
12 - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 3.0 or later
13 - */
14 -
15 -if ( !defined( 'MEDIAWIKI' ) ) {
16 - echo <<<EOT
17 -To install the ExternalPages extension, put the following line in LocalSettings.php:
18 -require_once( "\$IP/extensions/ExternalPages/SpecialExternalPages.php" );
19 -EOT;
20 - exit( 1 );
21 -}
22 -
23 -// Extension credits that will show up on Special:Version
24 -$wgExtensionCredits['specialpage'][] = array(
25 - 'name' => 'ExternalPages',
26 - 'version' => '0.1',
27 - 'author' => 'Ariel Glenn',
28 - 'url' => 'http://www.mediawiki.org/wiki/Extension:ExternalPages',
29 - 'description' => 'Retrieve and display page from a remote WMF site',
30 - 'descriptionmsg' => 'externalpages-desc',
31 -);
32 -
33 -$dir = dirname( __FILE__ ) . '/';
34 -$wgExtensionMessagesFiles['ExternalPages'] = $dir . 'ExternalPages.i18n.php';
35 -$wgExtensionAliasesFiles['ExternalPages'] = $dir . 'ExternalPages.alias.php';
36 -
37 -$wgAutoloadClasses['ExternalPages'] = $dir . 'ExternalPages_body.php';
38 -
39 -$wgSpecialPages['ExternalPages'] = 'ExternalPages';
40 -$wgSpecialPageGroups['ExternalPages'] = 'users';
41 -$wgHooks['LanguageGetSpecialPageAliases'][] = 'externalPagesLocalizedPageName';
42 -
43 -function externalPagesLocalizedPageName( &$specialPageArray, $code ) {
44 - wfLoadExtensionMessages( 'ExternalPages' );
45 - $text = wfMsg( 'externalpages' );
46 -
47 - # Convert from title in text form to DBKey and put it into the alias array:
48 - $title = Title::newFromText( $text );
49 - $specialPageArray['ExternalPages'][] = $title->getDBKey();
50 - return true;
51 -}
\ No newline at end of file
Index: trunk/extensions/ExternalPages/ExternalPages.php
@@ -0,0 +1,50 @@
 2+<?php
 3+/**
 4+ * A Special Page extension to retrieve and display a page
 5+ * from a specified external WMF site, with optional year,
 6+ * project and language parameters
 7+ *
 8+ * @file
 9+ * @ingroup Extensions
 10+ * @version 0.1
 11+ * @author Ariel Glenn <ariel@wikimedia.org>
 12+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 3.0 or later
 13+ */
 14+
 15+if ( !defined( 'MEDIAWIKI' ) ) {
 16+ echo <<<EOT
 17+To install the ExternalPages extension, put the following line in LocalSettings.php:
 18+require_once( "\$IP/extensions/ExternalPages/SpecialExternalPages.php" );
 19+EOT;
 20+ exit( 1 );
 21+}
 22+
 23+// Extension credits that will show up on Special:Version
 24+$wgExtensionCredits['specialpage'][] = array(
 25+ 'name' => 'ExternalPages',
 26+ 'version' => '0.1',
 27+ 'author' => 'Ariel Glenn',
 28+ 'url' => 'http://www.mediawiki.org/wiki/Extension:ExternalPages',
 29+ 'description' => 'Retrieve and display page from a remote WMF site',
 30+ 'descriptionmsg' => 'externalpages-desc',
 31+);
 32+
 33+$dir = dirname( __FILE__ ) . '/';
 34+$wgExtensionMessagesFiles['ExternalPages'] = $dir . 'ExternalPages.i18n.php';
 35+$wgExtensionAliasesFiles['ExternalPages'] = $dir . 'ExternalPages.alias.php';
 36+
 37+$wgAutoloadClasses['ExternalPages'] = $dir . 'ExternalPages_body.php';
 38+
 39+$wgSpecialPages['ExternalPages'] = 'ExternalPages';
 40+$wgSpecialPageGroups['ExternalPages'] = 'users';
 41+$wgHooks['LanguageGetSpecialPageAliases'][] = 'externalPagesLocalizedPageName';
 42+
 43+function externalPagesLocalizedPageName( &$specialPageArray, $code ) {
 44+ wfLoadExtensionMessages( 'ExternalPages' );
 45+ $text = wfMsg( 'externalpages' );
 46+
 47+ # Convert from title in text form to DBKey and put it into the alias array:
 48+ $title = Title::newFromText( $text );
 49+ $specialPageArray['ExternalPages'][] = $title->getDBKey();
 50+ return true;
 51+}
\ No newline at end of file
Property changes on: trunk/extensions/ExternalPages/ExternalPages.php
___________________________________________________________________
Name: svn:eol-style
152 + native

Status & tagging log