summaryrefslogtreecommitdiff
path: root/extensions/ImageMap/ImageMap.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /extensions/ImageMap/ImageMap.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'extensions/ImageMap/ImageMap.php')
-rw-r--r--extensions/ImageMap/ImageMap.php51
1 files changed, 10 insertions, 41 deletions
diff --git a/extensions/ImageMap/ImageMap.php b/extensions/ImageMap/ImageMap.php
index 081eeaa6..71b9d9b2 100644
--- a/extensions/ImageMap/ImageMap.php
+++ b/extensions/ImageMap/ImageMap.php
@@ -1,45 +1,14 @@
<?php
-/**
- * ImageMap extension - Allows clickable HTML image maps.
- *
- * @link https://www.mediawiki.org/wiki/Extension:ImageMap Documentation
- *
- * @file
- * @ingroup Extensions
- * @package MediaWiki
- * @author Tim Starling
- * @copyright (C) 2007 Tim Starling
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
- */
-if ( !defined( 'MEDIAWIKI' ) ) {
- die( 'This file is a MediaWiki extension, it is not a valid entry point' );
-}
-
-//self executing anonymous function to prevent global scope assumptions
-call_user_func( function() {
- $dir = __DIR__ . '/';
- $GLOBALS['wgMessagesDirs']['ImageMap'] = __DIR__ . '/i18n';
- $GLOBALS['wgExtensionMessagesFiles']['ImageMap'] = $dir . 'ImageMap.i18n.php';
- $GLOBALS['wgAutoloadClasses']['ImageMap'] = $dir . 'ImageMap_body.php';
- $GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'wfSetupImageMap';
-
- $GLOBALS['wgExtensionCredits']['parserhook']['ImageMap'] = array(
- 'path' => __FILE__,
- 'name' => 'ImageMap',
- 'author' => 'Tim Starling',
- 'url' => 'https://www.mediawiki.org/wiki/Extension:ImageMap',
- 'descriptionmsg' => 'imagemap_desc',
- );
-
- $GLOBALS['wgParserTestFiles'][] = $dir . 'imageMapParserTests.txt';
-} );
-
-/**
- * @param $parser Parser
- * @return bool
- */
-function wfSetupImageMap( &$parser ) {
- $parser->setHook( 'imagemap', array( 'ImageMap', 'render' ) );
+if ( function_exists( 'wfLoadExtension' ) ) {
+ wfLoadExtension( 'ImageMap' );
+ // Keep i18n globals so mergeMessageFileList.php doesn't break
+ $wgMessagesDirs['ImageMap'] = __DIR__ . '/i18n';
+ /* wfWarn(
+ 'Deprecated PHP entry point used for ImageMap extension. Please use wfLoadExtension instead, ' .
+ 'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
+ ); */
return true;
+} else {
+ die( 'This version of the ImageMap extension requires MediaWiki 1.25+' );
}