INavigationManager.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  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. /**
  27. * Public interface of ownCloud for apps to use.
  28. * Navigation manager interface
  29. *
  30. */
  31. // use OCP namespace for all classes that are considered public.
  32. // This means that they should be used by apps instead of the internal ownCloud classes
  33. namespace OCP;
  34. /**
  35. * Manages the ownCloud navigation
  36. * @since 6.0.0
  37. */
  38. interface INavigationManager {
  39. /**
  40. * Creates a new navigation entry
  41. *
  42. * @param array|\Closure $entry Array containing: id, name, order, icon and href key
  43. * The use of a closure is preferred, because it will avoid
  44. * loading the routing of your app, unless required.
  45. * @return void
  46. * @since 6.0.0
  47. */
  48. public function add($entry);
  49. /**
  50. * Sets the current navigation entry of the currently running app
  51. * @param string $appId id of the app entry to activate (from added $entry)
  52. * @return void
  53. * @since 6.0.0
  54. */
  55. public function setActiveEntry($appId);
  56. /**
  57. * Get a list of navigation entries
  58. *
  59. * @param string $type type of the navigation entries
  60. * @return array
  61. * @since 14.0.0
  62. */
  63. public function getAll(string $type = 'link'): array;
  64. }