INavigationManager.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. * Navigation entries of the app navigation
  41. * @since 16.0.0
  42. */
  43. const TYPE_APPS = 'link';
  44. /**
  45. * Navigation entries of the settings navigation
  46. * @since 16.0.0
  47. */
  48. const TYPE_SETTINGS = 'settings';
  49. /**
  50. * Navigation entries for public page footer navigation
  51. * @since 16.0.0
  52. */
  53. const TYPE_GUEST = 'guest';
  54. /**
  55. * Creates a new navigation entry
  56. *
  57. * @param array|\Closure $entry Array containing: id, name, order, icon and href key
  58. * The use of a closure is preferred, because it will avoid
  59. * loading the routing of your app, unless required.
  60. * @return void
  61. * @since 6.0.0
  62. */
  63. public function add($entry);
  64. /**
  65. * Sets the current navigation entry of the currently running app
  66. * @param string $appId id of the app entry to activate (from added $entry)
  67. * @return void
  68. * @since 6.0.0
  69. */
  70. public function setActiveEntry($appId);
  71. /**
  72. * Get a list of navigation entries
  73. *
  74. * @param string $type type of the navigation entries
  75. * @return array
  76. * @since 14.0.0
  77. */
  78. public function getAll(string $type = self::TYPE_APPS): array;
  79. }