Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -152,6 +152,11 @@ |
153 | 153 | $wgOut->addHTML( |
154 | 154 | "<script type=\"text/javascript\">attachMetadataToggle('mw_metadata', '$expand', '$collapse');</script>\n" ); |
155 | 155 | } |
| 156 | + |
| 157 | + $css = $this->repo->getDescriptionStylesheetUrl(); |
| 158 | + if ( $css ) { |
| 159 | + $wgOut->addStyle( $css ); |
| 160 | + } |
156 | 161 | } |
157 | 162 | |
158 | 163 | public function getRedirectTarget() { |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -84,6 +84,8 @@ |
85 | 85 | 'class' => 'LocalRepo', |
86 | 86 | 'name' => 'local', |
87 | 87 | 'directory' => $wgUploadDirectory, |
| 88 | + 'scriptDirUrl' => $wgScriptPath, |
| 89 | + 'scriptExtension' => $wgScriptExtension, |
88 | 90 | 'url' => $wgUploadBaseUrl ? $wgUploadBaseUrl . $wgUploadPath : $wgUploadPath, |
89 | 91 | 'hashLevels' => $wgHashedUploadDirectory ? 2 : 0, |
90 | 92 | 'thumbScriptUrl' => $wgThumbnailScriptPath, |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -372,6 +372,17 @@ |
373 | 373 | } |
374 | 374 | } |
375 | 375 | } |
| 376 | + |
| 377 | + /** |
| 378 | + * Get the URL of the stylesheet to apply to description pages |
| 379 | + * @return string |
| 380 | + */ |
| 381 | + function getDescriptionStylesheetUrl() { |
| 382 | + if ( $this->scriptDirUrl ) { |
| 383 | + return self::makeUrl( 'title=MediaWiki:ImagePage.css&' . |
| 384 | + wfArrayToCGI( Skin::getDynamicStylesheetQuery() ) ); |
| 385 | + } |
| 386 | + } |
376 | 387 | |
377 | 388 | /** |
378 | 389 | * Store a file to a given destination. |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -616,11 +616,7 @@ |
617 | 617 | // Per-site custom styles |
618 | 618 | if( $wgUseSiteCss ) { |
619 | 619 | global $wgHandheldStyle; |
620 | | - $query = wfArrayToCGI( array( |
621 | | - 'usemsgcache' => 'yes', |
622 | | - 'ctype' => 'text/css', |
623 | | - 'smaxage' => $wgSquidMaxage |
624 | | - ) + $siteargs ); |
| 620 | + $query = wfArrayToCGI( self::getDynamicStylesheetQuery() ); |
625 | 621 | # Site settings must override extension css! (bug 15025) |
626 | 622 | $out->addStyle( self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) ); |
627 | 623 | $out->addStyle( self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ), 'print' ); |
— | — | @@ -666,6 +662,22 @@ |
667 | 663 | |
668 | 664 | wfProfileOut( __METHOD__ ); |
669 | 665 | } |
| 666 | + |
| 667 | + /** |
| 668 | + * Get the query to generate a dynamic stylesheet |
| 669 | + * |
| 670 | + * @return array |
| 671 | + */ |
| 672 | + public static function getDynamicStylesheetQuery() { |
| 673 | + global $wgSquidMaxage; |
| 674 | + return array( |
| 675 | + 'action' => 'raw', |
| 676 | + 'maxage' => $wgSquidMaxage, |
| 677 | + 'usemsgcache' => 'yes', |
| 678 | + 'ctype' => 'text/css', |
| 679 | + 'smaxage' => $wgSquidMaxage, |
| 680 | + ); |
| 681 | + } |
670 | 682 | |
671 | 683 | /** |
672 | 684 | * Add skin specific stylesheets |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -100,6 +100,8 @@ |
101 | 101 | * texvc now supports \bcancel and \xcancel in addition to \cancel and \cancelto |
102 | 102 | * Added scriptExtension setting to $wgForeignFileRepos |
103 | 103 | * ForeignApiRepo uses scriptDirUrl if apiBase not set |
| 104 | +* (bug 24212) Added MediaWiki:ImagePage.css which is also included on foreign |
| 105 | + client wikis. |
104 | 106 | |
105 | 107 | === Bug fixes in 1.17 === |
106 | 108 | * (bug 17560) Half-broken deletion moved image files to deletion archive |