1
0

app.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. * @author Vincent Petry <pvince81@owncloud.com>
  11. *
  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. use OC\Search\Provider\File;
  28. // required for translation purpose
  29. // t('Files')
  30. $l = \OC::$server->getL10N('files');
  31. \OC::$server->getSearch()->registerProvider(File::class, array('apps' => array('files')));
  32. $templateManager = \OC_Helper::getFileTemplateManager();
  33. $templateManager->registerTemplate('text/html', 'core/templates/filetemplates/template.html');
  34. $templateManager->registerTemplate('application/vnd.oasis.opendocument.presentation', 'core/templates/filetemplates/template.odp');
  35. $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt');
  36. $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods');
  37. \OCA\Files\App::getNavigationManager()->add(function () use ($l) {
  38. return [
  39. 'id' => 'files',
  40. 'appname' => 'files',
  41. 'script' => 'list.php',
  42. 'order' => 0,
  43. 'name' => $l->t('All files'),
  44. ];
  45. });
  46. \OCA\Files\App::getNavigationManager()->add(function () use ($l) {
  47. return [
  48. 'id' => 'recent',
  49. 'appname' => 'files',
  50. 'script' => 'recentlist.php',
  51. 'order' => 2,
  52. 'name' => $l->t('Recent'),
  53. ];
  54. });
  55. \OCP\Util::connectHook('\OCP\Config', 'js', '\OCA\Files\App', 'extendJsConfig');