ControllerFactory.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. class ControllerFactory {
  3. public function create() {
  4. $form = new Form();
  5. $action = $form->get("a");
  6. switch ($action) {
  7. case "files":
  8. return new FilesController();
  9. case "notifications":
  10. return new NotificationsController();
  11. case "removesubtopic":
  12. return new RemoveSubTopicController();
  13. case "addsubtopic":
  14. return new AddSubTopicController();
  15. case "submitregister":
  16. return new SubmitRegisterController();
  17. case "register":
  18. return new RegisterController();
  19. case "submiteditcomment":
  20. return new SubmitEditCommentController();
  21. case "submitpreferences":
  22. return new SubmitUserPreferencesController();
  23. case "user":
  24. return new UserController();
  25. case "preferences":
  26. return new UserPreferencesController();
  27. case "submiteditpost":
  28. return new SubmitEditPostController();
  29. case "editpost":
  30. return new EditPostController();
  31. case "changesubscription":
  32. return new ChangeSubscriptionController();
  33. case "subscribe":
  34. return new SubscribeController();
  35. case "submittopicsettings":
  36. return new SubmitTopicSettingsController();
  37. case "topicmanagement":
  38. return new TopicManagementController();
  39. case "commentreplies":
  40. return new CommentRepliesController();
  41. case "submitnewcomment":
  42. return new SubmitNewCommentController();
  43. case "submitnewtopic":
  44. return new SubmitNewTopicController();
  45. case "submitnewpost":
  46. return new SubmitNewPostController();
  47. case "createtopic":
  48. return new CreateTopicController();
  49. case "createpost":
  50. return new CreatePostController();
  51. case "login":
  52. return new LoginController();
  53. case "logout":
  54. return new LogoutController();
  55. case "topic":
  56. return new TopicController();
  57. case "post":
  58. return new PostController();
  59. case "index":
  60. default:
  61. return new IndexController();
  62. }
  63. }
  64. }