[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/extensions/ImageMap/ -> ImageMap.php (source)

   1  <?php
   2  /**
   3   * ImageMap extension - Allows clickable HTML image maps.
   4   *
   5   * @link https://www.mediawiki.org/wiki/Extension:ImageMap Documentation
   6   *
   7   * @file
   8   * @ingroup Extensions
   9   * @package MediaWiki
  10   * @author Tim Starling
  11   * @copyright (C) 2007 Tim Starling
  12   * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
  13   */
  14  
  15  if ( !defined( 'MEDIAWIKI' ) ) {
  16     die( 'This file is a MediaWiki extension, it is not a valid entry point' );
  17  }
  18  
  19  //self executing anonymous function to prevent global scope assumptions
  20  call_user_func( function() {
  21      $dir = __DIR__ . '/';
  22      $GLOBALS['wgMessagesDirs']['ImageMap'] = __DIR__ . '/i18n';
  23      $GLOBALS['wgExtensionMessagesFiles']['ImageMap'] = $dir . 'ImageMap.i18n.php';
  24      $GLOBALS['wgAutoloadClasses']['ImageMap'] = $dir . 'ImageMap_body.php';
  25      $GLOBALS['wgHooks']['ParserFirstCallInit'][] = 'wfSetupImageMap';
  26  
  27      $GLOBALS['wgExtensionCredits']['parserhook']['ImageMap'] = array(
  28          'path'           => __FILE__,
  29          'name'           => 'ImageMap',
  30          'author'         => 'Tim Starling',
  31          'url'            => 'https://www.mediawiki.org/wiki/Extension:ImageMap',
  32          'descriptionmsg' => 'imagemap_desc',
  33      );
  34  
  35      $GLOBALS['wgParserTestFiles'][] = $dir . 'imageMapParserTests.txt';
  36  } );
  37  
  38  /**
  39   * @param $parser Parser
  40   * @return bool
  41   */
  42  function wfSetupImageMap( &$parser ) {
  43      $parser->setHook( 'imagemap', array( 'ImageMap', 'render' ) );
  44      return true;
  45  }


Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1