Index: trunk/extensions/BookManager/BookManager.body.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | */ |
26 | 26 | protected static function getBookPagePrefixes() { |
27 | 27 | // global $wgUser; |
28 | | - global $wgCommunityCollectionNamespace; |
| 28 | + global $wgBookManagerPrefixNamespace; |
29 | 29 | |
30 | 30 | $result = array(); |
31 | 31 | /* |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | $t = wfMsgForContent( 'coll-community_book_prefix' ); |
42 | 42 | if ( wfEmptyMsg( 'coll-community_book_prefix', $t ) || $t == '-' ) { |
43 | 43 | $title = Title::makeTitle( |
44 | | - $wgCommunityCollectionNamespace, |
| 44 | + $wgBookManagerPrefixNamespace, |
45 | 45 | wfMsgForContent( 'coll-collections' ) |
46 | 46 | ); |
47 | 47 | $result['community-prefix'] = $title->getPrefixedText() . '/'; |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | # Return True if Message is non empty |
297 | 297 | $MsgIsEmpty = ( wfEmptyMsg( "BookManager" ) |
298 | 298 | && wfEmptyMsg( "BookManager-top" ) |
299 | | - && wfEmptyMsg( "BookManager-bottom" )); |
| 299 | + && wfEmptyMsg( "BookManager-bottom" ) ); |
300 | 300 | # Generate HTML or system messages values( $1 for $prev, $2 for $prevtext, $3 for $base, $4 for $basetext, $5 for $next and $6 for $nexttext ). |
301 | 301 | $prevtext = ( $prev !== '' ) ? Title::newFromText( $prev )->getSubpageText(): '' ; |
302 | 302 | $nexttext = ( $next !== '' ) ? Title::newFromText( $next )->getSubpageText(): '' ; |
— | — | @@ -364,7 +364,7 @@ |
365 | 365 | $this->outputHeader(); |
366 | 366 | |
367 | 367 | $book = !is_null( $book ) ? $book : $wgRequest->getVal( 'book' ); |
368 | | - if( !isset( $book ) ){ |
| 368 | + if ( !isset( $book ) ) { |
369 | 369 | $wgOut->addWikiMsg( 'printversion-no-book' ); |
370 | 370 | return; |
371 | 371 | } |
— | — | @@ -384,4 +384,8 @@ |
385 | 385 | } |
386 | 386 | $wgOut->addWikiText( $text ); |
387 | 387 | } |
| 388 | + |
388 | 389 | } |
| 390 | + |
| 391 | + |
| 392 | + |
Index: trunk/extensions/BookManager/BookManager.php |
— | — | @@ -37,14 +37,13 @@ |
38 | 38 | } |
39 | 39 | $dir = dirname( __FILE__ ); |
40 | 40 | $wgAutoloadClasses['BookManagerCore'] = $dir . '/BookManager.body.php'; |
41 | | -$wgAutoloadClasses['BookManagerVariables'] = $dir . '/BookManager.body.php'; |
| 41 | + |
42 | 42 | $wgAutoloadClasses['BookManagerNavBar'] = $dir . '/BookManager.body.php'; |
43 | 43 | $wgAutoloadClasses['PrintVersion'] = $dir . '/BookManager.body.php'; |
44 | 44 | $wgExtensionMessagesFiles['PrintVersion'] = $dir . '/PrintVersion.i18n.php'; |
45 | 45 | $wgExtensionAliasesFiles['PrintVersion'] = $dir . '/PrintVersion.alias.php'; |
46 | 46 | $wgSpecialPages['PrintVersion'] = 'PrintVersion'; |
47 | 47 | $wgSpecialPageGroups['PrintVersion'] = 'other'; |
48 | | -$wgExtensionMessagesFiles['BookManager'] = $dir . '/BookManager.i18n.php'; |
49 | 48 | |
50 | 49 | |
51 | 50 | |
— | — | @@ -55,7 +54,7 @@ |
56 | 55 | 'version' => BookManagerCore::VERSION, |
57 | 56 | 'author' => array( 'Raylton P. Sousa', 'Helder.wiki' ), |
58 | 57 | 'url' => 'http://www.mediawiki.org/wiki/Extension:BookManager', |
59 | | - 'descriptionmsg' => 'bookmanager-desc', |
| 58 | + 'description' => 'Tools for books', |
60 | 59 | ); |
61 | 60 | /* Add CSS and JS */ |
62 | 61 | $wgResourceModules['ext.BookManager'] = array( |
— | — | @@ -67,12 +66,15 @@ |
68 | 67 | 'remoteExtPath' => 'BookManager' |
69 | 68 | ); |
70 | 69 | $wgBookManagerNamespaces = array( NS_MAIN ); |
| 70 | +$wgBookManagerVariables = true ; |
71 | 71 | $wgBookManagerNavBar = true; |
72 | 72 | /* Copyied from extensions/Collection/Collection.php */ |
73 | 73 | /** Namespace for "community books" */ |
74 | | -$wgCommunityCollectionNamespace = NS_PROJECT; |
| 74 | +$wgBookManagerPrefixNamespace = NS_PROJECT; |
| 75 | +/**** Register magic words ****/ |
| 76 | +if ( $wgBookManagerVariables ) { |
| 77 | +$wgAutoloadClasses['BookManagerVariables'] = $dir . '/BookManager.body.php'; |
75 | 78 | |
76 | | -/**** Register magic words ****/ |
77 | 79 | $wgHooks['ParserFirstCallInit'][] = 'BookManagerVariables::register'; |
78 | 80 | |
79 | 81 | $wgHooks['LanguageGetMagic'][] = 'BookManagerVariables::LanguageGetMagic'; |
— | — | @@ -80,9 +82,9 @@ |
81 | 83 | $wgHooks['MagicWordwgVariableIDs'][] = 'BookManagerVariables::DeclareVarIds'; |
82 | 84 | |
83 | 85 | $wgHooks['ParserGetVariableValueSwitch'][] = 'BookManagerVariables::AssignAValue'; |
84 | | - |
| 86 | +} |
| 87 | +/**** Navbar ****/ |
85 | 88 | $wgHooks['OutputPageBeforeHTML'][] = 'BookManagerNavBar::addText'; |
86 | 89 | |
87 | 90 | $wgHooks['BeforePageDisplay'][] = 'BookManagerNavBar::injectStyleAndJS'; |
88 | 91 | |
89 | | - |