r39420 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39419‎ | r39420 | r39421 >
Date:18:18, 15 August 2008
Author:siebrand
Status:old
Tags:
Comment:
* remove dependency on ExtensionFunctions.php
* add $wgExtensionAliasesFiles (no support in Translate because it is an example extension)
* method renamed for consistency with other extensions
* delayed message loading
Modified paths:
  • /trunk/extensions/UnicodeConverter/UnicodeConverter.alias.php (added) (history)
  • /trunk/extensions/UnicodeConverter/UnicodeConverter.i18n.php (modified) (history)
  • /trunk/extensions/UnicodeConverter/UnicodeConverter.php (modified) (history)
  • /trunk/extensions/UnicodeConverter/UnicodeConverter_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UnicodeConverter/UnicodeConverter_body.php
@@ -4,17 +4,17 @@
55 exit( 1 );
66 }
77
8 -wfLoadExtensionMessages( 'UnicodeConverter' );
9 -
10 -class UnicodeConverter extends SpecialPage
 8+class SpecialUnicodeConverter extends SpecialPage
119 {
12 - function UnicodeConverter() {
 10+ function __construct() {
1311 SpecialPage::SpecialPage("UnicodeConverter");
1412 }
1513
1614 function execute( $par ) {
1715 global $wgRequest, $wgOut, $wgTitle;
1816
 17+ wfLoadExtensionMessages( 'UnicodeConverter' );
 18+
1919 $this->setHeaders();
2020
2121 $q = $wgRequest->getText( 'q' );
Index: trunk/extensions/UnicodeConverter/UnicodeConverter.i18n.php
@@ -1,7 +1,7 @@
22 <?php
33 /**
44 * Internationalisation file for extension UnicodeConvertor.
5 - * Created by Bertrand GRON
 5+ * Created by Bertrand GRONDIN
66 *
77 * @addtogroup Extensions
88 */
Index: trunk/extensions/UnicodeConverter/UnicodeConverter.php
@@ -12,16 +12,15 @@
1313
1414 $wgExtensionCredits['specialpage'][] = array(
1515 'name' => 'Unicode Converter',
16 - //'version' => '1.0',
 16+ //'version' => '1.1',
1717 'author' => 'Tim Starling',
1818 'description' => 'A simple example of a special page module. Given a string in UTF-8, it converts it to HTML entities suitable for an ISO 8859-1 web page',
1919 'url' => 'http://www.mediawiki.org/wiki/Extension:UnicodeConvertor',
2020 'descriptionmsg' => 'unicodeconverter-desc',
2121 );
2222
23 -if ( !function_exists( 'extAddSpecialPage' ) ) {
24 - require( dirname(__FILE__) . '/../ExtensionFunctions.php' );
25 -}
26 -extAddSpecialPage( dirname(__FILE__) . '/UnicodeConverter_body.php', 'UnicodeConverter', 'UnicodeConverter' );
2723 $dir = dirname(__FILE__) . '/';
2824 $wgExtensionMessagesFiles['UnicodeConverter'] = $dir . 'UnicodeConverter.i18n.php';
 25+$wgExtensionAliasesFiles['UnicodeConverter'] = $dir . 'UnicodeConverter.alias.php';
 26+$wgAutoloadClasses['SpecialUnicodeConverter'] = $dir . 'UnicodeConverter_body.php';
 27+$wgSpecialPages['UnicodeConverter'] = 'SpecialUnicodeConverter';
Index: trunk/extensions/UnicodeConverter/UnicodeConverter.alias.php
@@ -0,0 +1,15 @@
 2+<?php
 3+/**
 4+ * Aliases for special pages
 5+ *
 6+ */
 7+
 8+$aliases = array();
 9+
 10+$aliases['en'] = array(
 11+ 'UnicodeConvertor' => array( 'UnicodeConvertor' ),
 12+);
 13+
 14+$aliases['nl'] = array(
 15+ 'UnicodeConvertor' => array( 'UnicodeConverteren' ),
 16+);
Property changes on: trunk/extensions/UnicodeConverter/UnicodeConverter.alias.php
___________________________________________________________________
Added: svn:eol-style
117 + native
Added: svn:keywords
218 + Id

Status & tagging log