diff options
author | Aaron Parecki <aaron@parecki.com> | 2020-03-30 10:26:46 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2020-03-30 10:26:46 -0700 |
commit | 8dec126e7dd19ebb068b1a4f42804f8c0205af9d (patch) | |
tree | 03b978cc4772db3e1819e27aa76cccd742a89488 /controllers | |
parent | 3759383e91344a6e10d23d4dbd90b9eda513d79c (diff) |
add channel selection to event interface
Diffstat (limited to 'controllers')
-rw-r--r-- | controllers/controllers.php | 4 | ||||
-rw-r--r-- | controllers/micropub.php | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php index a4baa0f..f9fad25 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -182,8 +182,11 @@ $app->get('/event', function() use($app) { if($user=require_login($app)) { $params = $app->request()->params(); + $channels = $user->channels ? json_decode($user->channels, true) : []; + render('event', array( 'title' => 'Event', + 'channels' => $channels, 'authorizing' => false )); } @@ -362,6 +365,7 @@ $app->get('/settings', function() use($app) { 'title' => 'Settings', 'user' => $user, 'syndication_targets' => json_decode($user->syndication_targets, true), + 'channels' => json_decode($user->channels, true), 'authorizing' => false ]); } diff --git a/controllers/micropub.php b/controllers/micropub.php index 6eacd4a..cc1ca02 100644 --- a/controllers/micropub.php +++ b/controllers/micropub.php @@ -11,6 +11,17 @@ $app->get('/micropub/syndications', function() use($app) { } }); +$app->get('/micropub/channels', function() use($app) { + if($user=require_login($app)) { + $data = get_micropub_config($user, ['q'=>'config']); + $app->response()['Content-type'] = 'application/json'; + $app->response()->body(json_encode(array( + 'channels' => $data['channels'], + 'response' => $data['response'] + ))); + } +}); + $app->post('/micropub/post', function() use($app) { if($user=require_login($app)) { $params = $app->request()->params(); |