http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69997

Revision: 69997
Author:   btongminh
Date:     2010-07-27 10:31:30 +0000 (Tue, 27 Jul 2010)

Log Message:
-----------
Fixes for (bug 18885), r60593, r60979: The upload link for missing files can 
now be set separately from the navigation link with $wgUploadMissingFileUrl.

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/DefaultSettings.php
    trunk/phase3/includes/Linker.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2010-07-27 10:30:07 UTC (rev 69996)
+++ trunk/phase3/RELEASE-NOTES  2010-07-27 10:31:30 UTC (rev 69997)
@@ -46,6 +46,8 @@
   uploads in.
 * IBM DB2 database no longer uses the db specific $wgDBport_db2 variable but 
the
   normal $wgDBport.
+* The upload link for missing files can now be set separately from the 
+  navigation link with $wgUploadMissingFileUrl.
 
 === New features in 1.17 ===
 * (bug 10183) Users can now add personal styles and scripts to all skins via

Modified: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php   2010-07-27 10:30:07 UTC (rev 
69996)
+++ trunk/phase3/includes/DefaultSettings.php   2010-07-27 10:31:30 UTC (rev 
69997)
@@ -436,13 +436,17 @@
  * Useful if you want to use a shared repository by default
  * without disabling local uploads (use $wgEnableUploads = false for that)
  * e.g. $wgUploadNavigationUrl = 
'http://commons.wikimedia.org/wiki/Special:Upload';
- *
- * This also affects images inline images that do not exist. In that case the 
URL will get
- * (?|&)wpDestFile=<filename> appended to it as appropriate.
  */
 $wgUploadNavigationUrl = false;
 
 /**
+ * Point the upload link for missing files to an external URL, as with
+ * $wgUploadNavigationUrl. The URL will get (?|&)wpDestFile=<filename> 
+ * appended to it as appropriate.
+ */
+$wgUploadMissingFileUrl = false;
+
+/**
  * Give a path here to use thumb.php for thumbnail generation on client 
request, instead of
  * generating them on render and outputting a static URL. This is necessary if 
some of your
  * apache servers don't have read/write access to the thumbnail path.

Modified: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php    2010-07-27 10:30:07 UTC (rev 69996)
+++ trunk/phase3/includes/Linker.php    2010-07-27 10:31:30 UTC (rev 69997)
@@ -684,11 +684,11 @@
         * @return String
         */
        public function makeBrokenImageLinkObj( $title, $text = '', $query = 
'', $trail = '', $prefix = '', $time = false ) {
-               global $wgEnableUploads, $wgUploadNavigationUrl;
+               global $wgEnableUploads, $wgUploadMissingFileUrl;
                if( $title instanceof Title ) {
                        wfProfileIn( __METHOD__ );
                        $currentExists = $time ? ( wfFindFile( $title ) != 
false ) : false;
-                       if( ( $wgUploadNavigationUrl || $wgEnableUploads ) && 
!$currentExists ) {
+                       if( ( $wgUploadMissingFileUrl || $wgEnableUploads ) && 
!$currentExists ) {
                                if( $text == '' )
                                        $text = htmlspecialchars( 
$title->getPrefixedText() );
 
@@ -724,13 +724,13 @@
         * @return String: urlencoded URL
         */
        protected function getUploadUrl( $destFile, $query = '' ) {
-               global $wgUploadNavigationUrl;
+               global $wgUploadMissingFileUrl;
                $q = 'wpDestFile=' . $destFile->getPartialUrl();
                if( $query != '' )
                        $q .= '&' . $query;
 
-               if( $wgUploadNavigationUrl ) {
-                       return wfAppendQuery( $wgUploadNavigationUrl, $q );
+               if( $wgUploadMissingFileUrl ) {
+                       return wfAppendQuery( $wgUploadMissingFileUrl, $q );
                } else {
                        $upload = SpecialPage::getTitleFor( 'Upload' );
                        return $upload->getLocalUrl( $q );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to