INavigationManager.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 Julius Härtl <jus@bitgrid.net>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. * @author Roeland Jago Douma <roeland@famdouma.nl>
  11. * @author Thomas Müller <thomas.mueller@tmit.eu>
  12. *
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. /**
  29. * Public interface of ownCloud for apps to use.
  30. * Navigation manager interface
  31. *
  32. */
  33. // use OCP namespace for all classes that are considered public.
  34. // This means that they should be used by apps instead of the internal ownCloud classes
  35. namespace OCP;
  36. /**
  37. * Manages the ownCloud navigation
  38. * @since 6.0.0
  39. */
  40. interface INavigationManager {
  41. /**
  42. * Navigation entries of the app navigation
  43. * @since 16.0.0
  44. */
  45. const TYPE_APPS = 'link';
  46. /**
  47. * Navigation entries of the settings navigation
  48. * @since 16.0.0
  49. */
  50. const TYPE_SETTINGS = 'settings';
  51. /**
  52. * Navigation entries for public page footer navigation
  53. * @since 16.0.0
  54. */
  55. const TYPE_GUEST = 'guest';
  56. /**
  57. * Creates a new navigation entry
  58. *
  59. * @param array|\Closure $entry Array containing: id, name, order, icon and href key
  60. * The use of a closure is preferred, because it will avoid
  61. * loading the routing of your app, unless required.
  62. * @return void
  63. * @since 6.0.0
  64. */
  65. public function add($entry);
  66. /**
  67. * Sets the current navigation entry of the currently running app
  68. * @param string $appId id of the app entry to activate (from added $entry)
  69. * @return void
  70. * @since 6.0.0
  71. */
  72. public function setActiveEntry($appId);
  73. /**
  74. * Get a list of navigation entries
  75. *
  76. * @param string $type type of the navigation entries
  77. * @return array
  78. * @since 14.0.0
  79. */
  80. public function getAll(string $type = self::TYPE_APPS): array;
  81. }