Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -7,10 +7,17 @@ |
8 | 8 | */ |
9 | 9 | class ImagePage extends Article { |
10 | 10 | |
11 | | - /* private */ var $img; // Image object |
| 11 | + /** |
| 12 | + * @var File |
| 13 | + */ |
| 14 | + /* private */ var $img; |
| 15 | + /** |
| 16 | + * @var File |
| 17 | + */ |
12 | 18 | /* private */ var $displayImg; |
13 | 19 | /* private */ var $repo; |
14 | 20 | /* private */ var $fileLoaded; |
| 21 | + |
15 | 22 | var $mExtraDescription = false; |
16 | 23 | var $dupes; |
17 | 24 | |
— | — | @@ -168,6 +175,7 @@ |
169 | 176 | } |
170 | 177 | return $this->mRedirectTarget = Title::makeTitle( NS_FILE, $to ); |
171 | 178 | } |
| 179 | + |
172 | 180 | public function followRedirect() { |
173 | 181 | $this->loadFile(); |
174 | 182 | if ( $this->img->isLocal() ) { |
— | — | @@ -180,6 +188,7 @@ |
181 | 189 | } |
182 | 190 | return Title::makeTitle( NS_FILE, $to ); |
183 | 191 | } |
| 192 | + |
184 | 193 | public function isRedirect( $text = false ) { |
185 | 194 | $this->loadFile(); |
186 | 195 | if ( $this->img->isLocal() ) |
— | — | @@ -225,7 +234,6 @@ |
226 | 235 | return $this->dupes = $dupes; |
227 | 236 | |
228 | 237 | } |
229 | | - |
230 | 238 | |
231 | 239 | /** |
232 | 240 | * Create the TOC |
— | — | @@ -556,7 +564,9 @@ |
557 | 565 | protected function uploadLinksBox() { |
558 | 566 | global $wgUser, $wgOut, $wgEnableUploads, $wgUseExternalEditor; |
559 | 567 | |
560 | | - if ( !$wgEnableUploads ) { return; } |
| 568 | + if ( !$wgEnableUploads ) { |
| 569 | + return; |
| 570 | + } |
561 | 571 | |
562 | 572 | $this->loadFile(); |
563 | 573 | if ( !$this->img->isLocal() ) |
— | — | @@ -714,7 +724,9 @@ |
715 | 725 | $this->loadFile(); |
716 | 726 | |
717 | 727 | $dupes = $this->getDuplicates(); |
718 | | - if ( count( $dupes ) == 0 ) return; |
| 728 | + if ( count( $dupes ) == 0 ) { |
| 729 | + return; |
| 730 | + } |
719 | 731 | |
720 | 732 | $wgOut->addHTML( "<div id='mw-imagepage-section-duplicates'>\n" ); |
721 | 733 | $wgOut->addWikiMsg( 'duplicatesoffile', |
— | — | @@ -805,7 +817,6 @@ |
806 | 818 | $wgOut->addWikiText( $description ); |
807 | 819 | } |
808 | 820 | |
809 | | - |
810 | 821 | /** |
811 | 822 | * Callback for usort() to do link sorts by (namespace, title) |
812 | 823 | * Function copied from Title::compare() |
— | — | @@ -830,9 +841,32 @@ |
831 | 842 | */ |
832 | 843 | class ImageHistoryList { |
833 | 844 | |
834 | | - protected $imagePage, $img, $skin, $title, $repo, $showThumb; |
| 845 | + /** |
| 846 | + * @var Title |
| 847 | + */ |
| 848 | + protected $title; |
| 849 | + |
| 850 | + /** |
| 851 | + * @var File |
| 852 | + */ |
| 853 | + protected $img; |
| 854 | + |
| 855 | + /** |
| 856 | + * @var ImagePage |
| 857 | + */ |
| 858 | + protected $imagePage; |
| 859 | + |
| 860 | + /** |
| 861 | + * @var Skin |
| 862 | + */ |
| 863 | + protected $skin; |
| 864 | + |
| 865 | + protected $repo, $showThumb; |
835 | 866 | protected $preventClickjacking = false; |
836 | 867 | |
| 868 | + /** |
| 869 | + * @param ImagePage $imagePage |
| 870 | + */ |
837 | 871 | public function __construct( $imagePage ) { |
838 | 872 | global $wgUser, $wgShowArchiveThumbnails; |
839 | 873 | $this->skin = $wgUser->getSkin(); |
— | — | @@ -876,6 +910,11 @@ |
877 | 911 | return "</table>\n$navLinks\n</div>\n"; |
878 | 912 | } |
879 | 913 | |
| 914 | + /** |
| 915 | + * @param $iscur |
| 916 | + * @param File $file |
| 917 | + * @return string |
| 918 | + */ |
880 | 919 | public function imageHistoryLine( $iscur, $file ) { |
881 | 920 | global $wgUser, $wgLang; |
882 | 921 | |
— | — | @@ -1020,6 +1059,10 @@ |
1021 | 1060 | return "<tr{$classAttr}>{$row}</tr>\n"; |
1022 | 1061 | } |
1023 | 1062 | |
| 1063 | + /** |
| 1064 | + * @param File $file |
| 1065 | + * @return string |
| 1066 | + */ |
1024 | 1067 | protected function getThumbForLine( $file ) { |
1025 | 1068 | global $wgLang; |
1026 | 1069 | |
— | — | @@ -1059,6 +1102,19 @@ |
1060 | 1103 | class ImageHistoryPseudoPager extends ReverseChronologicalPager { |
1061 | 1104 | protected $preventClickjacking = false; |
1062 | 1105 | |
| 1106 | + /** |
| 1107 | + * @var File |
| 1108 | + */ |
| 1109 | + protected $mImg; |
| 1110 | + |
| 1111 | + /** |
| 1112 | + * @var Title |
| 1113 | + */ |
| 1114 | + protected $mTitle; |
| 1115 | + |
| 1116 | + /** |
| 1117 | + * @param ImagePage $imagePage |
| 1118 | + */ |
1063 | 1119 | function __construct( $imagePage ) { |
1064 | 1120 | parent::__construct(); |
1065 | 1121 | $this->mImagePage = $imagePage; |