enforce_master_on_off_switch($_SERVER['HTTP_ACCEPT_LANGUAGE']); enforce_api_password($_POST['password']); $context = default_context(False); /**** ... ****/ // Getting the correct form id $form_id = $_GET['id'] ? $_GET['id'] : null; $form = get_form($context->db, $form_id); if (!$form) { die_with_code(400, "I don't know that form"); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $context->db->query('START TRANSACTION'); foreach ($_POST['fields'] as $_field) { $field = add_form_field($context->db, $form['id'], $_field['name']); if (!$field) { die_with_code(400, "I don't know that field"); } $field['type'] = $_field['type']; $field['label'] = $_field['label']; set_form_field($context->db, $field); } // manually-defined form title from add-form.php wins here $form['title'] = $form['title'] ? $form['title'] : $_POST['title']; $form['http_method'] = $_POST['http_method']; $form['action_url'] = $_POST['action_url']; set_form($context->db, $form); finish_form($context->db, $form['id']); $context->db->query('COMMIT'); } header('HTTP/1.1 200'); echo "OK\n";
$refresh_job = true; $refresh_id = $_POST['refresh_id']; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $context->db->query('START TRANSACTION'); if ($is_json) { $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');
} set_blog_comment(array('author' => $final_user, 'authorlink' => $author_link, 'content' => $c['CONTENT'], 'timestamp' => $c['DATE'])); } } set_pagination(array('innerLink' => $pagination[4], 'currentPage' => $currentPage)); // Intégration du formulaire de réponse. if ($this->instance->users_global->isConnected()) { $pseudo = $this->instance->users_global->current('PSEUDO'); $email = $this->instance->users_global->current('EMAIL'); } else { $pseudo = ''; $email = ''; } // REPLY FORM if ($setting['EVERYONEPOST'] == 0) { if ($userUtil->isConnected()) { set_form('blog_single_reply_form', array('type' => 'text', 'name' => 'pseudo', 'value' => $pseudo, 'placeholder' => 'Entrez votre pseudo', 'text' => 'Entrez votre pseudo')); set_form('blog_single_reply_form', array('type' => 'text', 'name' => 'mail', 'value' => $email, 'placeholder' => 'Entrez votre email', 'text' => 'Entrez votre email')); set_form('blog_single_reply_form', array('type' => 'textarea', 'name' => 'content', 'placeholder' => 'Entrez votre commentaireE', 'text' => 'Entrez votre commentaire')); set_form('blog_single_reply_form', array('type' => 'submit', 'value' => 'Publier le commentaire')); } else { get_instance()->notice->push_notice(fetch_notice_output('connectToComment')); } } else { set_form('blog_single_reply_form', array('type' => 'text', 'name' => 'pseudo', 'value' => $pseudo, 'placeholder' => 'Entrez votre pseudo', 'text' => 'Entrez votre pseudo')); set_form('blog_single_reply_form', array('type' => 'text', 'name' => 'mail', 'value' => $email, 'placeholder' => 'Entrez votre email', 'text' => 'Entrez votre email')); set_form('blog_single_reply_form', array('type' => 'textarea', 'name' => 'content', 'placeholder' => 'Entrez votre commentaire', 'text' => 'Entrez votre commentaire')); set_form('blog_single_reply_form', array('type' => 'submit', 'value' => 'Publier le commentaire')); } // Affichage du single article $theme->blog_single();