iapi.php 2.9 KB

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