From a1c8045d581c8cdb5006e4fb6dc5916236e9bc7e Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 20 Sep 2012 12:59:57 +0300 Subject: [PATCH] refactoring cron section: new html formating --- web/add/cron/index.php | 1 - web/list/cron/index.php | 8 - web/templates/admin/add_cron.html | 159 +++++++---- web/templates/admin/edit_cron.html | 162 +++++++---- web/templates/admin/list_cron.html | 359 ++++++++++++++---------- web/templates/admin/menu_add_cron.html | 15 - web/templates/admin/menu_cron.html | 41 --- web/templates/admin/menu_edit_cron.html | 15 - web/templates/user/list_cron.html | 310 ++++++++++++-------- web/templates/user/menu_cron.html | 15 - 10 files changed, 614 insertions(+), 471 deletions(-) delete mode 100644 web/templates/admin/menu_add_cron.html delete mode 100644 web/templates/admin/menu_cron.html delete mode 100644 web/templates/admin/menu_edit_cron.html delete mode 100644 web/templates/user/menu_cron.html diff --git a/web/add/cron/index.php b/web/add/cron/index.php index 7384a914..d0a1a1e3 100644 --- a/web/add/cron/index.php +++ b/web/add/cron/index.php @@ -68,7 +68,6 @@ top_panel($user,$TAB); $db_types = json_decode(implode('', $output), true); unset($output); - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_cron.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_cron.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/list/cron/index.php b/web/list/cron/index.php index 7f826a33..6d8a32ae 100644 --- a/web/list/cron/index.php +++ b/web/list/cron/index.php @@ -13,26 +13,18 @@ top_panel($user,$TAB); // Data if ($_SESSION['user'] == 'admin') { - exec (VESTA_CMD."v_list_cron_jobs $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_cron.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_cron.html'); } else { exec (VESTA_CMD."v_list_cron_jobs $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_cron.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_cron.html'); - } // Footer diff --git a/web/templates/admin/add_cron.html b/web/templates/admin/add_cron.html index ca1c760a..4d1ea2da 100644 --- a/web/templates/admin/add_cron.html +++ b/web/templates/admin/add_cron.html @@ -1,57 +1,106 @@ - + + + + + + + + - - - - - - -
- - -
-
- - -
- - - - - - - - - - - -
Minute
Hour
Day
Month
Day of Week
Command
>
- - -
-
+
+ + + + + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Minute +
+ + Hour +
+ + Day +
+ + Month +
+ + Day of Week +
+ + Command +
+ > +
+ + +
+
+
diff --git a/web/templates/admin/edit_cron.html b/web/templates/admin/edit_cron.html index 85b629b2..320cd4b1 100644 --- a/web/templates/admin/edit_cron.html +++ b/web/templates/admin/edit_cron.html @@ -1,59 +1,109 @@ - + + + + + + + + +
+ + + + + +
+ + + + +
+
+ + + + +
- - - - - -
- - - - -
-
- - -
- - - - - - - - - - - -
Minute
Hour
Day
Month
Day of Week
Command
>
- - -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Minute +
+ + Hour +
+ + Day +
+ + Month +
+ + Day of Week +
+ + Command +
+ > +
+ + +
+
+ diff --git a/web/templates/admin/list_cron.html b/web/templates/admin/list_cron.html index b83f1422..a0c60161 100644 --- a/web/templates/admin/list_cron.html +++ b/web/templates/admin/list_cron.html @@ -1,151 +1,220 @@ - - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend'; - } - - if (empty($data[$key]['CATCHALL'])) { - $data[$key]['CATCHALL'] = 'null'; - } - ?> - - - - - - - + +
- - - - - -
">
-
- - - - - - -
edit - - "> -
" title="Confirmation"> -

Are you sure you want to cron job?

-
-
- - delete -
-

Are you sure you want to delete cron job?

-
-
- - - - - +
- - - +
Min
+ + + + +
-
- - - -
Hour
-
- - - -
Day
-
- + $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend'; + } + ?> - - -
- - - -
Month
-
- - - -
Day of Week
-
- - + + + + + + + +
">
+ + + + + + + + + +
edit + + "> +
" title="Confirmation"> +

Are you sure you want to cron job?

+
+
+ + delete +
+

Are you sure you want to delete cron job?

+
+
+ + + + + + + + + + + +
+ +
+ + + + + + + +
+ Min +
+ +
+
+ + + + + + + +
+ Hour +
+ +
+
+ + + + + + + +
+ Day +
+ +
+
+ + + + + + + +
+ Month +
+ +
+
+ + + + + + + +
+ Day of Week +
+ +
+
+ + - - -"; ?> - - - - -
→ - -
- -"; ?> -"; ?> -"; ?> + + + + "; ?> + + + + + + +
+ +
+ + + "; ?> + "; ?> + "; ?> diff --git a/web/templates/admin/menu_add_cron.html b/web/templates/admin/menu_add_cron.html deleted file mode 100644 index e332401a..00000000 --- a/web/templates/admin/menu_add_cron.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/admin/menu_cron.html b/web/templates/admin/menu_cron.html deleted file mode 100644 index bc359fa5..00000000 --- a/web/templates/admin/menu_cron.html +++ /dev/null @@ -1,41 +0,0 @@ - - -
-

.

-
- - - - - - - - - -
diff --git a/web/templates/admin/menu_edit_cron.html b/web/templates/admin/menu_edit_cron.html deleted file mode 100644 index 78e1ad2a..00000000 --- a/web/templates/admin/menu_edit_cron.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/user/list_cron.html b/web/templates/user/list_cron.html index 515d357b..11ded7a3 100644 --- a/web/templates/user/list_cron.html +++ b/web/templates/user/list_cron.html @@ -1,126 +1,196 @@ - - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend'; - } - - if (empty($data[$key]['CATCHALL'])) { - $data[$key]['CATCHALL'] = 'null'; - } - ?> - - - - - - - + +
- - - - - -
">
-
- - - - - -
edit - - delete -
-

Are you sure you want to delete cron job?

-
-
- - - - - +
- - - +
Min
+ + + + +
-
- - - -
Hour
-
- - - -
Day
-
- + $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend'; + } + ?> - - -
- - - -
Month
-
- - - -
Day of Week
-
- - + + + + + + + +
">
+ + + + + + + + +
edit + + delete +
+

Are you sure you want to delete cron job?

+
+
+ + + + + + + + + + + +
+ +
+ + + + + + + +
+ Min +
+ +
+
+ + + + + + + +
+ Hour +
+ +
+
+ + + + + + + +
+ Day +
+ +
+
+ + + + + + + +
+ Month +
+ +
+
+ + + + + + + +
+ Day of Week +
+ +
+
+ + - - -"; ?> - - - - -
→ - -
-
-"; ?> -"; ?> -"; ?> + + + + "; ?> + + + + + + +
+ +
+ + + "; ?> + "; ?> + "; ?> diff --git a/web/templates/user/menu_cron.html b/web/templates/user/menu_cron.html deleted file mode 100644 index b16d2428..00000000 --- a/web/templates/user/menu_cron.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - -