3 * Hooks for EditSectionHiliteLink extension
9 class EditSectionHiliteLinkHooks
{
11 /* Static Functions */
16 public static function interceptLink($this, $nt, $section, $tooltip, &$result) {
17 global $wgSectionContainers;
19 if ( $wgSectionContainers ) {
20 $section = $section -1;
21 $section_name = 'section_' . $section . '_container';
22 $result = preg_replace('/(\D+)( title=)(\D+)/', '${1} onmouseover="editSectionHiliteOn(\'' . $section_name . '\')" onmouseout="editSectionHiliteOff(\'' . $section_name . '\')" title=$3', $result);
29 * Add ajax support script
31 public static function addJS(
34 global $wgScriptPath, $wgJsMimeType, $wgEditSectionHiliteLinkStyleVersion;
35 // FIXME: assumes standard dir structure
36 // Add javascript to support section edit link highlighting saving
41 'type' => $wgJsMimeType,
42 'src' => $wgScriptPath . '/extensions/EditSectionHiliteLink/EditSectionHiliteLink.js?' .
43 $wgEditSectionHiliteLinkStyleVersion
54 * BeforePageDisplay hook
57 public static function addCSS(
60 global $wgScriptPath, $wgEditSectionHiliteLinkStyleVersion;
61 // FIXME: assumes standard dir structure
62 // Add css for various styles
65 'rel' => 'stylesheet',
67 'href' => $wgScriptPath . '/extensions/EditSectionHiliteLink/EditSectionHiliteLink.css?' .
68 $wgEditSectionHiliteLinkStyleVersion,