e945b7f487c0de0884acdebc9a93b7e0ac3ac943
[editimage_extension] / EditImage.php
1 <?php   
2
3 # Alert the user that this is not a valid entry point to MediaWiki if
4 # they try to access the special pages file directly.
5 if (!defined('MEDIAWIKI')) {
6         echo <<<EOT
7 To install my extension, put the following line in LocalSettings.php:
8 require_once( "\$IP/extensions/EditImage/EditImage.php" );
9 EOT;
10         exit( 1 );
11 }
12
13 $dir = dirname(__FILE__) . '/';
14 $wgAutoloadClasses['EditImage'] = $dir . 'EditImage_body.php';
15 $wgExtensionMessagesFiles['EditImage'] = $dir . 'EditImage.i18n.php';
16 $wgSpecialPages['EditImage'] = 'EditImage'; 
17 # $wgHooks['LanguageGetSpecialPageAliases'][] = 'EditImageLocalizedPageName';
18
19 function myExtensionLocalizedPageName(&$specialPageArray, $code) {
20   # The localized title of the special page is among the messages of the extension:
21   wfLoadExtensionMessages('EditImage');
22   $text = wfMsg('editimage');
23
24   # Convert from title in text form to DBKey and put it into the alias array:
25   $title = Title::newFromText($text);
26   $specialPageArray['EditImage'][] = $title->getDBKey();
27
28   return true;
29 }
30
31 $wgExtensionCredits['specialpage'][] = array(
32     'name' => 'EditImage',
33     'version' => '0.1',
34     'author' => 'Benjamin Mako Hill', 
35     'url' => 'http://www.mediawiki.org/wiki/User:Benjamin_Mako_Hill', 
36     'description' => 'This extension provides a way for Mediawiki users to edit images from the web.'
37 );
38
39
40
41 ?>

Benjamin Mako Hill || Want to submit a patch?