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 @@
  • Service {$service->name|escape:html}
  • - -
    -
    -
    -

    Service {$service->name|escape:html}

    -
    -
    -

    Edit Service

    -

    Use this form to update the existing Service

    -
    -
    -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    -
    -   -
    -
    -
    -
    -
    -
    - -
    -
    -

    Existing Sites

    -

    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

    -
    -
    - - - - - - - - {if $sites} - {foreach from=$sites item=site} - - - - - - {/foreach} - -
    SitesDescriptionAction
    - {$site->name|escape:html} - - {$site->description|escape:html} - - -
    - {else} - You haven't created any sites for this service yet. Create some with the button below. - {/if} +
    +
    +

    Service {$service->name|escape:html}

    -
    - -
    -
    -

    Add Site

    -

    Use this form to define a new site to the service {$service->name|escape:html}

    +
    +
    +
    +

    Edit Service

    +

    Use this form to update the existing Service

    -
    -
    -
    -
    - -
    - -
    -
    - -
    - -
    - -
    -
    - -
    -
    -   -
    -
    -
    -
    +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    -
    -
    - +
    +
    +   +
    +
    + + +
    +
    + +
    +
    +

    Existing Sites

    +

    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

    +
    +
    + {if $sites} + + + + + + + + {foreach from=$sites item=site} + + + + + + {/foreach} + +
    SitesDescriptionAction
    + {$site->name|escape:html} + + {$site->description|escape:html} + + + +
    + {else} + You haven't created any sites for this service yet. Create some with the button below. + {/if} + +
    +
    + +
    +
    +

    Add Site

    +

    Use this form to define a new site to the service {$service->name|escape:html}

    +
    +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    +
    +   +
    +
    +
    +
    +
    +
    + + \ No newline at end of file