From 4837a4616da9ae4890a2a9a3ce89d8f4b1077de2 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 6 Oct 2014 08:40:57 -0700 Subject: [PATCH] return options in the format Pebble expects for a menu --- controllers/controllers.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/controllers/controllers.php b/controllers/controllers.php index c212a43..2c74d5e 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -53,8 +53,16 @@ $app->get('/new', function() use($app) { $app->get('/new/options.json', function() use($app) { $app->response()['Content-Type'] = 'application/json'; $app->response()->body(json_encode(array( - 'Caffeine' => caffeine_options(), - 'Alcohol' => alcohol_options() + 'sections' => array( + array( + 'title' => 'Caffeine', + 'items' => array_map(function($e){ return array('title'=>$e); }, caffeine_options()) + ), + array( + 'title' => 'Alcohol', + 'items' => array_map(function($e){ return array('title'=>$e); }, caffeine_options()) + ) + ) ))); });