You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routes.php 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. use OC\Core\Application;
  9. $application = new Application();
  10. $application->registerRoutes($this, array('routes' => array(
  11. array('name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'),
  12. array('name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'),
  13. array('name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'),
  14. array('name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'),
  15. )
  16. ));
  17. // Post installation check
  18. /** @var $this OCP\Route\IRouter */
  19. // Core ajax actions
  20. // Search
  21. $this->create('search_ajax_search', '/search/ajax/search.php')
  22. ->actionInclude('search/ajax/search.php');
  23. // AppConfig
  24. $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
  25. ->actionInclude('core/ajax/appconfig.php');
  26. // Share
  27. $this->create('core_ajax_share', '/core/ajax/share.php')
  28. ->actionInclude('core/ajax/share.php');
  29. // Translations
  30. $this->create('core_ajax_translations', '/core/ajax/translations.php')
  31. ->actionInclude('core/ajax/translations.php');
  32. // Tags
  33. $this->create('core_tags_tags', '/tags/{type}')
  34. ->get()
  35. ->action('OC\Core\Tags\Controller', 'getTags')
  36. ->requirements(array('type'));
  37. $this->create('core_tags_favorites', '/tags/{type}/favorites')
  38. ->get()
  39. ->action('OC\Core\Tags\Controller', 'getFavorites')
  40. ->requirements(array('type'));
  41. $this->create('core_tags_ids_for_tag', '/tags/{type}/ids')
  42. ->get()
  43. ->action('OC\Core\Tags\Controller', 'getIdsForTag')
  44. ->requirements(array('type'));
  45. $this->create('core_tags_favorite', '/tags/{type}/favorite/{id}/')
  46. ->post()
  47. ->action('OC\Core\Tags\Controller', 'favorite')
  48. ->requirements(array('type', 'id'));
  49. $this->create('core_tags_unfavorite', '/tags/{type}/unfavorite/{id}/')
  50. ->post()
  51. ->action('OC\Core\Tags\Controller', 'unFavorite')
  52. ->requirements(array('type', 'id'));
  53. $this->create('core_tags_tag', '/tags/{type}/tag/{id}/')
  54. ->post()
  55. ->action('OC\Core\Tags\Controller', 'tagAs')
  56. ->requirements(array('type', 'id'));
  57. $this->create('core_tags_untag', '/tags/{type}/untag/{id}/')
  58. ->post()
  59. ->action('OC\Core\Tags\Controller', 'unTag')
  60. ->requirements(array('type', 'id'));
  61. $this->create('core_tags_add', '/tags/{type}/add')
  62. ->post()
  63. ->action('OC\Core\Tags\Controller', 'addTag')
  64. ->requirements(array('type'));
  65. $this->create('core_tags_delete', '/tags/{type}/delete')
  66. ->post()
  67. ->action('OC\Core\Tags\Controller', 'deleteTags')
  68. ->requirements(array('type'));
  69. // oC JS config
  70. $this->create('js_config', '/core/js/oc.js')
  71. ->actionInclude('core/js/config.php');
  72. // Routing
  73. $this->create('core_ajax_preview', '/core/preview')
  74. ->actionInclude('core/ajax/preview.php');
  75. $this->create('core_ajax_preview', '/core/preview.png')
  76. ->actionInclude('core/ajax/preview.php');
  77. $this->create('core_ajax_update', '/core/ajax/update.php')
  78. ->actionInclude('core/ajax/update.php');
  79. // Avatar routes
  80. $this->create('core_avatar_get_tmp', '/avatar/tmp')
  81. ->get()
  82. ->action('OC\Core\Avatar\Controller', 'getTmpAvatar');
  83. $this->create('core_avatar_get', '/avatar/{user}/{size}')
  84. ->get()
  85. ->action('OC\Core\Avatar\Controller', 'getAvatar');
  86. $this->create('core_avatar_post', '/avatar/')
  87. ->post()
  88. ->action('OC\Core\Avatar\Controller', 'postAvatar');
  89. $this->create('core_avatar_delete', '/avatar/')
  90. ->delete()
  91. ->action('OC\Core\Avatar\Controller', 'deleteAvatar');
  92. $this->create('core_avatar_post_cropped', '/avatar/cropped')
  93. ->post()
  94. ->action('OC\Core\Avatar\Controller', 'postCroppedAvatar');
  95. // Sharing routes
  96. $this->create('core_share_show_share', '/s/{token}')
  97. ->get()
  98. ->action('OC\Core\Share\Controller', 'showShare');
  99. // used for heartbeat
  100. $this->create('heartbeat', '/heartbeat')->action(function(){
  101. // do nothing
  102. });