Add admin UI/Backend for adding sites
This commit is contained in:
@@ -43,10 +43,26 @@ if ($request->exists('do')) {
|
||||
$messages[] = 'No changes were necessary.';
|
||||
}
|
||||
|
||||
} break;
|
||||
} break;
|
||||
|
||||
default: {
|
||||
case 'add-site': {
|
||||
$name = StatusBoard_Main::issetelse($_POST['name'], 'Sihnon_Exception_InvalidParameters');
|
||||
$description = StatusBoard_Main::issetelse($_POST['description'], 'Sihnon_Exception_InvalidParameters');
|
||||
|
||||
$site = $service->newSite($name, $description);
|
||||
|
||||
$messages[] = array(
|
||||
'severity' => 'success',
|
||||
'content' => 'The site was created succesfully.',
|
||||
);
|
||||
|
||||
} break;
|
||||
|
||||
default: {
|
||||
$messages[] = array(
|
||||
'severity' => 'warning',
|
||||
'content' => "The activity '{$activity}' is not supported.",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,28 @@
|
||||
You haven't created any sites for this service yet. Create some with the button below.
|
||||
{/if}
|
||||
|
||||
<form id="admin_addsite" method="post" action="{$base_uri}admin/add-site/service/{$service->id}/">
|
||||
<input type="button" class="btn success" name="addsite" value="Add Site" />
|
||||
</form>
|
||||
<form id="admin_addsite" method="post" action="{$base_uri}admin/service/id/{$service->id}/do/add-site/">
|
||||
<fieldset>
|
||||
<legend>Add Site</legend>
|
||||
|
||||
<div class="clearfix">
|
||||
<label for="admin_site_add_name">Name</label>
|
||||
<div class="text">
|
||||
<input class="xlarge span5" id="admin_site_add_name" name="name" type="text" value="" />
|
||||
</div>
|
||||
</div><!-- /clearfix -->
|
||||
|
||||
<div class="clearfix">
|
||||
<label for="admin_site_add_description">Description</label>
|
||||
<div class="text">
|
||||
<textarea class="span12" id="admin_site_add_description" name="description"></textarea>
|
||||
</div>
|
||||
</div><!-- /clearfix -->
|
||||
|
||||
<div class="clearfix">
|
||||
<div class="input">
|
||||
<input type="submit" class="btn success" name="addsite" value="Add Site" />
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user