From 28876bf46363116218c48021ddf556c53d5256f5 Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Mon, 14 Sep 2015 13:57:49 +0100 Subject: Display applicable global storages in personal mount list --- apps/files_external/js/settings.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'apps/files_external/js') diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 9b048ba193f..c9badb2f728 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -820,6 +820,37 @@ MountConfigListView.prototype = _.extend({ loadStorages: function() { var self = this; + if (this._isPersonal) { + // load userglobal storages + $.ajax({ + type: 'GET', + url: OC.generateUrl('apps/files_external/userglobalstorages'), + contentType: 'application/json', + success: function(result) { + $.each(result, function(i, storageParams) { + storageParams.mountPoint = storageParams.mountPoint.substr(1); // trim leading slash + var storageConfig = new self._storageConfigClass(); + _.extend(storageConfig, storageParams); + var $tr = self.newStorage(storageConfig); + + // userglobal storages must be at the top of the list + $tr.detach(); + self.$el.prepend($tr); + + var $authentication = $tr.find('.authentication'); + $authentication.text($authentication.find('select option:selected').text()); + + // userglobal storages do not expose configuration data + $tr.find('.configuration').text(t('files_external', 'Admin defined')); + + // disable any other inputs + $tr.find('.mountOptionsToggle, .remove').empty(); + $tr.find('input, select, button').attr('disabled', 'disabled'); + }); + } + }); + } + var url = this._storageConfigClass.prototype._url; $.ajax({ -- cgit v1.2.3