r84382 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84381‎ | r84382 | r84383 >
Date:14:03, 20 March 2011
Author:raylton.sousa
Status:deferred
Tags:
Comment:
fix r84378 (add wgParser, and solve bug with class name)
Modified paths:
  • /trunk/extensions/BookManager/BookManager.body.php (modified) (history)
  • /trunk/extensions/BookManager/BookManager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/BookManager/BookManager.body.php
@@ -270,7 +270,7 @@
271271 */
272272 class BookManagerNavBar extends BookManagerCore {
273273 static function addText( &$out, &$text ) {
274 - global $wgRequest, $wgBookManagerNamespaces, $wgBookManagerNavBar;
 274+ global $wgParser, $wgRequest, $wgBookManagerNamespaces, $wgBookManagerNavBar;
275275 $ns = $out->getTitle()->getNamespace();
276276 # Return True if action is suported
277277 $action = $wgRequest->getVal( 'action', 'view' );
@@ -284,9 +284,9 @@
285285 # Get $out title
286286 $currenttitletext = $out->getTitle()->getText();
287287 # Get: prev, next and base chapter from the list
288 - $prev = self::pageText( $parser, $currenttitletext, - 1 );
 288+ $prev = self::pageText( $wgParser, $currenttitletext, - 1 );
289289
290 - $next = self::pageText( $parser, $currenttitletext, + 1 );
 290+ $next = self::pageText( $wgParser, $currenttitletext, + 1 );
291291 if ( $prev === '' && $next === '' ) {
292292 return true;
293293 }
Index: trunk/extensions/BookManager/BookManager.php
@@ -36,13 +36,22 @@
3737 die( 'This file is a MediaWiki extension, it is not a valid entry point' );
3838 }
3939 $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';
4148
 49+
 50+
4251 /**** extension basics ****/
4352 $wgExtensionCredits['parserhook'][] = array(
4453 'path' => __FILE__,
4554 'name' => 'BookManager',
46 - 'version' => BookManagerFunctions::VERSION,
 55+ 'version' => BookManagerCore::VERSION,
4756 'author' => array( 'Raylton P. Sousa', 'Helder.wiki' ),
4857 'url' => 'http://www.mediawiki.org/wiki/Extension:BookManager',
4958 'description' => 'Tools for books',
@@ -63,16 +72,16 @@
6473 $wgCommunityCollectionNamespace = NS_PROJECT;
6574
6675 /**** Register magic words ****/
67 -$wgHooks['ParserFirstCallInit'][] = 'BookManagerFunctions::register';
 76+$wgHooks['ParserFirstCallInit'][] = 'BookManagerVariables::register';
6877
69 -$wgHooks['LanguageGetMagic'][] = 'BookManagerFunctions::LanguageGetMagic';
 78+$wgHooks['LanguageGetMagic'][] = 'BookManagerVariables::LanguageGetMagic';
7079
71 -$wgHooks['MagicWordwgVariableIDs'][] = 'BookManagerFunctions::DeclareVarIds';
 80+$wgHooks['MagicWordwgVariableIDs'][] = 'BookManagerVariables::DeclareVarIds';
7281
73 -$wgHooks['ParserGetVariableValueSwitch'][] = 'BookManagerFunctions::AssignAValue';
 82+$wgHooks['ParserGetVariableValueSwitch'][] = 'BookManagerVariables::AssignAValue';
7483
75 -$wgHooks['OutputPageBeforeHTML'][] = 'BookManagerFunctions::addText';
 84+$wgHooks['OutputPageBeforeHTML'][] = 'BookManagerNavBar::addText';
7685
77 -$wgHooks['BeforePageDisplay'][] = 'BookManagerFunctions::injectStyleAndJS';
 86+$wgHooks['BeforePageDisplay'][] = 'BookManagerNavBar::injectStyleAndJS';
7887
7988

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84378*Creating printable version, for books (based on patch sent from e-mail by He...raylton.sousa13:01, 20 March 2011

Status & tagging log