diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index 4cae46125b..a1e0e94390 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -82,7 +82,11 @@ public function index() { $appName = $this->appName; // Parameters sent to the template - $params = ['appName' => $appName]; + $params = + [ + 'appName' => $appName, + 'publicUploadEnabled' => $this->appConfig->getAppValue('core', 'shareapi_allow_public_upload', 'yes') + ]; // Will render the page using the template found in templates/index.php $response = new TemplateResponse($appName, 'index', $params); diff --git a/js/vendor/owncloud/share.js b/js/vendor/owncloud/share.js index 4c1d49bc98..7776b85a1e 100644 --- a/js/vendor/owncloud/share.js +++ b/js/vendor/owncloud/share.js @@ -173,20 +173,19 @@ // Used later on to determine if the // respective checkbox should be checked or // not. - // FIXME public uploading is not supported in Gallery - /*var publicUploadEnabled = $('#filestable').data('allow-public-upload'); - if (typeof publicUploadEnabled == 'undefined') { - publicUploadEnabled = 'no'; - } - var allowPublicUploadStatus = false; + var publicUploadEnabled = $('#gallery').data('allow-public-upload'); + if (typeof publicUploadEnabled == 'undefined') { + publicUploadEnabled = 'no'; + } + var allowPublicUploadStatus = false; - $.each(data, function (key, value) { - if (value.share_type === self.SHARE_TYPE_LINK) { - allowPublicUploadStatus = - (value.permissions & OC.PERMISSION_CREATE) ? true : false; - return true; - } - });*/ + $.each(data, function (key, value) { + if (value.share_type === self.SHARE_TYPE_LINK) { + allowPublicUploadStatus = + (value.permissions & OC.PERMISSION_CREATE) ? true : false; + return true; + } + }); var sharePlaceholder = t('core', 'Share with users or groups …'); if (oc_appconfig.core.remoteShareAllowed) { @@ -244,20 +243,18 @@ html += ''; html += ''; - // FIXME public uploading is not supported in Gallery - /*if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE) && - publicUploadEnabled === 'yes') { - html += ''; - } - html += ''; - var mailPublicNotificationEnabled = $( + if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE) && + publicUploadEnabled === 'yes') { + html += ''; + } + /*var mailPublicNotificationEnabled = $( 'input:hidden[name=mailPublicNotificationEnabled]').val(); if (mailPublicNotificationEnabled === 'yes') { html += '