-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathroutes.php
132 lines (89 loc) · 7.23 KB
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////
// PAGES | HTTP GET requests only
//////////////////////////////////////////////////////////////////////////////////////////////////
// Home
$routes->map('GET', '/', array('source' => 'home', 'title' => 'Home', 'active' => 'home'), null);
$routes->map('GET', '/home', array('source' => 'home', 'title' => 'Home', 'active' => 'home'), 'home');
// Register
$routes->map('GET', '/account/register', array('source' => 'register', 'title' => 'Register', 'active' => 'register', 'guestsonly' => true), 'register');
// Register Thanks
$routes->map('GET', '/account/register/thanks', array('source' => 'register_thanks', 'title' => 'Thanks for Registering!', 'usersonly' => true), 'register_thanks');
// Login
$routes->map('GET', '/account/login', array('source' => 'login', 'title' => 'Login', 'active' => 'login', 'guestsonly' => true), 'login');
// Account Panel
$routes->map('GET', '/account/panel', array('source' => 'account', 'title' => 'Account Panel', 'usersonly' => true), 'account');
// Logout
$routes->map('GET', '/account/logout', array('source' => 'logout'), 'logout');
// Terms of Use
$routes->map('GET', '/terms', array('source' => 'terms', 'title' => 'Terms of Use'), 'terms');
// News Feed
$routes->map('GET', '/news', array('source' => 'news_feed', 'title' => 'News', 'active' => 'news'), 'news');
// News Article
$routes->map('GET', '/news/[i:id]', array('source' => 'news_article', 'active' => 'news'), 'news_article');
// Jams
$routes->map('GET', '/jams', array('source' => 'jams_list', 'title' => 'Game Jams', 'active' => 'jams'), 'jams');
// Jam Page
$routes->map('GET', '/jams/[i:id]', array('source' => 'jam_page', 'active' => 'jams'), 'jam_page');
// Theme Suggestions
$routes->map('GET', '/jams/[i:id]/suggestions', array('source' => 'theme_suggestions', 'active' => 'jams'), 'theme_suggestions');
// Theme Voting
$routes->map('GET', '/jams/[i:id]/voting/[i:round]?', array('source' => 'theme_voting', 'active' => 'jams'), 'theme_voting');
// Games List
$routes->map('GET', '/jams/[i:id]/games', array('source' => 'games_list', 'active' => 'jams'), 'games_list');
// Game Page
$routes->map('GET', '/jams/[i:id]/games/[i:gameid]', array('source' => 'game_page', 'active' => 'jams'), 'game_page');
// Game Submission
$routes->map('GET', '/jams/[i:id]/games/submit', array('source' => 'game_submission', 'title' => 'Submit Game', 'active' => 'jams', 'usersonly' => true), 'game_submission');
// Rules
$routes->map('GET', '/rules', array('source' => 'rules', 'title' => 'Rules', 'active' => 'rules'), 'rules');
// Time
$routes->map('GET', '/time', array('source' => 'time', 'title' => 'Time'), 'time');
// Admin Panel
$routes->map('GET', '/admin', array('source' => 'admin/admin', 'title' => 'Admin Panel', 'active' => 'admin', 'adminsonly' => true), 'admin');
// Jam Admin
$routes->map('GET', '/admin/jam/[i:id]?', array('source' => 'admin/jam', 'title' => 'Jam Admin', 'active' => 'admin', 'adminsonly' => true), 'jam_admin');
// Themes Admin
$routes->map('GET', '/admin/jam/[i:id]/themes', array('source' => 'admin/themes', 'title' => 'Theme Admin', 'active' => 'admin', 'adminsonly' => true), 'theme_admin');
// Theme Admin Edit
$routes->map('GET', '/admin/jam/[i:id]/themes/[i:themeid]', array('source' => 'admin/theme_edit', 'title' => 'Theme Edit', 'active' => 'admin', 'adminsonly' => true), 'theme_edit_admin');
// News Admin
$routes->map('GET', '/admin/news/[i:id]?', array('source' => 'admin/news', 'title' => 'News Admin', 'active' => 'admin', 'adminsonly' => true), 'news_admin');
//////////////////////////////////////////////////////////////////////////////////////////////////
// API | HTTP POST requests only
//////////////////////////////////////////////////////////////////////////////////////////////////
// Login
$routes->map('POST', '/api/v1/account/login', array('source' => 'v1/dologin', 'postvariables' => array('username', 'password'), 'guestsonly' => true), null);
// Register
$routes->map('POST', '/api/v1/account/register', array('source' => 'v1/doregister', 'postvariables' => array('username', 'password', 'email'), 'guestsonly' => true), null);
// Markdown Preview
$routes->map('POST', '/api/v1/markdown/preview', array('source' => 'v1/getmarkdownpreview', 'postvariables' => array('text')), null);
// Profile Update
$routes->map('POST', '/api/v1/profile/update', array('source' => 'v1/doprofileupdate', 'postvariables' => array('avatar', 'website', 'about'), 'usersonly' => true), null);
// Get Jams
$routes->map('POST', '/api/v1/jams', array('source' => 'v1/getjams'), null);
// Jam Create
$routes->map('POST', '/api/v1/jams/create', array('source' => 'v1/dojamcreate', 'postvariables' => array('title', 'themesperuser', 'autoapprovethemes', 'initialvotingrounds', 'votesperuser', 'topthemesinfinal', 'suggestionsbegin', 'suggestionslength', 'approvallength', 'votinglength', 'themeannouncelength', 'jamlength', 'submissionslength', 'judginglength', 'categories'), 'adminsonly' => true), null);
// Jam Update
$routes->map('POST', '/api/v1/jams/update', array('source' => 'v1/dojamupdate', 'postvariables' => array('id', 'title', 'themesperuser', 'autoapprovethemes', 'initialvotingrounds', 'votesperuser', 'topthemesinfinal', 'suggestionsbegin', 'suggestionslength', 'approvallength', 'votinglength', 'themeannouncelength', 'jamlength', 'submissionslength', 'judginglength', 'categories'), 'adminsonly' => true), null);
// Get News
$routes->map('POST', '/api/v1/news', array('source' => 'v1/getnews', 'optionalvariables' => array('beforedate', 'afterdate')), null);
// News Add
$routes->map('POST', '/api/v1/news/add', array('source' => 'v1/donewsadd', 'postvariables' => array('title', 'date', 'summary', 'content'), 'adminsonly' => true), null);
// News Update
$routes->map('POST', '/api/v1/news/update', array('source' => 'v1/donewsupdate', 'postvariables' => array('id', 'title', 'date', 'summary', 'content'), 'adminsonly' => true), null);
// News Delete
$routes->map('POST', '/api/v1/news/delete', array('source' => 'v1/donewsdelete', 'postvariables' => array('id')), null);
// Suggestions Submit
$routes->map('POST', '/api/v1/themes/suggestions/submit', array('source' => 'v1/dosuggestionsubmit', 'postvariables' => array('jamid', 'themename'), 'optionalvariables' => array('themeid'), 'usersonly' => true), null);
// Suggestions Approve
$routes->map('POST', '/api/v1/themes/suggestions/approve', array('source' => 'v1/dosuggestionapprove', 'postvariables' => array('themeid', 'isapproved'), 'adminsonly' => true), null);
// Voting Vote
$routes->map('POST', '/api/v1/themes/voting/vote', array('source' => 'v1/dovotingvote', 'postvariables' => array('jamid', 'round', 'votes'), 'usersonly' => true), null);
// Theme Edit
$routes->map('POST', '/api/v1/themes/edit', array('source' => 'v1/dothemeedit', 'postvariables' => array('id', 'name'), 'adminsonly' => true), null);
// Game Submit
$routes->map('POST', '/api/v1/games/submit', array('source' => 'v1/dogamesubmit', 'postvariables' => array('jamid', 'name', 'partner', 'thumbnail', 'description', 'images', 'links'), 'usersonly' => true), null);
// Game Judging
$routes->map('POST', '/api/v1/games/judging/submit', array('source' => 'v1/dojudgingsubmit', 'postvariables' => array('jamid', 'gameid', 'ratings'), 'usersonly' => true), null);
?>