diff --git a/source/webui/pages/admin/service.php b/source/webui/pages/admin/service.php index 204710d..b531a1e 100644 --- a/source/webui/pages/admin/service.php +++ b/source/webui/pages/admin/service.php @@ -58,6 +58,26 @@ if ($request->exists('do')) { } break; + case 'delete-site': { + $site_id = $request->get('site', 'Sihnon_Exception_InvalidParameters'); + + try { + $site = StatusBoard_Site::fromId($site_id); + $site->delete(); + + $messages[] = array( + 'severity' => 'success', + 'content' => 'The Site was deleted successfully.', + ); + } catch (Sihnon_Exception_ResultCountMismatch $e) { + $messages[] = array( + 'severity' => 'error', + 'content' => 'The Site was not deleted as the object requested could not be found.', + ); + } + + } break; + default: { $messages[] = array( 'severity' => 'warning', diff --git a/source/webui/templates/admin/service.tpl b/source/webui/templates/admin/service.tpl index 2e5d73e..c03727b 100644 --- a/source/webui/templates/admin/service.tpl +++ b/source/webui/templates/admin/service.tpl @@ -3,110 +3,126 @@
Use this form to update the existing Service
-Currently the following sites that are defined for the service {$service->name|escape:html}, Edit the site or delete it from the service here, to add a new one use the form below
-| Sites | -Description | -Action | - - - {if $sites} - {foreach from=$sites item=site} -
|---|---|---|
| - {$site->name|escape:html} - | -- {$site->description|escape:html} - | -- - | -
Use this form to define a new site to the service {$service->name|escape:html}
+Use this form to update the existing Service
Currently the following sites that are defined for the service {$service->name|escape:html}, Edit the site or delete it from the service here, to add a new one use the form below
+| Sites | +Description | +Action | + + + {foreach from=$sites item=site} +
|---|---|---|
| + {$site->name|escape:html} + | ++ {$site->description|escape:html} + | ++ + + | +
Use this form to define a new site to the service {$service->name|escape:html}
+