Implement new template path structure with theme support

feature/node-rewrite
Sven Slootweg 12 years ago
parent c716f98db6
commit 95d30302cc

@ -11,6 +11,8 @@
* licensing text.
*/
/* TODO: Switch to PDO here. */
$_CVM = true;
require("includes/include.base.php");

@ -23,8 +23,10 @@ try
}
catch (InsufficientAccessLevelException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-unauthorized-title'], $locale->strings['error-unauthorized-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-unauthorized-title'],
'message' => $locale->strings['error-unauthorized-text']
));
$sRouterAuthenticated = false;

@ -32,19 +32,23 @@ try
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['warning-suspended-title'], $locale->strings['warning-suspended-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/warning", $locale->strings, array(
'title' => $locale->strings['warning-suspended-title'],
'message' => $locale->strings['warning-suspended-text']
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['warning-terminated-title'], $locale->strings['warning-terminated-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/warning", $locale->strings, array(
'title' => $locale->strings['warning-terminated-title'],
'message' => $locale->strings['warning-terminated-text']
));
}
}
catch(NotFoundException $e)
{
$router->uVariables['display_menu'] = false;
$sMainContents = Templater::AdvancedParse("error.vps.notfound", $locale->strings, array());
$sMainContents = Templater::AdvancedParse("{$sTheme}/client/vps/error/notfound", $locale->strings, array());
$sRouterAuthenticated = false;
}
catch(UnauthorizedException $e)

@ -25,44 +25,59 @@ try
{
$sContainer->Suspend();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-suspend-success-title'], $locale->strings['error-suspend-success-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-suspend-success-title'],
'message' => $locale->strings['error-suspend-success-text']
));
}
elseif($_POST['action'] == "unsuspend")
{
$sContainer->Unsuspend();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-unsuspend-success-title'], $locale->strings['error-unsuspend-success-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-unsuspend-success-title'],
'message' => $locale->strings['error-unsuspend-success-text']
));
}
$sContainer->RefreshData();
/* TODO: Flash message and redirect to VPS lookup page. */
}
$sSuspended = ($sContainer->sStatus == CVM_STATUS_SUSPENDED) ? true : false;
$sPageContents = Templater::AdvancedParse("admin.container.suspend", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/vps/suspend", $locale->strings, array(
'id' => $sContainer->sId,
'suspended' => $sSuspended
));
}
catch (InsufficientAccessLevelException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-unauthorized-title'], $locale->strings['error-unauthorized-text']);
$sMainContents .= $err->Render();
/* TODO: Is this really necessary? */
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-unauthorized-title'],
'message' => $locale->strings['error-unauthorized-text']
));
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-notfound-title'], $locale->strings['error-notfound-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-notfound-title'],
'message' => $locale->strings['error-notfound-text']
));
}
catch (ContainerSuspendException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-suspend-error-title'], $locale->strings['error-suspend-error-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-suspend-error-title'],
'message' => $locale->strings['error-suspend-error-text']
));
}
catch (ContainerUnsuspendException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-unsuspend-error-title'], $locale->strings['error-unsuspend-error-text']);
$sMainContents .= $err->Render();
$sMainContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-unsuspend-error-title'],
'message' => $locale->strings['error-unsuspend-error-text']
));
}

@ -136,6 +136,8 @@ if(isset($_POST['submit']))
$sContainer->InsertIntoDatabase();
$sContainer->Deploy();
/* TODO: Flash message. */
redirect("/admin/node/{$node->sId}/");
}
}
@ -189,7 +191,7 @@ foreach($result->data as $row)
);
}
$sPageContents = Templater::AdvancedParse("admin.containers.add", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/vps/add", $locale->strings, array(
'errors' => $sErrors,
'nodes' => $sNodes,
'users' => $sUsers,

@ -37,6 +37,7 @@ if($result = mysql_query_cached("SELECT * FROM containers"))
}
}
$sPageContents = Templater::AdvancedParse("admin.containers", $locale->strings, array(
/* TODO: Change variable name to phase out the use of the term "container". */
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/vps/list", $locale->strings, array(
'containers' => $sContainerList
));

@ -39,7 +39,7 @@ try
}
}
$sPageContents = Templater::AdvancedParse("admin.node", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/node/lookup", $locale->strings, array(
'id' => $sNode->sId,
'hostname' => $sNode->sHostname,
'location' => $sNode->sPhysicalLocation,
@ -48,7 +48,9 @@ try
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-admin-node-title'], $locale->strings['error-admin-node-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-admin-node-title'],
'message' => $locale->strings['error-admin-node-text']
));
}

@ -83,6 +83,6 @@ if(isset($_POST['submit']))
}
}
$sPageContents = Templater::AdvancedParse("admin.nodes.add", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/node/add", $locale->strings, array(
'errors' => $sErrors
));

@ -29,6 +29,6 @@ if($result = mysql_query_cached("SELECT * FROM nodes"))
}
}
$sPageContents = Templater::AdvancedParse("admin.nodes", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/node/list", $locale->strings, array(
'nodes' => $sNodeList
));

@ -13,4 +13,4 @@
if(!isset($_CVM)) { die("Unauthorized."); }
$sPageContents = Templater::AdvancedParse("admin.overview", $locale->strings, array());
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/overview/index", $locale->strings, array());

@ -11,6 +11,8 @@
* licensing text.
*/
/* TODO: Add "create VPS" button. */
if(!isset($_CVM)) { die("Unauthorized."); }
try
@ -25,6 +27,8 @@ try
{
$sContainer = new Container($row);
/* TODO: Deal with unreachable servers (SshException). */
$sContainerList[] = array(
'id' => $sContainer->sId,
'hostname' => $sContainer->sHostname,
@ -41,7 +45,7 @@ try
}
}
$sPageContents = Templater::AdvancedParse("admin.user", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/user/lookup", $locale->strings, array(
'id' => $sUserEntry->sId,
'username' => $sUserEntry->sUsername,
'email' => $sUserEntry->sEmailAddress,
@ -52,7 +56,9 @@ try
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-admin-user-title'], $locale->strings['error-admin-user-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-admin-user-title'],
'message' => $locale->strings['error-admin-user-text']
));
}

@ -28,6 +28,6 @@ foreach($result->data as $row)
);
}
$sPageContents = Templater::AdvancedParse("admin.users", $locale->strings, array(
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/user/list", $locale->strings, array(
'users' => $sUserList
));

@ -47,7 +47,7 @@ if($sLoggedIn === true)
);
}
$sMainContents = Templater::AdvancedParse("list", $locale->strings, array(
$sMainContents = Templater::AdvancedParse("{$sTheme}/client/vps/list", $locale->strings, array(
'containers' => $sContainerList
));
}

@ -39,18 +39,22 @@ if(isset($_POST['submit']))
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-login-invalid-title'], $locale->strings['error-login-invalid-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-login-invalid-title'],
'message' => $locale->strings['error-login-invalid-text']
));
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-login-invalid-title'], $locale->strings['error-login-invalid-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-login-invalid-title'],
'message' => $locale->strings['error-login-invalid-text']
));
}
}
$sMainContents = Templater::AdvancedParse("login", $locale->strings, array(
$sMainContents = Templater::AdvancedParse("{$sTheme}/shared/login", $locale->strings, array(
'error' => $sError,
'field-username' => $sFieldUsername
));

@ -19,11 +19,15 @@ if($sLoggedIn === true)
$sUser = new User(0);
$sLoggedIn = false;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-logout-success-title'], $locale->strings['error-logout-success-text']);
$sMainContents .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-logout-success-title'],
'message' => $locale->strings['error-logout-success-text']
));
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-logout-notloggedin-title'], $locale->strings['error-logout-notloggedin-text']);
$sMainContents .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-logout-notloggedin-title'],
'message' => $locale->strings['error-logout-notloggedin-text']
));
}

@ -13,6 +13,8 @@
if(!isset($_CVM)) { die("Unauthorized."); }
$sPageContents .= Templater::AdvancedParse("vps.console", $locale->strings, array(
/* TODO: Specify user, password and port as variables. */
$sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/console", $locale->strings, array(
'host' => htmlspecialchars($_SERVER['SERVER_NAME'])
));

@ -95,5 +95,5 @@ catch (SshExitException $e)
}
$sPageContents = Templater::AdvancedParse("vps.overview", $locale->strings, $sVariables);
$sPageContents = Templater::AdvancedParse("{$sTheme}/client/vps/lookup", $locale->strings, $sVariables);

@ -25,44 +25,58 @@ if(isset($_POST['submit']))
{
$sContainer->SetRootPassword($_POST['password']);
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-password-success-title'], $locale->strings['error-password-success-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-password-success-title'],
'message' => $locale->strings['error-password-success-text']
));
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-nomatch-title'], $locale->strings['error-password-nomatch-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-password-nomatch-title'],
'message' => $locale->strings['error-password-nomatch-text']
));
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-missing-title'], $locale->strings['error-password-missing-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-password-missing-title'],
'message' => $locale->strings['error-password-missing-text']
));
}
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-suspended-title'], $locale->strings['error-password-suspended-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-password-suspended-title'],
'message' => $locale->strings['error-password-suspended-text']
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-terminated-title'], $locale->strings['error-password-terminated-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-password-terminated-title'],
'message' => $locale->strings['error-password-terminated-text']
));
}
catch (SshExitException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-invalid-title'], $locale->strings['error-password-invalid-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-password-invalid-title'],
'message' => $locale->strings['error-password-invalid-text']
));
}
}
if($display_form === true)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['warning-password-title'], $locale->strings['warning-password-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/warning", $locale->strings, array(
'title' => $locale->strings['warning-password-title'],
'message' => $locale->strings['warning-password-text']
));
$sPageContents .= Templater::AdvancedParse("vps.password", $locale->strings, array(
$sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/password", $locale->strings, array(
'id' => $sContainer->sId
));
}

@ -32,50 +32,69 @@ if(isset($_POST['submit']))
$sContainer->Reinstall();
$sContainer->Start();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-reinstall-success-title'], $locale->strings['error-reinstall-success-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-reinstall-success-title'],
'message' => $locale->strings['error-reinstall-success-text']
));
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-confirm-title'], $locale->strings['error-reinstall-confirm-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-confirm-title'],
'message' => $locale->strings['error-reinstall-confirm-text']
));
}
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-notfound-title'], $locale->strings['error-reinstall-notfound-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-notfound-title'],
'message' => $locale->strings['error-reinstall-notfound-text']
));
}
catch (TemplateUnavailableException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-unavailable-title'], $locale->strings['error-reinstall-unavailable-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-unavailable-title'],
'message' => $locale->strings['error-reinstall-unavailable-text']
));
}
catch (ContainerReinstallException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-failed-title'], $locale->strings['error-reinstall-failed-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-failed-title'],
'message' => $locale->strings['error-reinstall-failed-text']
));
}
catch (ContainerStartException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['error-reinstall-start-title'], $locale->strings['error-reinstall-start-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-start-title'],
'message' => $locale->strings['error-reinstall-start-text']
));
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-suspended-title'], $locale->strings['error-reinstall-suspended-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-suspended-title'],
'message' => $locale->strings['error-reinstall-suspended-text']
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-terminated-title'], $locale->strings['error-reinstall-terminated-text']);
$sPageContents .= $err->Render();
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-reinstall-terminated-title'],
'message' => $locale->strings['error-reinstall-terminated-text']
));
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "No template selected", "You did not select a template from the list. Please select a template and try again.");
$sPageContents .= $err->Render();
/* TODO: Grab text from locale file. */
$sPageContents .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => "No template selected",
'message' => "You did not select a template from the list. Please select a template and try again."
));
}
}
@ -95,7 +114,7 @@ if($display_form === true)
);
}
$sPageContents .= Templater::AdvancedParse("vps.reinstall", $locale->strings, array(
$sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/reinstall", $locale->strings, array(
'templates' => $sTemplateList
));
}

@ -16,6 +16,8 @@ $timing_start = microtime(true);
$_CVM = true;
require("includes/include.base.php");
$sTheme = "default";
$sTemplateParameters = array();
if(!empty($_SESSION['userid']))
@ -201,18 +203,24 @@ try
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container is suspended", $e->getMessage());
$sError .= $err->Render();
/* TODO: Grab error title from locale file? */
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => "Container is suspended",
'message' => $e->getMessage()
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container is terminated", $e->getMessage());
$sError .= $err->Render();
/* TODO: Grab error title from locale file? */
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => "Container is terminated",
'message' => $e->getMessage()
));
}
if($router->uVariables['menu'] == "vps" && $router->uVariables['display_menu'] === true)
{
$sMainContents .= Templater::AdvancedParse("main.vps", $locale->strings, array(
$sMainContents .= Templater::AdvancedParse("{$sTheme}/client/vps/main", $locale->strings, array(
'error' => $sError,
'contents' => $sPageContents,
'id' => $sContainer->sId
@ -220,7 +228,7 @@ try
}
elseif($router->uVariables['menu'] == "admin" && $router->uVariables['display_menu'] === true)
{
$sMainContents .= Templater::AdvancedParse("main.admin", $locale->strings, array(
$sMainContents .= Templater::AdvancedParse("{$sTheme}/admin/main", $locale->strings, array(
'error' => $sError,
'contents' => $sPageContents
));
@ -228,6 +236,7 @@ try
}
catch (UnauthorizedException $e)
{
/* TODO: Create a proper template for this. */
$sPageTitle = "Unauthorized";
$sMainContents = "You are not authorized to view this page.";
}
@ -240,4 +249,4 @@ $sTemplateParameters = array_merge($sTemplateParameters, array(
'generation' => "<!-- page generated in " . (round(microtime(true) - $timing_start, 6)) . " seconds. -->"
));
echo(Templater::AdvancedParse("main", $locale->strings, $sTemplateParameters));
echo(Templater::AdvancedParse("{$sTheme}/shared/main", $locale->strings, $sTemplateParameters));

@ -27,21 +27,29 @@ try
$sContainer->Start();
$sContainer->sCurrentStatus = CVM_STATUS_STARTED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-restart-success-title'], $locale->strings['error-restart-success-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-stop-restart-success'],
'message' => $locale->strings['error-stop-restart-success']
));
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-suspended-title'], $locale->strings['error-restart-suspended-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-restart-suspended-title'],
'message' => $locale->strings['error-restart-suspended-text']
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-terminated-title'], $locale->strings['error-restart-terminated-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-restart-terminated-title'],
'message' => $locale->strings['error-restart-terminated-text']
));
}
catch(ContainerStartException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-start-title'], $locale->strings['error-restart-start-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-restart-start-title'],
'message' => $locale->strings['error-restart-start-text']
));
}

@ -20,27 +20,37 @@ if($sContainer->sCurrentStatus != CVM_STATUS_STARTED)
$sContainer->Start();
$sContainer->sCurrentStatus = CVM_STATUS_STARTED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-start-success-title'], $locale->strings['error-start-success-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-start-success-title'],
'message' => $locale->strings['error-start-success-text']
));
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-suspended-title'], $locale->strings['error-start-suspended-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-start-suspended-title'],
'message' => $locale->strings['error-start-suspended-text']
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-terminated-title'], $locale->strings['error-start-terminated-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-start-terminated-title'],
'message' => $locale->strings['error-start-terminated-text']
));
}
catch (ContainerStartException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-failed-title'], $locale->strings['error-start-failed-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-start-failed-title'],
'message' => $locale->strings['error-start-failed-text']
));
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-running-title'], $locale->strings['error-start-running-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-start-running-title'],
'message' => $locale->strings['error-start-running-text']
));
}

@ -20,27 +20,37 @@ if($sContainer->sCurrentStatus != CVM_STATUS_STOPPED)
$sContainer->Stop();
$sContainer->sCurrentStatus = CVM_STATUS_STOPPED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-stop-success-title'], $locale->strings['error-stop-success-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/success", $locale->strings, array(
'title' => $locale->strings['error-stop-success-title'],
'message' => $locale->strings['error-stop-success-text']
));
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-stop-suspended-title'], $locale->strings['error-stop-suspended-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-stop-suspended-title'],
'message' => $locale->strings['error-stop-suspended-text']
));
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-stop-terminated-title'], $locale->strings['error-stop-terminated-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-stop-terminated-title'],
'message' => $locale->strings['error-stop-terminated-text']
));
}
catch(ContainerStopException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-stop-failed-title'], $locale->strings['error-stop-failed-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-stop-failed-title'],
'message' => $locale->strings['error-stop-failed-text']
));
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-stop-stopped-title'], $locale->strings['error-stop-stopped-text']);
$sError .= $err->Render();
$sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array(
'title' => $locale->strings['error-stop-stopped-title'],
'message' => $locale->strings['error-stop-stopped-text']
));
}

Loading…
Cancel
Save