r19344 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19343‎ | r19344 | r19345 >
Date:19:06, 16 January 2007
Author:robchurch
Status:old
Tags:
Comment:
* Introduce "BookInformation" hook; see docs/hooks.txt for more details
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/SpecialBooksources.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -308,6 +308,10 @@
309309 $block: the Block object that was saved
310310 $user: the user who did the block (not the one being blocked)
311311
 312+'BookInformation': Before information output on Special:Booksources
 313+$isbn: ISBN to show information for
 314+$output: OutputPage object in use
 315+
312316 'DiffViewHeader': called before diff display
313317 $diff: DifferenceEngine object that's calling
314318 $oldRev: Revision object of the "old" revision (may be null/invalid)
Index: trunk/phase3/includes/SpecialBooksources.php
@@ -34,7 +34,7 @@
3535 $this->isbn = $this->cleanIsbn( $isbn ? $isbn : $wgRequest->getText( 'isbn' ) );
3636 $wgOut->addWikiText( wfMsgNoTrans( 'booksources-summary' ) );
3737 $wgOut->addHtml( $this->makeForm() );
38 - if( strlen( $this->isbn) > 0 )
 38+ if( strlen( $this->isbn ) > 0 )
3939 $this->showList();
4040 }
4141
@@ -75,6 +75,10 @@
7676 private function showList() {
7777 global $wgOut, $wgContLang;
7878
 79+ # Hook to allow extensions to insert additional HTML,
 80+ # e.g. for API-interacting plugins and so on
 81+ wfRunHooks( 'BookInformation', array( $this->isbn, &$wgOut ) );
 82+
7983 # Check for a local page such as Project:Book_sources and use that if available
8084 $title = Title::makeTitleSafe( NS_PROJECT, wfMsg( 'booksources' ) ); # Should this be wfMsgForContent()? -- RC
8185 if( is_object( $title ) && $title->exists() ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -79,6 +79,7 @@
8080 * (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is
8181 not available, as on IIS with PHP-CGI
8282 * (bug 8621) Log revisions marked as patrolled
 83+* Introduce "BookInformation" hook; see docs/hooks.txt for more details
8384
8485 == Languages updated ==
8586