routes.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. /**
  3. * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. // Post installation check
  9. $this->create('post_setup_check', '/post-setup-check')
  10. ->action('OC_Setup', 'postSetupCheck');
  11. // Core ajax actions
  12. // Search
  13. $this->create('search_ajax_search', '/search/ajax/search.php')
  14. ->actionInclude('search/ajax/search.php');
  15. // AppConfig
  16. $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
  17. ->actionInclude('core/ajax/appconfig.php');
  18. // Share
  19. $this->create('core_ajax_share', '/core/ajax/share.php')
  20. ->actionInclude('core/ajax/share.php');
  21. // Translations
  22. $this->create('core_ajax_translations', '/core/ajax/translations.php')
  23. ->actionInclude('core/ajax/translations.php');
  24. // Tags
  25. $this->create('core_tags_tags', '/tags/{type}')
  26. ->get()
  27. ->action('OC\Core\Tags\Controller', 'getTags')
  28. ->requirements(array('type'));
  29. $this->create('core_tags_favorites', '/tags/{type}/favorites')
  30. ->get()
  31. ->action('OC\Core\Tags\Controller', 'getFavorites')
  32. ->requirements(array('type'));
  33. $this->create('core_tags_ids_for_tag', '/tags/{type}/ids')
  34. ->get()
  35. ->action('OC\Core\Tags\Controller', 'getIdsForTag')
  36. ->requirements(array('type'));
  37. $this->create('core_tags_favorite', '/tags/{type}/favorite/{id}/')
  38. ->post()
  39. ->action('OC\Core\Tags\Controller', 'favorite')
  40. ->requirements(array('type', 'id'));
  41. $this->create('core_tags_unfavorite', '/tags/{type}/unfavorite/{id}/')
  42. ->post()
  43. ->action('OC\Core\Tags\Controller', 'unFavorite')
  44. ->requirements(array('type', 'id'));
  45. $this->create('core_tags_tag', '/tags/{type}/tag/{id}/')
  46. ->post()
  47. ->action('OC\Core\Tags\Controller', 'tagAs')
  48. ->requirements(array('type', 'id'));
  49. $this->create('core_tags_untag', '/tags/{type}/untag/{id}/')
  50. ->post()
  51. ->action('OC\Core\Tags\Controller', 'unTag')
  52. ->requirements(array('type', 'id'));
  53. $this->create('core_tags_add', '/tags/{type}/add')
  54. ->post()
  55. ->action('OC\Core\Tags\Controller', 'addTag')
  56. ->requirements(array('type'));
  57. $this->create('core_tags_delete', '/tags/{type}/delete')
  58. ->post()
  59. ->action('OC\Core\Tags\Controller', 'deleteTags')
  60. ->requirements(array('type'));
  61. // oC JS config
  62. $this->create('js_config', '/core/js/config.js')
  63. ->actionInclude('core/js/config.php');
  64. // Routing
  65. $this->create('core_ajax_routes', '/core/routes.json')
  66. ->action('OC_Router', 'JSRoutes');
  67. $this->create('core_ajax_preview', '/core/preview.png')
  68. ->actionInclude('core/ajax/preview.php');
  69. $this->create('core_lostpassword_index', '/lostpassword/')
  70. ->get()
  71. ->action('OC\Core\LostPassword\Controller', 'index');
  72. $this->create('core_lostpassword_send_email', '/lostpassword/')
  73. ->post()
  74. ->action('OC\Core\LostPassword\Controller', 'sendEmail');
  75. $this->create('core_lostpassword_reset', '/lostpassword/reset/{token}/{user}')
  76. ->get()
  77. ->action('OC\Core\LostPassword\Controller', 'reset');
  78. $this->create('core_lostpassword_reset_password', '/lostpassword/reset/{token}/{user}')
  79. ->post()
  80. ->action('OC\Core\LostPassword\Controller', 'resetPassword');
  81. // Avatar routes
  82. $this->create('core_avatar_get_tmp', '/avatar/tmp')
  83. ->get()
  84. ->action('OC\Core\Avatar\Controller', 'getTmpAvatar');
  85. $this->create('core_avatar_get', '/avatar/{user}/{size}')
  86. ->get()
  87. ->action('OC\Core\Avatar\Controller', 'getAvatar');
  88. $this->create('core_avatar_post', '/avatar/')
  89. ->post()
  90. ->action('OC\Core\Avatar\Controller', 'postAvatar');
  91. $this->create('core_avatar_delete', '/avatar/')
  92. ->delete()
  93. ->action('OC\Core\Avatar\Controller', 'deleteAvatar');
  94. $this->create('core_avatar_post_cropped', '/avatar/cropped')
  95. ->post()
  96. ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
  97. // Not specifically routed
  98. $this->create('app_css', '/apps/{app}/{file}')
  99. ->requirements(array('file' => '.*.css'))
  100. ->action('OC', 'loadCSSFile');
  101. $this->create('app_index_script', '/apps/{app}/')
  102. ->defaults(array('file' => 'index.php'))
  103. //->requirements(array('file' => '.*.php'))
  104. ->action('OC', 'loadAppScriptFile');
  105. $this->create('app_script', '/apps/{app}/{file}')
  106. ->defaults(array('file' => 'index.php'))
  107. ->requirements(array('file' => '.*.php'))
  108. ->action('OC', 'loadAppScriptFile');
  109. // used for heartbeat
  110. $this->create('heartbeat', '/heartbeat')->action(function(){
  111. // do nothing
  112. });