From e4d1350569074b525696e3de2905db4e49c24eb1 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 17 Sep 2012 13:45:36 +0300 Subject: [PATCH] refactoring db section: new html formating --- web/add/db/index.php | 1 - web/edit/db/index.php | 1 - web/list/db/index.php | 8 - web/templates/admin/add_db.html | 262 ++++++++++++-------- web/templates/admin/edit_db.html | 181 +++++++++----- web/templates/admin/list_db.html | 331 +++++++++++++++----------- web/templates/admin/menu_add_db.html | 15 -- web/templates/admin/menu_db.html | 41 ---- web/templates/admin/menu_edit_db.html | 15 -- web/templates/user/list_db.html | 299 ++++++++++++++--------- web/templates/user/menu_db.html | 15 -- 11 files changed, 677 insertions(+), 492 deletions(-) delete mode 100644 web/templates/admin/menu_add_db.html delete mode 100644 web/templates/admin/menu_db.html delete mode 100644 web/templates/admin/menu_edit_db.html delete mode 100644 web/templates/user/menu_db.html diff --git a/web/add/db/index.php b/web/add/db/index.php index e45ad2418..e02509c3b 100644 --- a/web/add/db/index.php +++ b/web/add/db/index.php @@ -67,7 +67,6 @@ top_panel($user,$TAB); $db_types = json_decode(implode('', $output), true); unset($output); - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_db.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_db.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/edit/db/index.php b/web/edit/db/index.php index c05cb939b..d11b8cc51 100644 --- a/web/edit/db/index.php +++ b/web/edit/db/index.php @@ -68,7 +68,6 @@ top_panel($user,$TAB); } } - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_edit_db.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_db.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/list/db/index.php b/web/list/db/index.php index ac6a8c796..e60a37d55 100644 --- a/web/list/db/index.php +++ b/web/list/db/index.php @@ -13,24 +13,16 @@ top_panel($user,$TAB); // Data if ($_SESSION['user'] == 'admin') { - exec (VESTA_CMD."v_list_databases $user json", $output, $return_var); - check_error($return_var); $data = json_decode(implode('', $output), true); $data = array_reverse($data); unset($output); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_db.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_db.html'); } else { - exec (VESTA_CMD."v_list_databases $user json", $output, $return_var); - check_error($return_var); $data = json_decode(implode('', $output), true); $data = array_reverse($data); unset($output); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_db.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_db.html'); } diff --git a/web/templates/admin/add_db.html b/web/templates/admin/add_db.html index 909ecc89b..6c02d9d03 100644 --- a/web/templates/admin/add_db.html +++ b/web/templates/admin/add_db.html @@ -1,101 +1,167 @@ - + + + + + + + + +
+ - - - - - -
- - -
-
- - -
- - - - - - - - - - - - - -
Prefix "" will be automaticaly added to database name and database user
Database
Username
Password generate
Type
Charset
- - -
-
+ + + + + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Prefix "" will be automaticaly added to database name and database user +
+ Database +
+ + Username +
+ + Password generate +
+ +
+ Type +
+ +
+ Charset +
+ +
+ + +
+
+ diff --git a/web/templates/admin/edit_db.html b/web/templates/admin/edit_db.html index 87324b243..88ebbe9d1 100644 --- a/web/templates/admin/edit_db.html +++ b/web/templates/admin/edit_db.html @@ -1,58 +1,129 @@ - + + + + + + + + +
+ - - - - - -
- - - - -
-
- - -
- - - - - - - - - -
Database
Username
Password generate
Type
Host
Charset
- - -
-
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ Database +
+ + Username +
+ + Password generate +
+ + Type +
+ + Host +
+ + Charset +
+ + + +
+
+ diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index ab389066f..0b01da2d3 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -1,138 +1,201 @@ - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend' ; - } - if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin"; - if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/"; - if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin"; - if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/"; - ?> - - - - - - - - - -
- - - - - -
">
-
- - - - - - -
open edit - - "> -
" title="Confirmation"> -

Are you sure you want to database?

-
-
- - delete -
-

Are you sure you want to delete database?

-
-
- - - - - +
- - - +
[] database
Disk: -
+ + + + +
-
- - - -
User:
Host:
-
- - -
Charset:
-
- - +
+ + $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend' ; + } + if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin"; + if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/"; + if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin"; + if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/"; + ?> + + + + + + +
+ + + + +
">
+
+ + + + + + + + +
open edit + + "> +
" title="Confirmation"> +

Are you sure you want to database?

+
+
+ + delete +
+

Are you sure you want to delete database?

+
+
+ + + + + + + + + +
+ +
+ + + + + + + +
+ [] database +
Disk: +
+
+
+
+
+ + + + + + + + + +
+ User: + + +
+ Host: + + +
+
+ + + + + +
+ Charset: + + +
+
+
- - -"; ?> - - - - -
→ - -
-
-"; ?> -"; ?> -"; ?> + "; ?> + + + + + + +
+ +
+ + + "; ?> + "; ?> + "; ?> diff --git a/web/templates/admin/menu_add_db.html b/web/templates/admin/menu_add_db.html deleted file mode 100644 index e853e4a88..000000000 --- a/web/templates/admin/menu_add_db.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/admin/menu_db.html b/web/templates/admin/menu_db.html deleted file mode 100644 index cd9b335fd..000000000 --- a/web/templates/admin/menu_db.html +++ /dev/null @@ -1,41 +0,0 @@ - - -
-

.

-
- - - - - - - - - -
diff --git a/web/templates/admin/menu_edit_db.html b/web/templates/admin/menu_edit_db.html deleted file mode 100644 index bae76b42a..000000000 --- a/web/templates/admin/menu_edit_db.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/user/list_db.html b/web/templates/user/list_db.html index 0a389e375..0a2509b2d 100644 --- a/web/templates/user/list_db.html +++ b/web/templates/user/list_db.html @@ -1,113 +1,194 @@ - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend' ; - } - - - if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/"; - if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/"; - ?> - - - - - - - - - -
- - - - - -
">
-
- - - - - -
open web admin edit - - delete -
-

Are you sure you want to delete database?

-
-
- - - - - +
- - - +
[] database
Disk: -
+ + + + +
-
- - - -
User:
Host:
-
- - -
Charset:
-
- - + + + $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend' ; + } + if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin"; + if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/"; + if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin"; + if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/"; + ?> + + + + + + +
+ + + + +
">
+
+ + + + + + + +
open edit + + delete +
+

Are you sure you want to delete database?

+
+
+ + + + + + + + + +
+ +
+ + + + + + + +
+ [] database +
Disk: +
+
+
+
+
+ + + + + + + + + +
+ User: + + +
+ Host: + + +
+
+ + + + + +
+ Charset: + + +
+
+
- - -"; ?> - - - - -
→ - -
-
-"; ?> -"; ?> -"; ?> + "; ?> + + + + + + +
+ +
+ + + "; ?> + "; ?> + "; ?> diff --git a/web/templates/user/menu_db.html b/web/templates/user/menu_db.html deleted file mode 100644 index f7ce25661..000000000 --- a/web/templates/user/menu_db.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - -