IApi.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  6. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Thomas Müller <thomas.mueller@tmit.eu>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. /**
  26. * Public interface of ownCloud for apps to use.
  27. * AppFramework/IApi interface
  28. */
  29. namespace OCP\AppFramework;
  30. /**
  31. * A few very basic and frequently used API functions are combined in here
  32. * @deprecated 8.0.0
  33. */
  34. interface IApi {
  35. /**
  36. * Gets the userid of the current user
  37. * @return string the user id of the current user
  38. * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID()
  39. */
  40. function getUserId();
  41. /**
  42. * Adds a new javascript file
  43. * @deprecated 8.0.0 include javascript and css in template files
  44. * @param string $scriptName the name of the javascript in js/ without the suffix
  45. * @param string $appName the name of the app, defaults to the current one
  46. * @return void
  47. */
  48. function addScript($scriptName, $appName = null);
  49. /**
  50. * Adds a new css file
  51. * @deprecated 8.0.0 include javascript and css in template files
  52. * @param string $styleName the name of the css file in css/without the suffix
  53. * @param string $appName the name of the app, defaults to the current one
  54. * @return void
  55. */
  56. function addStyle($styleName, $appName = null);
  57. /**
  58. * @deprecated 8.0.0 include javascript and css in template files
  59. * shorthand for addScript for files in the 3rdparty directory
  60. * @param string $name the name of the file without the suffix
  61. * @return void
  62. */
  63. function add3rdPartyScript($name);
  64. /**
  65. * @deprecated 8.0.0 include javascript and css in template files
  66. * shorthand for addStyle for files in the 3rdparty directory
  67. * @param string $name the name of the file without the suffix
  68. * @return void
  69. */
  70. function add3rdPartyStyle($name);
  71. /**
  72. * Checks if an app is enabled
  73. * @deprecated 8.0.0 communication between apps should happen over built in
  74. * callbacks or interfaces (check the contacts and calendar managers)
  75. * Checks if an app is enabled
  76. * also use \OC::$server->getAppManager()->isEnabledForUser($appName)
  77. * @param string $appName the name of an app
  78. * @return bool true if app is enabled
  79. */
  80. public function isAppEnabled($appName);
  81. }