You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Björn Schießle <bjoern@schiessle.org>
  7. * @author Gadzy <dev@gadzy.fr>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Michael Gapczynski <GapczynskiM@gmail.com>
  10. * @author Robin Appelman <robin@icewind.nl>
  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. $l = \OC::$server->getL10N('files_sharing');
  29. \OCA\Files_Sharing\Helper::registerHooks();
  30. \OCP\Share::registerBackend('file', 'OCA\Files_Sharing\ShareBackend\File');
  31. \OCP\Share::registerBackend('folder', 'OCA\Files_Sharing\ShareBackend\Folder', 'file');
  32. $application = new \OCA\Files_Sharing\AppInfo\Application();
  33. $application->registerMountProviders();
  34. $eventDispatcher = \OC::$server->getEventDispatcher();
  35. $eventDispatcher->addListener(
  36. 'OCA\Files::loadAdditionalScripts',
  37. function() {
  38. \OCP\Util::addScript('files_sharing', 'share');
  39. \OCP\Util::addScript('files_sharing', 'sharetabview');
  40. \OCP\Util::addScript('files_sharing', 'sharebreadcrumbview');
  41. \OCP\Util::addStyle('files_sharing', 'sharetabview');
  42. \OCP\Util::addStyle('files_sharing', 'sharebreadcrumb');
  43. }
  44. );
  45. // \OCP\Util::addStyle('files_sharing', 'sharetabview');
  46. $config = \OC::$server->getConfig();
  47. if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
  48. \OCA\Files\App::getNavigationManager()->add(
  49. array(
  50. "id" => 'sharingin',
  51. "appname" => 'files_sharing',
  52. "script" => 'list.php',
  53. "order" => 10,
  54. "name" => $l->t('Shared with you')
  55. )
  56. );
  57. if (\OCP\Util::isSharingDisabledForUser() === false) {
  58. \OCA\Files\App::getNavigationManager()->add(
  59. array(
  60. "id" => 'sharingout',
  61. "appname" => 'files_sharing',
  62. "script" => 'list.php',
  63. "order" => 15,
  64. "name" => $l->t('Shared with others')
  65. )
  66. );
  67. // Check if sharing by link is enabled
  68. if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
  69. \OCA\Files\App::getNavigationManager()->add(
  70. array(
  71. "id" => 'sharinglinks',
  72. "appname" => 'files_sharing',
  73. "script" => 'list.php',
  74. "order" => 20,
  75. "name" => $l->t('Shared by link')
  76. )
  77. );
  78. }
  79. }
  80. }