Added an extension, called EditSectionHiliteLink, that highlights the appropriate...
[lhc/web/wiklou.git] / extensions / EditSectionHiliteLink / EditSectionHiliteLink.php
1 <?php
2 /**
3 * EditSectionHiliteLink extension
4 *
5 * @file
6 * @ingroup Extensions
7 *
8 * This file contains the main include file for the EditSectionHiliteLink extension of
9 * MediaWiki.
10 *
11 * Usage: Add the following line in LocalSettings.php:
12 * require_once( "$IP/extensions/EditSectionHiliteLink/EditSectionHiliteLink.php" );
13 *
14 * @author Arash Boostani <aboostani@wikimedia.org>
15 * @license GPL v2
16 * @version 0.1.0
17 */
18
19 // Check environment
20 if ( !defined( 'MEDIAWIKI' ) ) {
21 echo( "This is an extension to MediaWiki and cannot be run standalone.\n" );
22 die( - 1 );
23 }
24
25 /* Configuration */
26
27 // Credits
28 $wgExtensionCredits['other'][] = array(
29 'path' => __FILE__,
30 'name' => 'EditSectionHiliteLink',
31 'author' => 'Arash Boostani',
32 'url' => 'http://www.mediawiki.org/wiki/Extension:EditSectionHiliteLink',
33 'description' => 'Hilight the appropriate section of an article when you mouse over the edit link',
34 'description-msg' => 'EditSectionHiliteLink-desc',
35 );
36
37 // Turn on the section container divs in the Parser
38 $wgSectionContainers = true;
39
40 // Shortcut to this extension directory
41 $dir = dirname( __FILE__ ) . '/';
42
43 # Bump the version number every time you change any of the .css/.js files
44 $wgEditSectionHiliteLinkStyleVersion = 2;
45
46 $wgAutoloadClasses['EditSectionHiliteLinkHooks'] = $dir . 'EditSectionHiliteLink.hooks.php';
47
48 // Register edit link interception
49 $wgHooks['DoEditSectionLink'][] = 'EditSectionHiliteLinkHooks::interceptLink';
50
51 // Register ajax add script hook
52 $wgHooks['AjaxAddScript'][] = 'EditSectionHiliteLinkHooks::addJS';
53
54 // Register css add script hook
55 $wgHooks['BeforePageDisplay'][] = 'EditSectionHiliteLinkHooks::addCSS';
56
57 ?>