3 * Formset processing library
5 * @package phpMyAdmin-setup
6 * @author Piotr Przybylski <piotrprz@gmail.com>
7 * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0
12 * Processes forms registered in $form_display, handles error correction
14 * @param FormDisplay $form_display
16 function process_formset(FormDisplay
$form_display) {
17 if (filter_input(INPUT_GET
, 'mode') == 'revert') {
18 // revert erroneous fields to their default values
19 $form_display->fixErrors();
21 header('HTTP/1.1 303 See Other');
22 header('Location: index.php');
25 if (!$form_display->process(false)) {
26 // handle form view and failed POST
27 $form_display->display(true, true);
29 // check for form errors
30 if ($form_display->hasErrors()) {
31 // form has errors, show warning
32 $separator = PMA_get_arg_separator('html');
33 $page = filter_input(INPUT_GET
, 'page');
34 $formset = filter_input(INPUT_GET
, 'formset');
35 $formset = $formset ?
"{$separator}formset=$formset" : '';
36 $id = filter_input(INPUT_GET
, 'id', FILTER_VALIDATE_INT
);
37 if ($id === null && $page == 'servers') {
38 // we've just added a new server, get it's id
39 $id = ConfigFile
::getInstance()->getServerCount();
41 $id = $id ?
"{$separator}id=$id" : '';
44 <h4
><?php
echo $GLOBALS['strSetupWarning'] ?
></h4
>
45 <?php
echo PMA_lang('error_form') ?
><br
/>
46 <a href
="?page=<?php echo $page . $formset . $id . $separator ?>mode=revert"><?php
echo PMA_lang('RevertErroneousFields') ?
></a
>
48 <?php
$form_display->displayErrors() ?
>
49 <a
class="btn" href
="index.php"><?php
echo PMA_lang('IgnoreErrors') ?
></a
>
51 <a
class="btn" href
="?page=<?php echo $page . $formset . $id . $separator ?>mode=edit"><?php
echo PMA_lang('ShowForm') ?
></a
>
55 header('HTTP/1.1 303 See Other');
56 header('Location: index.php');