3 * Server create and edit view
5 * @package phpMyAdmin-setup
6 * @author Piotr Przybylski <piotrprz@gmail.com>
7 * @license http://www.gnu.org/licenses/gpl.html GNU GPL 2.0
11 if (!defined('PHPMYADMIN')) {
18 require_once './setup/lib/Form.class.php';
19 require_once './setup/lib/FormDisplay.class.php';
20 require_once './setup/lib/form_processing.lib.php';
22 $mode = filter_input(INPUT_GET
, 'mode');
23 $id = filter_input(INPUT_GET
, 'id', FILTER_VALIDATE_INT
);
25 $cf = ConfigFile
::getInstance();
26 $server_exists = !empty($id) && $cf->get("Servers/$id") !== null;
28 if ($mode == 'edit' && $server_exists) {
29 $page_title = $GLOBALS['strSetupServersEdit']
30 . ' ' . $id . ' <small>(' . $cf->getServerDSN($id) . ')</small>';
31 } elseif ($mode == 'remove' && $server_exists) {
32 $cf->removeServer($id);
33 header('Location: index.php');
35 } elseif ($mode == 'revert' && $server_exists) {
36 // handled by process_formset()
38 $page_title = $GLOBALS['strSetupServersAdd'];
42 <h2
><?php
echo $page_title ?
></h2
>
44 $form_display = new FormDisplay();
45 $form_display->registerForm('Server', $id);
46 $form_display->registerForm('Server_login_options', $id);
47 $form_display->registerForm('Server_config', $id);
48 $form_display->registerForm('Server_pmadb', $id);
49 process_formset($form_display);