* Introduce "BookInformation" hook; see docs/hooks.txt for more details
authorRob Church <robchurch@users.mediawiki.org>
Tue, 16 Jan 2007 19:06:56 +0000 (19:06 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Tue, 16 Jan 2007 19:06:56 +0000 (19:06 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/SpecialBooksources.php

index 5b64df5..139e700 100644 (file)
@@ -79,6 +79,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is
   not available, as on IIS with PHP-CGI
 * (bug 8621) Log revisions marked as patrolled
+* Introduce "BookInformation" hook; see docs/hooks.txt for more details
 
 == Languages updated ==
 
index c2356a6..a0b963c 100644 (file)
@@ -308,6 +308,10 @@ $user: the user _doing_ the block (not the one being blocked)
 $block: the Block object that was saved
 $user: the user who did the block (not the one being blocked)
 
+'BookInformation': Before information output on Special:Booksources
+$isbn: ISBN to show information for
+$output: OutputPage object in use
+
 'DiffViewHeader': called before diff display
 $diff: DifferenceEngine object that's calling
 $oldRev: Revision object of the "old" revision (may be null/invalid)
index 5c047fb..fa8a920 100644 (file)
@@ -34,7 +34,7 @@ class SpecialBookSources extends SpecialPage {
                $this->isbn = $this->cleanIsbn( $isbn ? $isbn : $wgRequest->getText( 'isbn' ) );
                $wgOut->addWikiText( wfMsgNoTrans( 'booksources-summary' ) );
                $wgOut->addHtml( $this->makeForm() );
-               if( strlen( $this->isbn) > 0 )
+               if( strlen( $this->isbn ) > 0 )
                        $this->showList();
        }
        
@@ -75,6 +75,10 @@ class SpecialBookSources extends SpecialPage {
        private function showList() {
                global $wgOut, $wgContLang;
                
+               # Hook to allow extensions to insert additional HTML,
+               # e.g. for API-interacting plugins and so on
+               wfRunHooks( 'BookInformation', array( $this->isbn, &$wgOut ) );
+               
                # Check for a local page such as Project:Book_sources and use that if available
                $title = Title::makeTitleSafe( NS_PROJECT, wfMsg( 'booksources' ) ); # Should this be wfMsgForContent()? -- RC
                if( is_object( $title ) && $title->exists() ) {