From c62c5205ac7df0dd6b3f47c0ab8376c5c2bfb94b Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 16 Mar 2016 09:24:52 -0400 Subject: crude UI for creating events --- controllers/controllers.php | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'controllers/controllers.php') diff --git a/controllers/controllers.php b/controllers/controllers.php index ef619a6..475e620 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -140,6 +140,18 @@ $app->get('/favorite', function() use($app) { } }); +$app->get('/event', function() use($app) { + if($user=require_login($app)) { + $params = $app->request()->params(); + + $html = render('event', array( + 'title' => 'Event', + 'authorizing' => false + )); + $app->response()->body($html); + } +}); + $app->get('/itinerary', function() use($app) { if($user=require_login($app)) { $params = $app->request()->params(); @@ -486,20 +498,6 @@ $app->post('/repost', function() use($app) { } }); -$app->post('/itinerary', function() use($app) { - if($user=require_login($app)) { - $params = $app->request()->params(); - - $r = micropub_post_for_user($user, json_decode($params['data'], true), null, true); - - $app->response()->body(json_encode(array( - 'location' => $r['location'], - 'error' => $r['error'], - 'response' => $r['response'] - ))); - } -}); - $app->get('/micropub/syndications', function() use($app) { if($user=require_login($app)) { $data = get_syndication_targets($user); @@ -531,6 +529,20 @@ $app->post('/micropub/post', function() use($app) { } }); +$app->post('/micropub/postjson', function() use($app) { + if($user=require_login($app)) { + $params = $app->request()->params(); + + $r = micropub_post_for_user($user, json_decode($params['data'], true), null, true); + + $app->response()->body(json_encode(array( + 'location' => $r['location'], + 'error' => $r['error'], + 'response' => $r['response'] + ))); + } +}); + /* $app->post('/auth/facebook', function() use($app) { if($user=require_login($app, false)) { -- cgit v1.2.3