app->module('cockpit')->hasaccess('drone', 'manage.settings')) { return FALSE; } $drone = $this->app->storage->findOne('drone/settings'); return $this->render('drone:views/settings/index.php', compact('drone')); } public function save() { if ($data = $this->param('drone', false)) { $data['_modified'] = time(); if (!isset($data['_id'])) { $data['_created'] = $data['_modified']; } $this->app->storage->save('drone/settings', $data); return json_encode($data); } return false; } }