diff options
author | Robin Appelman <robin@icewind.nl> | 2016-08-09 14:19:15 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-08-17 10:40:59 +0200 |
commit | 644770c950c73bf23b818a9e7ba71d3a739aad0b (patch) | |
tree | 1a67fea576222923569363d8f9e04bb5749b33e3 /apps/files_external | |
parent | ff89354588252340cd76a0b135e30fcb4fab7b30 (diff) | |
download | nextcloud-server-644770c950c73bf23b818a9e7ba71d3a739aad0b.tar.gz nextcloud-server-644770c950c73bf23b818a9e7ba71d3a739aad0b.zip |
hide files external in personal settings if it's empty
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/js/settings.js | 5 | ||||
-rw-r--r-- | apps/files_external/templates/settings.php | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index fc6edefc648..da3e2397b7e 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -945,6 +945,11 @@ MountConfigListView.prototype = _.extend({ $tr.find('.configuration').text(t('files_external', 'Admin defined')); } }); + var mainForm = $('#files_external'); + if (result.length === 0 && mainForm.attr('data-can-create') === 'false') { + mainForm.hide(); + $('a[href="#external-storage"]').parent().hide(); + } onCompletion.resolve(); } }); diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 47230f98bd3..2581259c4ca 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -87,7 +87,7 @@ } ?> -<form id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> +<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>"> <h2><?php p($l->t('External Storage')); ?></h2> <?php if (isset($_['dependencies']) and ($_['dependencies']<>'') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> <table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'> |