| Index: trunk/extensions/Oversight/HideRevision.hooks.php |
| — | — | @@ -4,9 +4,11 @@ |
| 5 | 5 | /** |
| 6 | 6 | * Hook for article view, giving us a chance to insert a removal |
| 7 | 7 | * tab on old version views. |
| | 8 | + * @param $article Article |
| | 9 | + * @return bool |
| 8 | 10 | */ |
| 9 | 11 | public static function onArticleViewHeader( $article ) { |
| 10 | | - $oldid = intval( $article->mOldId ); |
| | 12 | + $oldid = intval( $article->getOldID() ); |
| 11 | 13 | if( $oldid ) { |
| 12 | 14 | self::installTab( $oldid ); |
| 13 | 15 | } |
| — | — | @@ -16,6 +18,10 @@ |
| 17 | 19 | /** |
| 18 | 20 | * Hook for diff view, giving us a chance to insert a removal |
| 19 | 21 | * tab on old version views. |
| | 22 | + * @param $diff |
| | 23 | + * @param $oldRev Revision |
| | 24 | + * @param $newRev Revision |
| | 25 | + * @return bool |
| 20 | 26 | */ |
| 21 | 27 | public static function onDiffViewHeader( $diff, $oldRev, $newRev ) { |
| 22 | 28 | if( !empty( $newRev ) && $newRev->getId() ) { |
| — | — | @@ -27,6 +33,9 @@ |
| 28 | 34 | /** |
| 29 | 35 | * Hook for deletion archive revision view, giving us a chance to |
| 30 | 36 | * insert a removal tab for a deleted revision. |
| | 37 | + * @param $title Title |
| | 38 | + * @param $rev Revision |
| | 39 | + * @return bool |
| 31 | 40 | */ |
| 32 | 41 | public static function onUndeleteShowRevision( $title, $rev ) { |
| 33 | 42 | self::installArchiveTab( $title, $rev->getTimestamp() ); |
| — | — | @@ -34,7 +43,10 @@ |
| 35 | 44 | } |
| 36 | 45 | |
| 37 | 46 | /** |
| 38 | | - * |
| | 47 | + * @param $id |
| | 48 | + * @param $nt Title |
| | 49 | + * @param $tools |
| | 50 | + * @return bool |
| 39 | 51 | */ |
| 40 | 52 | public static function onContributionsToolLinks( $id, $nt, &$tools ) { |
| 41 | 53 | global $wgUser; |
| — | — | @@ -48,6 +60,7 @@ |
| 49 | 61 | /** |
| 50 | 62 | * If the user is allowed, installs a tab hook on the skin |
| 51 | 63 | * which links to a handy permanent removal thingy. |
| | 64 | + * @param $id |
| 52 | 65 | */ |
| 53 | 66 | private static function installTab( $id ) { |
| 54 | 67 | global $wgUser; |
| — | — | @@ -62,6 +75,8 @@ |
| 63 | 76 | * If the user is allowed, installs a tab hook on the skin |
| 64 | 77 | * which links to a handy permanent removal thingy for |
| 65 | 78 | * archived (deleted) pages. |
| | 79 | + * @param $target Title |
| | 80 | + * @param $timestamp |
| 66 | 81 | */ |
| 67 | 82 | private static function installArchiveTab( $target, $timestamp ) { |
| 68 | 83 | global $wgUser; |
| — | — | @@ -81,6 +96,11 @@ |
| 82 | 97 | $this->mLinkParam = $linkParam; |
| 83 | 98 | } |
| 84 | 99 | |
| | 100 | + /** |
| | 101 | + * @param $skin |
| | 102 | + * @param $content_actions |
| | 103 | + * @return bool |
| | 104 | + */ |
| 85 | 105 | function insertTab( $skin, &$content_actions ) { |
| 86 | 106 | $special = SpecialPage::getTitleFor( 'HideRevision' ); |
| 87 | 107 | $content_actions['hiderevision'] = array( |
| Index: trunk/extensions/Oversight/HideRevision_body.php |
| — | — | @@ -538,10 +538,11 @@ |
| 539 | 539 | $info = $this->listRow( $row ); |
| 540 | 540 | $list = $this->revisionInfo( $row ); |
| 541 | 541 | $rev = new Revision( $row ); |
| 542 | | - $rev->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| 543 | | - $prevId = $rev->mTitle->getPreviousRevisionID( $row->rev_id ); |
| | 542 | + $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| | 543 | + $rev->setTitle( $title ); |
| | 544 | + $prevId = $title->getPreviousRevisionID( $row->rev_id ); |
| 544 | 545 | if ( $prevId ) { |
| 545 | | - $prev = Revision::newFromTitle( $rev->mTitle, $prevId ); |
| | 546 | + $prev = Revision::newFromTitle( $title, $prevId ); |
| 546 | 547 | if( $prev ) { |
| 547 | 548 | $otext = strval( $prev->getText( Revision::FOR_THIS_USER ) ); |
| 548 | 549 | } else { |
| — | — | @@ -558,7 +559,7 @@ |
| 559 | 560 | } |
| 560 | 561 | $ntext = strval( $rev->getText( Revision::FOR_THIS_USER ) ); |
| 561 | 562 | |
| 562 | | - $diffEngine = new DifferenceEngine( $rev->mTitle ); |
| | 563 | + $diffEngine = new DifferenceEngine( $title ); |
| 563 | 564 | $diffEngine->showDiffStyle(); |
| 564 | 565 | $wgOut->addHTML( |
| 565 | 566 | "<ul>" . |