Esempio n. 1
0
$routes->post('/thread/:id/edit', function ($id) {
    BaseController::check_thread_rights($id);
    ThreadController::updateThread($id);
});
$routes->post('/thread/:id/destroy', function ($id) {
    BaseController::check_admin();
    ThreadController::destroyThread($id);
});
$routes->get('/thread', function () {
    ThreadController::threadList();
});
$routes->get('/thread/create', 'check_logged_in', function () {
    ThreadController::createThread();
});
$routes->get('/thread/:id', function ($id) {
    ThreadController::showThread($id);
});
$routes->get('/thread/:id/participants', function ($id) {
    ThreadController::participants($id);
});
$routes->get('/thread/:id/edit', function ($id) {
    BaseController::check_thread_rights($id);
    ThreadController::editThread($id);
});
//Messages
$routes->get('/thread/:id/message/create', 'check_logged_in', function ($id) {
    MessageController::createMessage($id);
});
$routes->get('/message/:id/edit', function ($id) {
    BaseController::check_message_rights($id);
    MessageController::editMessage($id);