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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. $this->create('post_setup_check', '/post-setup-check')
  20. ->action('OC_Setup', 'postSetupCheck');
  21. // Core ajax actions
  22. // Search
  23. $this->create('search_ajax_search', '/search/ajax/search.php')
  24. ->actionInclude('search/ajax/search.php');
  25. // AppConfig
  26. $this->create('core_ajax_appconfig', '/core/ajax/appconfig.php')
  27. ->actionInclude('core/ajax/appconfig.php');
  28. // Share
  29. $this->create('core_ajax_share', '/core/ajax/share.php')
  30. ->actionInclude('core/ajax/share.php');
  31. // Translations
  32. $this->create('core_ajax_translations', '/core/ajax/translations.php')
  33. ->actionInclude('core/ajax/translations.php');
  34. // Tags
  35. $this->create('core_tags_tags', '/tags/{type}')
  36. ->get()
  37. ->action('OC\Core\Tags\Controller', 'getTags')
  38. ->requirements(array('type'));
  39. $this->create('core_tags_favorites', '/tags/{type}/favorites')
  40. ->get()
  41. ->action('OC\Core\Tags\Controller', 'getFavorites')
  42. ->requirements(array('type'));
  43. $this->create('core_tags_ids_for_tag', '/tags/{type}/ids')
  44. ->get()
  45. ->action('OC\Core\Tags\Controller', 'getIdsForTag')
  46. ->requirements(array('type'));
  47. $this->create('core_tags_favorite', '/tags/{type}/favorite/{id}/')
  48. ->post()
  49. ->action('OC\Core\Tags\Controller', 'favorite')
  50. ->requirements(array('type', 'id'));
  51. $this->create('core_tags_unfavorite', '/tags/{type}/unfavorite/{id}/')
  52. ->post()
  53. ->action('OC\Core\Tags\Controller', 'unFavorite')
  54. ->requirements(array('type', 'id'));
  55. $this->create('core_tags_tag', '/tags/{type}/tag/{id}/')
  56. ->post()
  57. ->action('OC\Core\Tags\Controller', 'tagAs')
  58. ->requirements(array('type', 'id'));
  59. $this->create('core_tags_untag', '/tags/{type}/untag/{id}/')
  60. ->post()
  61. ->action('OC\Core\Tags\Controller', 'unTag')
  62. ->requirements(array('type', 'id'));
  63. $this->create('core_tags_add', '/tags/{type}/add')
  64. ->post()
  65. ->action('OC\Core\Tags\Controller', 'addTag')
  66. ->requirements(array('type'));
  67. $this->create('core_tags_delete', '/tags/{type}/delete')
  68. ->post()
  69. ->action('OC\Core\Tags\Controller', 'deleteTags')
  70. ->requirements(array('type'));
  71. // oC JS config
  72. $this->create('js_config', '/core/js/oc.js')
  73. ->actionInclude('core/js/config.php');
  74. // Routing
  75. $this->create('core_ajax_preview', '/core/preview')
  76. ->actionInclude('core/ajax/preview.php');
  77. $this->create('core_ajax_preview', '/core/preview.png')
  78. ->actionInclude('core/ajax/preview.php');
  79. $this->create('core_ajax_update', '/core/ajax/update.php')
  80. ->actionInclude('core/ajax/update.php');
  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. // Sharing routes
  98. $this->create('core_share_show_share', '/s/{token}')
  99. ->get()
  100. ->action('OC\Core\Share\Controller', 'showShare');
  101. // used for heartbeat
  102. $this->create('heartbeat', '/heartbeat')->action(function(){
  103. // do nothing
  104. });