Improved BagOStuff docs.
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index 0295f77..97553e6 100644 (file)
@@ -38,6 +38,9 @@ class DifferenceEngine extends ContextSource {
         * @private
         */
        var $mOldid, $mNewid;
+       /**
+        * @var Content
+        */
        var $mOldContent, $mNewContent;
        protected $mDiffLang;
 
@@ -291,8 +294,11 @@ class DifferenceEngine extends ContextSource {
 
                        if ( $samePage && $this->mNewPage->quickUserCan( 'edit', $user ) ) {
                                if ( $this->mNewRev->isCurrent() && $this->mNewPage->userCan( 'rollback', $user ) ) {
-                                       $out->preventClickjacking();
-                                       $rollback = '   ' . Linker::generateRollback( $this->mNewRev, $this->getContext() );
+                                       $rollbackLink = Linker::generateRollback( $this->mNewRev, $this->getContext() );
+                                       if ( $rollbackLink ) {
+                                               $out->preventClickjacking();
+                                               $rollback = '   ' . $rollbackLink;
+                                       }
                                }
                                if ( !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) {
                                        $undoLink = ' ' . $this->msg( 'parentheses' )->rawParams(
@@ -421,8 +427,8 @@ class DifferenceEngine extends ContextSource {
        /**
         * Get a link to mark the change as patrolled, or '' if there's either no
         * revision to patrol or the user is not allowed to to it.
-        * Side effect: this method will call OutputPage::preventClickjacking()
-        * when a link is builded.
+        * Side effect: When the patrol link is build, this method will call
+        * OutputPage::preventClickjacking() and load mediawiki.page.patrol.ajax.
         *
         * @return String
         */
@@ -463,6 +469,8 @@ class DifferenceEngine extends ContextSource {
                                // Build the link
                                if ( $rcid ) {
                                        $this->getOutput()->preventClickjacking();
+                                       $this->getOutput()->addModules( 'mediawiki.page.patrol.ajax' );
+
                                        $token = $this->getUser()->getEditToken( $rcid );
                                        $this->mMarkPatrolledLink = ' <span class="patrollink">[' . Linker::linkKnown(
                                                $this->mNewPage,
@@ -608,8 +616,8 @@ class DifferenceEngine extends ContextSource {
        /**
         * Get complete diff table, including header
         *
-        * @param $otitle Title: old title
-        * @param $ntitle Title: new title
+        * @param string|bool $otitle Header for old text or false
+        * @param string|bool $ntitle Header for new text or false
         * @param $notice String: HTML between diff header and body
         * @return mixed
         */