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