$print = compose_from_geojson($context->db, $json_content); } else { $atlas_postvars = $_POST; if (!empty($_POST['form_url'])) { $added_form = add_form($context->db, $context->user['id']); $added_form['form_url'] = $_POST['form_url']; if (!empty($_POST['form_title'])) { $added_form['title'] = $_POST['form_title']; } set_form($context->db, $added_form); // // A new form was requested. // postvars will now have form_id in addition to form_url. // $atlas_postvars['form_id'] = $added_form['id']; } if ($clone_job && $clone_id) { $print = compose_clone($context->db, $atlas_postvars, $context->user['id'], $clone_id, false); } elseif ($refresh_job && $refresh_id) { $print = compose_clone($context->db, $atlas_postvars, $context->user['id'], $refresh_id, true); } else { $print = compose_from_postvars($context->db, $atlas_postvars, $context->user['id']); } } $context->db->query('COMMIT'); if (is_null($print)) { die_with_code(400, "Missing... Something."); } $print_url = 'http://' . get_domain_name() . get_base_dir() . '/atlas.php?id=' . urlencode($print['id']); header("Location: {$print_url}"); }
/** * simple wrapper for refreshing an atlas that calls compose_clone w/ refresh flag set **/ function compose_refresh(&$dbh, $post, $user_id, $refresh_id) { return compose_clone($dbh, $post, $user_id, $refresh_id, true); }