From 5cf4e5e9375796c3b720da631502b1c282ff0c96 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 16 Jan 2007 19:06:56 +0000 Subject: [PATCH] * Introduce "BookInformation" hook; see docs/hooks.txt for more details --- RELEASE-NOTES | 1 + docs/hooks.txt | 4 ++++ includes/SpecialBooksources.php | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5b64df528a..139e70077d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/docs/hooks.txt b/docs/hooks.txt index c2356a6a16..a0b963c7c2 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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) diff --git a/includes/SpecialBooksources.php b/includes/SpecialBooksources.php index 5c047fbe34..fa8a920db8 100644 --- a/includes/SpecialBooksources.php +++ b/includes/SpecialBooksources.php @@ -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() ) { -- 2.20.1