INavigationManager.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  9. * @author Julius Härtl <jus@bitgrid.net>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Roeland Jago Douma <roeland@famdouma.nl>
  12. * @author Thomas Müller <thomas.mueller@tmit.eu>
  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. /**
  30. * Public interface of ownCloud for apps to use.
  31. * Navigation manager interface
  32. *
  33. */
  34. // use OCP namespace for all classes that are considered public.
  35. // This means that they should be used by apps instead of the internal ownCloud classes
  36. namespace OCP;
  37. /**
  38. * Manages the ownCloud navigation
  39. * @since 6.0.0
  40. */
  41. interface INavigationManager {
  42. /**
  43. * Navigation entries of the app navigation
  44. * @since 16.0.0
  45. */
  46. public const TYPE_APPS = 'link';
  47. /**
  48. * Navigation entries of the settings navigation
  49. * @since 16.0.0
  50. */
  51. public const TYPE_SETTINGS = 'settings';
  52. /**
  53. * Navigation entries for public page footer navigation
  54. * @since 16.0.0
  55. */
  56. public const TYPE_GUEST = 'guest';
  57. /**
  58. * Creates a new navigation entry
  59. *
  60. * @param array|\Closure $entry Array containing: id, name, order, icon and href key
  61. * The use of a closure is preferred, because it will avoid
  62. * loading the routing of your app, unless required.
  63. * @return void
  64. * @since 6.0.0
  65. */
  66. public function add($entry);
  67. /**
  68. * Sets the current navigation entry of the currently running app
  69. * @param string $appId id of the app entry to activate (from added $entry)
  70. * @return void
  71. * @since 6.0.0
  72. */
  73. public function setActiveEntry($appId);
  74. /**
  75. * Get a list of navigation entries
  76. *
  77. * @param string $type type of the navigation entries
  78. * @return array
  79. * @since 14.0.0
  80. */
  81. public function getAll(string $type = self::TYPE_APPS): array;
  82. }