remove todo, after upgrade PHPExcel
[phpmyadmin/arisferyanto.git] / setup / frames / servers.inc.php
blobe2a4e12aafa09fc5569acc3f2eb0983d57d543ca
1 <?php
2 /**
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
8 * @version $Id$
9 */
11 if (!defined('PHPMYADMIN')) {
12 exit;
15 /**
16 * Core libraries.
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');
34 exit;
35 } elseif ($mode == 'revert' && $server_exists) {
36 // handled by process_formset()
37 } else {
38 $page_title = $GLOBALS['strSetupServersAdd'];
39 $id = 0;
42 <h2><?php echo $page_title ?></h2>
43 <?php
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);