diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-24 09:35:33 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-24 09:35:33 +0200 |
commit | 1a73e607bdba6d654936bde632acaa4960dec729 (patch) | |
tree | 66e80e3fad82a91dd402582e08f0a97775a93502 /core/js/share.js | |
parent | 7242480049d1fcc32fba0d1acb7c8572d7b9350f (diff) | |
parent | 7bb6aab8eea731840d67d5e3aa302c04a593a4e0 (diff) | |
download | nextcloud-server-1a73e607bdba6d654936bde632acaa4960dec729.tar.gz nextcloud-server-1a73e607bdba6d654936bde632acaa4960dec729.zip |
Merge branch 'master' into more-themable-strings
Conflicts:
lib/template.php
Diffstat (limited to 'core/js/share.js')
-rw-r--r-- | core/js/share.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/js/share.js b/core/js/share.js index 21e352ee1c6..e59669cbc2b 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -92,6 +92,7 @@ OC.Share={ } } if (shares) { + OC.Share.statuses[itemSource] = OC.Share.statuses[itemSource] || {}; OC.Share.statuses[itemSource]['link'] = link; } else { delete OC.Share.statuses[itemSource]; @@ -122,7 +123,12 @@ OC.Share={ callback(result.data); } } else { - OC.dialogs.alert(result.data.message, t('core', 'Error while sharing')); + if (result.data && result.data.message) { + var msg = result.data.message; + } else { + var msg = t('core', 'Error'); + } + OC.dialogs.alert(msg, t('core', 'Error while sharing')); } }); }, @@ -161,7 +167,12 @@ OC.Share={ // respective checkbox should be checked or // not. + var publicUploadEnabled = $('#filestable').data('allow-public-upload'); + if (typeof publicUploadEnabled == 'undefined') { + publicUploadEnabled = 'no'; + } var allowPublicUploadStatus = false; + $.each(data.shares, function(key, value) { if (allowPublicUploadStatus) { return true; @@ -181,7 +192,7 @@ OC.Share={ html += '<div id="linkPass">'; html += '<input id="linkPassText" type="password" placeholder="'+t('core', 'Password')+'" />'; html += '</div>'; - if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE)) { + if (itemType === 'folder' && (possiblePermissions & OC.PERMISSION_CREATE) && publicUploadEnabled === 'yes') { html += '<div id="allowPublicUploadWrapper" style="display:none;">'; html += '<input type="checkbox" value="1" name="allowPublicUpload" id="sharingDialogAllowPublicUpload"' + ((allowPublicUploadStatus) ? 'checked="checked"' : '') + ' />'; html += '<label for="sharingDialogAllowPublicUpload">' + t('core', 'Allow Public Upload') + '</label>'; |