app.php 2.5 KB

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