app.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * @author Jakob Sack <mail@jakobsack.de>
  4. * @author Joas Schilling <nickvergessen@owncloud.com>
  5. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <icewind@owncloud.com>
  8. * @author Thomas Müller <thomas.mueller@tmit.eu>
  9. * @author Vincent Petry <pvince81@owncloud.com>
  10. *
  11. * @copyright Copyright (c) 2015, ownCloud, Inc.
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. \OCP\App::registerAdmin('files', 'admin');
  28. \OC::$server->getNavigationManager()->add(function () {
  29. $l = \OC::$server->getL10N('files');
  30. return [
  31. 'id' => 'files_index',
  32. 'order' => 0,
  33. 'href' => \OCP\Util::linkTo('files', 'index.php'),
  34. 'icon' => \OCP\Util::imagePath('core', 'places/files.svg'),
  35. 'name' => $l->t('Files'),
  36. ];
  37. });
  38. \OC::$server->getSearch()->registerProvider('OC\Search\Provider\File', array('apps' => array('files')));
  39. $templateManager = \OC_Helper::getFileTemplateManager();
  40. $templateManager->registerTemplate('text/html', 'core/templates/filetemplates/template.html');
  41. $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp');
  42. $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt');
  43. $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods');
  44. \OCA\Files\App::getNavigationManager()->add(function () {
  45. $l = \OC::$server->getL10N('files');
  46. return [
  47. 'id' => 'files',
  48. 'appname' => 'files',
  49. 'script' => 'list.php',
  50. 'order' => 0,
  51. 'name' => $l->t('All files'),
  52. ];
  53. });
  54. \OC::$server->getActivityManager()->registerExtension(function() {
  55. return new \OCA\Files\Activity(
  56. \OC::$server->query('L10NFactory'),
  57. \OC::$server->getURLGenerator()
  58. );
  59. });