From ce260a4b9fcd28bbdb82063eba0dcffe13287e2c Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Sun, 24 Apr 2005 00:53:12 +0000 Subject: [PATCH] 1) Enable upload navigation link for non-logged-in users. From a usability 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 | 8 ++++++-- includes/SkinTemplate.php | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index cf3bfa0d30..0fe482d58b 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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(); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index c9f0233b10..7fd5adcaa2 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -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; } -- 2.20.1