Index: trunk/extensions/BookManager/BookManager.body.php |
— | — | @@ -270,7 +270,7 @@ |
271 | 271 | */ |
272 | 272 | class BookManagerNavBar extends BookManagerCore { |
273 | 273 | static function addText( &$out, &$text ) { |
274 | | - global $wgRequest, $wgBookManagerNamespaces, $wgBookManagerNavBar; |
| 274 | + global $wgParser, $wgRequest, $wgBookManagerNamespaces, $wgBookManagerNavBar; |
275 | 275 | $ns = $out->getTitle()->getNamespace(); |
276 | 276 | # Return True if action is suported |
277 | 277 | $action = $wgRequest->getVal( 'action', 'view' ); |
— | — | @@ -284,9 +284,9 @@ |
285 | 285 | # Get $out title |
286 | 286 | $currenttitletext = $out->getTitle()->getText(); |
287 | 287 | # Get: prev, next and base chapter from the list |
288 | | - $prev = self::pageText( $parser, $currenttitletext, - 1 ); |
| 288 | + $prev = self::pageText( $wgParser, $currenttitletext, - 1 ); |
289 | 289 | |
290 | | - $next = self::pageText( $parser, $currenttitletext, + 1 ); |
| 290 | + $next = self::pageText( $wgParser, $currenttitletext, + 1 ); |
291 | 291 | if ( $prev === '' && $next === '' ) { |
292 | 292 | return true; |
293 | 293 | } |
Index: trunk/extensions/BookManager/BookManager.php |
— | — | @@ -36,13 +36,22 @@ |
37 | 37 | die( 'This file is a MediaWiki extension, it is not a valid entry point' ); |
38 | 38 | } |
39 | 39 | $dir = dirname( __FILE__ ); |
40 | | -$wgAutoloadClasses['BookManagerFunctions'] = $dir . '/BookManager.body.php'; |
| 40 | +$wgAutoloadClasses['BookManagerCore'] = $dir . '/BookManager.body.php'; |
| 41 | +$wgAutoloadClasses['BookManagerVariables'] = $dir . '/BookManager.body.php'; |
| 42 | +$wgAutoloadClasses['BookManagerNavBar'] = $dir . '/BookManager.body.php'; |
| 43 | +$wgAutoloadClasses['PrintVersion'] = $dir . '/BookManager.body.php'; |
| 44 | +$wgExtensionMessagesFiles['PrintVersion'] = $dir . '/PrintVersion.i18n.php'; |
| 45 | +$wgExtensionAliasesFiles['PrintVersion'] = $dir . '/PrintVersion.alias.php'; |
| 46 | +$wgSpecialPages['PrintVersion'] = 'PrintVersion'; |
| 47 | +$wgSpecialPageGroups['PrintVersion'] = 'other'; |
41 | 48 | |
| 49 | + |
| 50 | + |
42 | 51 | /**** extension basics ****/ |
43 | 52 | $wgExtensionCredits['parserhook'][] = array( |
44 | 53 | 'path' => __FILE__, |
45 | 54 | 'name' => 'BookManager', |
46 | | - 'version' => BookManagerFunctions::VERSION, |
| 55 | + 'version' => BookManagerCore::VERSION, |
47 | 56 | 'author' => array( 'Raylton P. Sousa', 'Helder.wiki' ), |
48 | 57 | 'url' => 'http://www.mediawiki.org/wiki/Extension:BookManager', |
49 | 58 | 'description' => 'Tools for books', |
— | — | @@ -63,16 +72,16 @@ |
64 | 73 | $wgCommunityCollectionNamespace = NS_PROJECT; |
65 | 74 | |
66 | 75 | /**** Register magic words ****/ |
67 | | -$wgHooks['ParserFirstCallInit'][] = 'BookManagerFunctions::register'; |
| 76 | +$wgHooks['ParserFirstCallInit'][] = 'BookManagerVariables::register'; |
68 | 77 | |
69 | | -$wgHooks['LanguageGetMagic'][] = 'BookManagerFunctions::LanguageGetMagic'; |
| 78 | +$wgHooks['LanguageGetMagic'][] = 'BookManagerVariables::LanguageGetMagic'; |
70 | 79 | |
71 | | -$wgHooks['MagicWordwgVariableIDs'][] = 'BookManagerFunctions::DeclareVarIds'; |
| 80 | +$wgHooks['MagicWordwgVariableIDs'][] = 'BookManagerVariables::DeclareVarIds'; |
72 | 81 | |
73 | | -$wgHooks['ParserGetVariableValueSwitch'][] = 'BookManagerFunctions::AssignAValue'; |
| 82 | +$wgHooks['ParserGetVariableValueSwitch'][] = 'BookManagerVariables::AssignAValue'; |
74 | 83 | |
75 | | -$wgHooks['OutputPageBeforeHTML'][] = 'BookManagerFunctions::addText'; |
| 84 | +$wgHooks['OutputPageBeforeHTML'][] = 'BookManagerNavBar::addText'; |
76 | 85 | |
77 | | -$wgHooks['BeforePageDisplay'][] = 'BookManagerFunctions::injectStyleAndJS'; |
| 86 | +$wgHooks['BeforePageDisplay'][] = 'BookManagerNavBar::injectStyleAndJS'; |
78 | 87 | |
79 | 88 | |