app.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Jan-Christoph Borchardt <hey@jancborchardt.net>
  7. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Robin Appelman <robin@icewind.nl>
  10. * @author Robin McCorkell <robin@mccorkell.me.uk>
  11. * @author Vincent Petry <pvince81@owncloud.com>
  12. *
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. use OCA\Files_External\Config\ConfigAdapter;
  29. require_once __DIR__ . '/../3rdparty/autoload.php';
  30. // register Application object singleton
  31. \OCA\Files_External\MountConfig::$app = \OC::$server->query(\OCA\Files_External\AppInfo\Application::class);
  32. \OCA\Files_External\MountConfig::$app->registerListeners();
  33. $appContainer = \OCA\Files_External\MountConfig::$app->getContainer();
  34. \OCA\Files\App::getNavigationManager()->add(function () {
  35. $l = \OC::$server->getL10N('files_external');
  36. return [
  37. 'id' => 'extstoragemounts',
  38. 'appname' => 'files_external',
  39. 'script' => 'list.php',
  40. 'order' => 30,
  41. 'name' => $l->t('External storages'),
  42. ];
  43. });
  44. $mountProvider = $appContainer->query(ConfigAdapter::class);
  45. \OC::$server->getMountProviderCollection()->registerProvider($mountProvider);