Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -822,25 +822,22 @@ |
823 | 823 | } |
824 | 824 | |
825 | 825 | function setPermaLink( &$sktmp, &$nav_urls, &$oldid, &$revid ) { |
826 | | - global $wgArticle, $wgTitle, $action; |
827 | | - // Only trigger on article view, not for protect/delete/hist |
| 826 | + global $wgTitle; |
828 | 827 | // Non-content pages cannot be validated |
829 | | - if( !$wgArticle || !$wgTitle->isContentPage() || !$this->pageOverride() ) |
830 | | - return; |
| 828 | + if( !$wgTitle->isContentPage() || !$this->pageOverride() ) return; |
831 | 829 | // Check for an overridabe revision |
832 | 830 | $tfrev = $this->getOverridingRev(); |
833 | 831 | if( !$tfrev ) return; |
834 | | - $revid = $tfrev->fr_rev_id; |
835 | 832 | // Replace "permalink" with an actual permanent link |
836 | 833 | $nav_urls['permalink'] = array( |
837 | 834 | 'text' => wfMsg( 'permalink' ), |
838 | | - 'href' => $sktmp->makeSpecialUrl( 'Stableversions', "oldid=$revid" ) |
| 835 | + 'href' => $sktmp->makeSpecialUrl( 'Stableversions', "oldid={$tfrev->fr_rev_id}" ) |
839 | 836 | ); |
840 | 837 | // Are we using the popular cite extension? |
841 | 838 | if( isset($nav_urls['cite']) ) { |
842 | 839 | $nav_urls['cite'] = array( |
843 | 840 | 'text' => wfMsg( 'cite_article_link' ), |
844 | | - 'href' => $sktmp->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$sktmp->thispage}" ) . "&id=$revid" ) |
| 841 | + 'href' => $sktmp->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$sktmp->thispage}" ) . "&id={$tfrev->fr_rev_id}" ) |
845 | 842 | ); |
846 | 843 | } |
847 | 844 | } |
— | — | @@ -865,7 +862,7 @@ |
866 | 863 | unset( $content_actions['viewsource']); |
867 | 864 | # Straighten out order |
868 | 865 | $new_actions = array(); $counter = 0; |
869 | | - foreach( $content_actions as $action => $data ) { |
| 866 | + foreach( $content_actions as $tab_action => $data ) { |
870 | 867 | if( $counter==1 ) { |
871 | 868 | # Set current rev tab AFTER the main tab is set |
872 | 869 | $new_actions['current'] = array( |
— | — | @@ -874,7 +871,7 @@ |
875 | 872 | 'href' => $title->getLocalUrl( 'stable=0' ) |
876 | 873 | ); |
877 | 874 | } |
878 | | - $new_actions[$action] = $data; |
| 875 | + $new_actions[$tab_action] = $data; |
879 | 876 | $counter++; |
880 | 877 | } |
881 | 878 | # Reset static array |
— | — | @@ -882,7 +879,7 @@ |
883 | 880 | } else if( $action != 'view' || $wgRequest->getVal('oldid') || $sktmp->mTitle->isTalkPage() ) { |
884 | 881 | # Straighten out order |
885 | 882 | $new_actions = array(); $counter = 0; |
886 | | - foreach( $content_actions as $action => $data ) { |
| 883 | + foreach( $content_actions as $tab_action => $data ) { |
887 | 884 | if( $counter==1 ) { |
888 | 885 | # Set current rev tab AFTER the main tab is set |
889 | 886 | $new_actions['current'] = array( |
— | — | @@ -891,7 +888,7 @@ |
892 | 889 | 'href' => $title->getLocalUrl( 'stable=0' ) |
893 | 890 | ); |
894 | 891 | } |
895 | | - $new_actions[$action] = $data; |
| 892 | + $new_actions[$tab_action] = $data; |
896 | 893 | $counter++; |
897 | 894 | } |
898 | 895 | # Reset static array |
— | — | @@ -899,7 +896,7 @@ |
900 | 897 | } else { |
901 | 898 | # Straighten out order |
902 | 899 | $new_actions = array(); $counter = 0; |
903 | | - foreach( $content_actions as $action => $data ) { |
| 900 | + foreach( $content_actions as $tab_action => $data ) { |
904 | 901 | if( $counter==1 ) { |
905 | 902 | # Set current rev tab AFTER the main tab is set |
906 | 903 | $new_actions['current'] = array( |
— | — | @@ -908,7 +905,7 @@ |
909 | 906 | 'href' => $title->getLocalUrl( 'stable=0' ) |
910 | 907 | ); |
911 | 908 | } |
912 | | - $new_actions[$action] = $data; |
| 909 | + $new_actions[$tab_action] = $data; |
913 | 910 | $counter++; |
914 | 911 | } |
915 | 912 | # Reset static array |