Merge "reinstating Change Ifb1f6125..."
authorKaldari <rkaldari@wikimedia.org>
Thu, 18 Oct 2012 00:32:56 +0000 (00:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 18 Oct 2012 00:32:56 +0000 (00:32 +0000)
1  2 
includes/DefaultSettings.php
includes/specials/SpecialUpload.php

@@@ -530,6 -530,13 +530,13 @@@ $wgAllowAsyncCopyUploads = false
   */
  $wgCopyUploadsDomains = array();
  
+ /**
+  * Enable copy uploads from Special:Upload. $wgAllowCopyUploads must also be
+  * true. If $wgAllowCopyUploads is true, but this is false, you will only be
+  * able to perform copy uploads from the API or extensions (e.g. UploadWizard).
+  */
+ $wgCopyUploadsFromSpecialUpload = false;
  /**
   * Proxy to use for copy upload requests.
   * @since 1.20
@@@ -748,7 -755,6 +755,7 @@@ $wgContentHandlers = array
        CONTENT_MODEL_WIKITEXT => 'WikitextContentHandler', // the usual case
        CONTENT_MODEL_JAVASCRIPT => 'JavaScriptContentHandler', // dumb version, no syntax highlighting
        CONTENT_MODEL_CSS => 'CssContentHandler', // dumb version, no syntax highlighting
 +      CONTENT_MODEL_TEXT => 'TextContentHandler', // plain text, for use by extensions etc
  );
  
  /**
@@@ -1089,16 -1095,6 +1096,16 @@@ $wgThumbUpright = 0.75
   */
  $wgDirectoryMode = 0777;
  
 +/**
 + * Generate and use thumbnails suitable for screens with 1.5 and 2.0 pixel densities.
 + *
 + * This means a 320x240 use of an image on the wiki will also generate 480x360 and 640x480
 + * thumbnails, output via data-src-1-5 and data-src-2-0. Runtime JavaScript switches the
 + * images in after loading the original low-resolution versions depending on the reported
 + * window.devicePixelRatio.
 + */
 +$wgResponsiveImages = true;
 +
  /**
   * @name DJVU settings
   * @{
@@@ -2058,27 -2054,6 +2065,27 @@@ $wgSquidServersNoPurge = array()
  /** Maximum number of titles to purge in any one client operation */
  $wgMaxSquidPurgeTitles = 400;
  
 +/**
 + * Whether to use a Host header in purge requests sent to the proxy servers
 + * configured in $wgSquidServers. Set this to false to support Squid 
 + * configured in forward-proxy mode.
 + *
 + * If this is set to true, a Host header will be sent, and only the path
 + * component of the URL will appear on the request line, as if the request
 + * were a non-proxy HTTP 1.1 request. Varnish only supports this style of 
 + * request. Squid supports this style of request only if reverse-proxy mode
 + * (http_port ... accel) is enabled.
 + *
 + * If this is set to false, no Host header will be sent, and the absolute URL
 + * will be sent in the request line, as is the standard for an HTTP proxy
 + * request in both HTTP 1.0 and 1.1. This style of request is not supported
 + * by Varnish, but is supported by Squid in either configuration (forward or
 + * reverse). 
 + *
 + * @since 1.21
 + */
 +$wgSquidPurgeUseHostHeader = true;
 +
  /**
   * Routing configuration for HTCP multicast purging. Add elements here to
   * enable HTCP and determine which purges are sent where. If set to an empty
@@@ -5424,14 -5399,6 +5431,14 @@@ $wgJobClasses = array
   */
  $wgJobTypesExcludedFromDefaultQueue = array();
  
 +/**
 + * Map of job types to configuration arrays.
 + * These settings should be global to all wikis.
 + */
 +$wgJobTypeConf = array(
 +      'default' => array( 'class' => 'JobQueueDB' ),
 +);
 +
  /**
   * Additional functions to be performed with updateSpecialPages.
   * Expensive Querypages are already updated.
@@@ -5962,7 -5929,6 +5969,7 @@@ $wgAPIModules = array()
  $wgAPIMetaModules = array();
  $wgAPIPropModules = array();
  $wgAPIListModules = array();
 +$wgAPIGeneratorModules = array();
  
  /**
   * Maximum amount of rows to scan in a DB query in the API
@@@ -6324,14 -6290,6 +6331,14 @@@ $wgContentHandlerUseDB = true
   */
  $wgRequirePasswordforEmailChange = true;
  
 +/**
 + * Register handlers for specific types of sites.
 + *
 + * @since 1.20
 + */
 +$wgSiteTypes = array();
 +$wgSiteTypes['mediawiki'] = 'MediaWikiSite';
 +
  /**
   * For really cool vim folding this needs to be at the end:
   * vim: foldmarker=@{,@} foldmethod=marker
@@@ -646,7 -646,7 +646,7 @@@ class SpecialUpload extends SpecialPag
                                $exists['normalizedFile']->getTitle()->getPrefixedText() )->parse();
                } elseif ( $exists['warning'] == 'thumb' ) {
                        // Swapped argument order compared with other messages for backwards compatibility
 -                      $warning = wfMessage( 'fileexists-thumbnail-yes', 
 +                      $warning = wfMessage( 'fileexists-thumbnail-yes',
                                $exists['thumbFile']->getTitle()->getPrefixedText(), $filename )->parse();
                } elseif ( $exists['warning'] == 'thumb-name' ) {
                        // Image w/o '180px-' does not exists, but we do not like these filenames
@@@ -790,6 -790,8 +790,8 @@@ class UploadForm extends HTMLForm 
         * @return Array: descriptor array
         */
        protected function getSourceSection() {
+               global $wgCopyUploadsFromSpecialUpload;
                if ( $this->mSessionKey ) {
                        return array(
                                'SessionKey' => array(
                        );
                }
  
-               $canUploadByUrl = UploadFromUrl::isEnabled() && UploadFromUrl::isAllowed( $this->getUser() );
+               $canUploadByUrl = UploadFromUrl::isEnabled()
+                       && UploadFromUrl::isAllowed( $this->getUser() )
+                       && $wgCopyUploadsFromSpecialUpload;
                $radio = $canUploadByUrl;
                $selectedSourceType = strtolower( $this->getRequest()->getText( 'wpSourceType', 'File' ) );
  
@@@ -1107,7 -1111,7 +1111,7 @@@ class UploadSourceField extends HTMLTex
         * @return string
         */
        function getLabelHtml( $cellAttributes = array() ) {
 -              $id = "wpSourceType{$this->mParams['upload-type']}";
 +              $id = $this->mParams['id'];
                $label = Html::rawElement( 'label', array( 'for' => $id ), $this->mLabel );
  
                if ( !empty( $this->mParams['radio'] ) ) {