Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

app.php 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. /**
  3. * @author Björn Schießle <schiessle@owncloud.com>
  4. * @author Gadzy <dev@gadzy.fr>
  5. * @author Joas Schilling <nickvergessen@owncloud.com>
  6. * @author Michael Gapczynski <GapczynskiM@gmail.com>
  7. * @author Robin Appelman <icewind@owncloud.com>
  8. * @author Vincent Petry <pvince81@owncloud.com>
  9. *
  10. * @copyright Copyright (c) 2015, ownCloud, Inc.
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCA\Files_Sharing\Appinfo;
  27. $l = \OC::$server->getL10N('files_sharing');
  28. \OC::$CLASSPATH['OC_Share_Backend_File'] = 'files_sharing/lib/share/file.php';
  29. \OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php';
  30. \OC::$CLASSPATH['OC\Files\Storage\Shared'] = 'files_sharing/lib/sharedstorage.php';
  31. \OC::$CLASSPATH['OC\Files\Cache\SharedScanner'] = 'files_sharing/lib/scanner.php';
  32. \OC::$CLASSPATH['OC\Files\Cache\Shared_Cache'] = 'files_sharing/lib/cache.php';
  33. \OC::$CLASSPATH['OC\Files\Cache\Shared_Permissions'] = 'files_sharing/lib/permissions.php';
  34. \OC::$CLASSPATH['OC\Files\Cache\Shared_Updater'] = 'files_sharing/lib/updater.php';
  35. \OC::$CLASSPATH['OC\Files\Cache\Shared_Watcher'] = 'files_sharing/lib/watcher.php';
  36. \OC::$CLASSPATH['OCA\Files\Share\Maintainer'] = 'files_sharing/lib/maintainer.php';
  37. \OC::$CLASSPATH['OCA\Files\Share\Proxy'] = 'files_sharing/lib/proxy.php';
  38. // Exceptions
  39. \OC::$CLASSPATH['OCA\Files_Sharing\Exceptions\BrokenPath'] = 'files_sharing/lib/exceptions.php';
  40. $application = new Application();
  41. $application->registerMountProviders();
  42. $application->setupPropagation();
  43. \OCP\App::registerAdmin('files_sharing', 'settings-admin');
  44. \OCP\App::registerPersonal('files_sharing', 'settings-personal');
  45. \OCA\Files_Sharing\Helper::registerHooks();
  46. \OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
  47. \OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
  48. \OCP\Util::addScript('files_sharing', 'share');
  49. \OCP\Util::addScript('files_sharing', 'external');
  50. // FIXME: registering a job here will cause additional useless SQL queries
  51. // when the route is not cron.php, needs a better way
  52. \OC::$server->getJobList()->add('OCA\Files_sharing\Lib\DeleteOrphanedSharesJob');
  53. \OC::$server->getActivityManager()->registerExtension(function() {
  54. return new \OCA\Files_Sharing\Activity(
  55. \OC::$server->query('L10NFactory'),
  56. \OC::$server->getURLGenerator()
  57. );
  58. });
  59. $config = \OC::$server->getConfig();
  60. if ($config->getAppValue('core', 'shareapi_enabled', 'yes') === 'yes') {
  61. \OCA\Files\App::getNavigationManager()->add(
  62. array(
  63. "id" => 'sharingin',
  64. "appname" => 'files_sharing',
  65. "script" => 'list.php',
  66. "order" => 10,
  67. "name" => $l->t('Shared with you')
  68. )
  69. );
  70. if (\OCP\Util::isSharingDisabledForUser() === false) {
  71. \OCA\Files\App::getNavigationManager()->add(
  72. array(
  73. "id" => 'sharingout',
  74. "appname" => 'files_sharing',
  75. "script" => 'list.php',
  76. "order" => 15,
  77. "name" => $l->t('Shared with others')
  78. )
  79. );
  80. // Check if sharing by link is enabled
  81. if ($config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {
  82. \OCA\Files\App::getNavigationManager()->add(
  83. array(
  84. "id" => 'sharinglinks',
  85. "appname" => 'files_sharing',
  86. "script" => 'list.php',
  87. "order" => 20,
  88. "name" => $l->t('Shared by link')
  89. )
  90. );
  91. }
  92. }
  93. }