1) Enable upload navigation link for non-logged-in users. From a usability
authorErik Moeller <erik@users.mediawiki.org>
Sun, 24 Apr 2005 00:53:12 +0000 (00:53 +0000)
committerErik Moeller <erik@users.mediawiki.org>
Sun, 24 Apr 2005 00:53:12 +0000 (00:53 +0000)
perspective, navigation should not be surprising with random elements
popping up under certain circumstances only ("How do I upload" is a FAQ).
Special:Upload will show a message "You have to be logged in" for anonymous
users, so no confusion should arise.

2) New variable $wgUploadNavigationUrl for setting the URL to which
the "Upload file" link in the toolbox points. The German Wikipedia is striving
towards an approach where local uploads are enabled, but the navigation link
goes to the Commons. The link to Special:Upload will be put on a policy page
about fair use. In this way, fair use uploads are meant to be allowed as an
exception. A similar approach is likely to be used for Wikinews.

includes/DefaultSettings.php
includes/SkinTemplate.php

index cf3bfa0..0fe482d 100644 (file)
@@ -138,6 +138,12 @@ $wgSharedUploadDirectory = "/var/www/wiki3/images";
 $wgSharedUploadDBname = false;
 /** Cache shared metadata in memcached. Don't do this if the commons wiki is in a different memcached domain */
 $wgCacheSharedUploads = true;
+/**
+ * Point the upload navigation link to an external URL
+ * Useful if you want to use a shared repository by default
+ * without disabling local uploads
+*/
+# $wgUploadNavigationUrl = 'http://commons.wikimedia.org/wiki/Special:Upload';
 
 /** 
  * Give a path here to use thumb.php for thumbnail generation on client request, instead of 
@@ -150,7 +156,6 @@ $wgCacheSharedUploads = true;
 $wgThumbnailScriptPath = false;
 $wgSharedThumbnailScriptPath = false;
 
-
 /**
  * Set the following to false especially if you have a set of files that need to
  * be accessible by all wikis, and you do not want to use the hash (path/a/aa/)
@@ -1305,7 +1310,6 @@ $wgCountCategorizedImagesAsUsed = false;
  */
 $wgExternalStores = false;
 
-
 } else {
        die();
 }
index c9f0233..7fd5adc 100644 (file)
@@ -724,7 +724,7 @@ class SkinTemplate extends Skin {
                wfProfileIn( $fname );
                
                global $wgUser, $wgRequest;
-               global $wgSiteSupportPage, $wgEnableUploads;
+               global $wgSiteSupportPage, $wgEnableUploads, $wgUploadNavigationUrl;
 
                $action = $wgRequest->getText( 'action' );
                $oldid = $wgRequest->getVal( 'oldid' );
@@ -740,8 +740,12 @@ class SkinTemplate extends Skin {
                // $nav_urls['sitesupport'] = array('href' => $this->makeI18nUrl('sitesupportpage'));
                $nav_urls['sitesupport'] = array('href' => $wgSiteSupportPage);
                $nav_urls['help'] = array('href' => $this->makeI18nUrl('helppage'));
-               if( $this->loggedin && $wgEnableUploads ) {
-                       $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload'));
+               if( $wgEnableUploads ) {
+                       if (isset($wgUploadNavigationUrl)) {
+                               $nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );                 
+                       } else {                        
+                               $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload'));
+                       }
                } else {
                        $nav_urls['upload'] = false;
                }