function add() { $conf = $this->getConfig(); $recipe2add = $_POST['addrecipe']; Feediron_Logger::get()->log(Feediron_Logger::LOG_TTRSS, "recipe: " . $recipe2add); $rm = new RecipeManager(); $recipe = $rm->getRecipe($recipe2add); header('Content-Type: application/json'); if (!isset($recipe['match'])) { $json_reply['success'] = false; $json_reply['errormessage'] = __('Github API message: ') . $recipe['message']; $json_reply['data'] = Feediron_Json::format(json_encode($recipe)); echo json_encode($json_reply); return false; } if (isset($conf[$recipe['match']])) { $conf[$recipe['match'] . '_orig'] = $conf[$recipe['match']]; } $conf[$recipe['match']] = $recipe['config']; $json_reply['success'] = true; $json_reply['message'] = __('Configuration updated.'); $json_reply['json_conf'] = Feediron_Json::format(json_encode($conf)); echo json_encode($json_reply); }