Merge "Add oldRev parameter to DiffRevisionTools hook"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 29 Jan 2014 01:44:01 +0000 (01:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 29 Jan 2014 01:44:01 +0000 (01:44 +0000)
1  2 
docs/hooks.txt
includes/diff/DifferenceEngine.php

diff --combined docs/hooks.txt
@@@ -269,9 -269,6 +269,9 @@@ $reason: the reason for the move (adde
  'AbortNewAccount': Return false to cancel explicit account creation.
  $user: the User object about to be created (read-only, incomplete)
  &$msg: out parameter: HTML to display on abort
 +&$status: out parameter: Status object to return, replaces the older $msg param (added in 1.23)
 +          Create the object with Status::newFatal() to ensure proper API error messages
 +          are returned when creating account through API clients.
  
  'AbortTalkPageEmailNotification': Return false to cancel talk page email notification
  $targetUser: the user whom to send talk page email notification
@@@ -298,15 -295,6 +298,15 @@@ $article: Article objec
  $user: the User object that was created. (Parameter added in 1.7)
  $byEmail: true when account was created "by email" (added in 1.12)
  
 +'AddNewAccountApiForm': Allow modifying internal login form when creating an account via API.
 +$apiModule: the ApiCreateAccount module calling
 +$loginForm: the LoginForm used
 +
 +'AddNewAccountApiResult': Modify API output when creating a new account via API.
 +$apiModule: the ApiCreateAccount module calling
 +$loginForm: the LoginForm used
 +&$result: associative array for API result data
 +
  'AfterFinalPageOutput': At the end of OutputPage::output() but before final
  ob_end_flush() which will send the buffered output to the client. This allows
  for last-minute modification of the output within the buffer by using
@@@ -541,7 -529,6 +541,7 @@@ $wikiPage: WikiPage (object) being modi
  Wiki::articleFromTitle().
  $title: Title (object) used to create the article object
  $article: Article (object) that will be returned
 +$context: IContextSource (object)
  
  'ArticleInsertComplete': After a new article is created. DEPRECATED, use
  PageContentInsertComplete.
@@@ -776,7 -763,6 +776,7 @@@ $block: Block object (which is set to b
  'BlockIp': Before an IP address or user is blocked.
  $block: the Block object about to be saved
  $user: the user _doing_ the block (not the one being blocked)
 +&$reason: if the hook is aborted, the error message to be returned in an array
  
  'BlockIpComplete': After an IP address or user is blocked.
  $block: the Block object that was saved
@@@ -847,15 -833,6 +847,15 @@@ content model name, but no entry for th
  $modeName: the requested content model name
  &$handler: set this to a ContentHandler object, if desired.
  
 +'ContentModelCanBeUsedOn': Called to determine whether that content model can
 +be used on a given page. This is especially useful to prevent some content models
 +to be used in some special location.
 +$contentModel: ID of the content model in question
 +$title: the Title in question.
 +&$ok: Output parameter, whether it is OK to use $contentModel on $title.
 +Handler functions that modify $ok should generally return false to prevent further
 +hooks from further modifying $ok.
 +
  'ConvertContent': Called by AbstractContent::convert when a conversion to another
  content model is requested.
  $content: The Content object to be converted.
@@@ -908,8 -885,9 +908,9 @@@ $new: the ?new= param value from the ur
  
  'DiffRevisionTools': Override or extend the revision tools available from the
  diff view, i.e. undo, etc.
- $rev: Revision object
+ $newRev: Revision object of the "new" revision
  &$links: Array of HTML links
+ $oldRev: Revision object of the "old" revision (may be null)
  
  'DiffViewHeader': Called before diff display
  $diff: DifferenceEngine object that's calling
@@@ -1619,12 -1597,6 +1620,12 @@@ $paramArray: Array of parameters that c
  &$revert: string that is displayed in the UI, similar to $comment.
  $time: timestamp of the log entry (added in 1.12)
  
 +'LonelyPagesQuery': Allow extensions to modify the query used by
 +Special:LonelyPages.
 +&$tables: tables to join in the query
 +&$conds: conditions for the query
 +&$joinConds: join conditions for the query
 +
  'MaintenanceRefreshLinksInit': before executing the refreshLinks.php maintenance
  script.
  $refreshLinks: RefreshLinks object
@@@ -1822,8 -1794,7 +1823,8 @@@ $queryInfo: the query parameter
  'PageRenderingHash': Alter the parser cache option hash key. A parser extension
  which depends on user options should install this hook and append its values to
  the key.
 -$hash: reference to a hash key string which can be modified
 +&$confstr: reference to a hash key string which can be modified
 +$user: User (object) requesting the page
  
  'ParserAfterParse': Called from Parser::parse() just after the call to
  Parser::internalParse() returns.
@@@ -2430,7 -2401,7 +2431,7 @@@ $special: the special page objec
  &$tables: array of tables to be queried
  &$join_conds: join conditions for the tables
  &$fields: array of query fields
 -$values: array of variables with watchlist options
 +$opts: A FormOptions object with watchlist options for the current request
  
  'SpecialWatchlistGetNonRevisionTypes': Called when building sql query for
  SpecialWatchlist. Allows extensions to register custom values they have
@@@ -381,7 -381,7 +381,7 @@@ class DifferenceEngine extends ContextS
                $rdel = $this->revisionDeleteLink( $this->mNewRev );
  
                # Allow extensions to define their own revision tools
-               wfRunHooks( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools ) );
+               wfRunHooks( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) );
                $formattedRevisionTools = array();
                // Put each one in parentheses (poor man's button)
                foreach ( $revisionTools as $tool ) {
  
                                $parserOutput = $this->getParserOutput( $wikiPage, $this->mNewRev );
  
 -                              # Also try to load it as a redirect
 -                              $rt = $this->mNewContent ? $this->mNewContent->getRedirectTarget() : null;
 -
 -                              if ( $rt ) {
 -                                      $article = Article::newFromTitle( $this->mNewPage, $this->getContext() );
 -                                      $out->addHTML( $article->viewRedirect( $rt ) );
 -
 -                                      # WikiPage::getParserOutput() should not return false, but just in case
 -                                      if ( $parserOutput ) {
 -                                              # Show categories etc.
 -                                              $out->addParserOutputNoText( $parserOutput );
 -                                      }
 -                              } elseif ( $parserOutput ) {
 +                              # WikiPage::getParserOutput() should not return false, but just in case
 +                              if ( $parserOutput ) {
                                        $out->addParserOutput( $parserOutput );
                                }
                        }