Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -16,13 +16,12 @@ |
17 | 17 | */ |
18 | 18 | public static function getGlobalInstance() { |
19 | 19 | global $wgArticle, $wgTitle; |
20 | | - if ( !empty( $wgArticle ) ) { |
| 20 | + if( !empty( $wgArticle ) ) { |
21 | 21 | return self::getInstance( $wgArticle ); |
22 | | - } elseif ( !empty( $wgTitle ) ) { |
| 22 | + } else if( !empty( $wgTitle ) ) { |
23 | 23 | return self::getTitleInstance( $wgTitle ); |
24 | | - } else { |
25 | | - return false; |
26 | 24 | } |
| 25 | + return null; |
27 | 26 | } |
28 | 27 | |
29 | 28 | /** |
— | — | @@ -30,7 +29,7 @@ |
31 | 30 | * getInstance() is preferred if you have an Article available. |
32 | 31 | */ |
33 | 32 | public static function getTitleInstance( $title ) { |
34 | | - if ( !isset( $title->flaggedRevsArticle ) ) { |
| 33 | + if( !isset( $title->flaggedRevsArticle ) ) { |
35 | 34 | $article = MediaWiki::articleFromTitle( $title ); |
36 | 35 | $article->flaggedRevsArticle = new FlaggedArticle( $article ); |
37 | 36 | $title->flaggedRevsArticle =& $article->flaggedRevsArticle; |
— | — | @@ -50,6 +49,7 @@ |
51 | 50 | if( isset( $article->getTitle()->flaggedRevsArticle ) ) { |
52 | 51 | // Already have a FlaggedArticle cached in the Title object |
53 | 52 | $article->flaggedRevsArticle =& $article->getTitle()->flaggedRevsArticle; |
| 53 | + $article->flaggedRevsArticle->parent =& $article; |
54 | 54 | } else { |
55 | 55 | // Create new FlaggedArticle |
56 | 56 | $article->flaggedRevsArticle = new FlaggedArticle( $article ); |
— | — | @@ -776,10 +776,7 @@ |
777 | 777 | */ |
778 | 778 | public function setActionTabs( $skin, &$contentActions ) { |
779 | 779 | global $wgRequest, $wgUser, $wgFlaggedRevTabs; |
780 | | - # Get the subject page, not all skins have it :( |
781 | | - if( !isset($skin->mTitle) ) |
782 | | - return true; |
783 | | - $title = $skin->mTitle->getSubjectPage(); |
| 780 | + $title = $this->parent->getTitle()->getSubjectPage(); |
784 | 781 | # Non-content pages cannot be validated |
785 | 782 | if( !FlaggedRevs::isPageReviewable( $title ) || !$title->exists() ) |
786 | 783 | return true; |