Reorganize modules

feature/node-rewrite
Sven Slootweg 12 years ago
parent 154c8ed318
commit 0a04180e1b

@ -17,15 +17,15 @@ if(!empty($router->uParameters[2]))
{ {
if($router->uParameters[2] == "start") if($router->uParameters[2] == "start")
{ {
require("submodule.start.php"); require("modules/client/vps/action/start.php");
} }
elseif($router->uParameters[2] == "stop") elseif($router->uParameters[2] == "stop")
{ {
require("submodule.stop.php"); require("modules/client/vps/action/stop.php");
} }
elseif($router->uParameters[2] == "restart") elseif($router->uParameters[2] == "restart")
{ {
require("submodule.restart.php"); require("modules/client/vps/action/restart.php");
} }
} }

@ -55,153 +55,154 @@ try
$router->routes = array( $router->routes = array(
0 => array( 0 => array(
'^/?$' => "module.list.php", '^/?$' => "modules/client/vps/list.php",
'^/account/?$' => "module.account.php", '^/account/?$' => "modules/client/account/index.php",
'^/login/?$' => "module.login.php", '^/login/?$' => "modules/shared/login.php",
'^/logout/?$' => "module.logout.php", '^/logout/?$' => "modules/shared/logout.php",
/* Frontpage/overview */ /* Frontpage/overview */
'^/([0-9]+)/?$' => array( '^/([0-9]+)/?$' => array(
'target' => "module.vps.overview.php", 'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* TODO: Use action variable instead of relying on the path. */
/* VPS - Start */ /* VPS - Start */
'^/([0-9]+)/(start)/?$' => array( '^/([0-9]+)/(start)/?$' => array(
'target' => "module.vps.overview.php", 'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* VPS - Stop */ /* VPS - Stop */
'^/([0-9]+)/(stop)/?$' => array( '^/([0-9]+)/(stop)/?$' => array(
'target' => "module.vps.overview.php", 'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* VPS - Restart */ /* VPS - Restart */
'^/([0-9]+)/(restart)/?$' => array( '^/([0-9]+)/(restart)/?$' => array(
'target' => "module.vps.overview.php", 'target' => "modules/client/vps/lookup.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* VPS - Reinstall */ /* VPS - Reinstall */
'^/([0-9]+)/reinstall/?$' => array( '^/([0-9]+)/reinstall/?$' => array(
'target' => "module.vps.reinstall.php", 'target' => "modules/client/vps/reinstall.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* VPS - Change password */ /* VPS - Change password */
'^/([0-9]+)/password/?$' => array( '^/([0-9]+)/password/?$' => array(
'target' => "module.vps.password.php", 'target' => "modules/client/vps/password.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* VPS - Console */ /* VPS - Console */
'^/([0-9]+)/console/?$' => array( '^/([0-9]+)/console/?$' => array(
'target' => "module.vps.console.php", 'target' => "modules/client/vps/console.php",
'authenticator' => "authenticator.vps.php", 'authenticator' => "authenticators/vps.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "vps" '_menu' => "vps"
), ),
/* Admin - Overview */ /* Admin - Overview */
'^/admin/?$' => array( '^/admin/?$' => array(
'target' => "module.admin.overview.php", 'target' => "modules/admin/overview/index.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Users - Overview */ /* Admin - Users - Overview */
'^/admin/users/?$' => array( '^/admin/users/?$' => array(
'target' => "module.admin.users.php", 'target' => "modules/admin/user/list.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Users - Lookup */ /* Admin - Users - Lookup */
'^/admin/user/([0-9]+)/?$' => array( '^/admin/user/([0-9]+)/?$' => array(
'target' => "module.admin.user.php", 'target' => "modules/admin/user/lookup.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Users - Create VPS */ /* Admin - Users - Create VPS */
'^/admin/user/([0-9]+)/add/?$' => array( '^/admin/user/([0-9]+)/add/?$' => array(
'target' => "module.admin.containers.create.php", 'target' => "modules/admin/vps/create.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin", '_menu' => "admin",
'_prefilled_user' => true '_prefilled_user' => true
), ),
/* Admin - VPSes - Overview */ /* Admin - VPSes - Overview */
'^/admin/vpses/?$' => array( '^/admin/vpses/?$' => array(
'target' => "module.admin.containers.php", 'target' => "modules/admin/vps/list.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - VPSes - Create VPS */ /* Admin - VPSes - Create VPS */
'^/admin/vpses/add/?$' => array( '^/admin/vpses/add/?$' => array(
'target' => "module.admin.containers.create.php", 'target' => "modules/admin/vps/create.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - VPSes - Suspend */ /* Admin - VPSes - Suspend */
'^/admin/vps/([0-9]+)/suspend/?$' => array( '^/admin/vps/([0-9]+)/suspend/?$' => array(
'target' => "module.admin.container.suspend.php", 'target' => "modules/admin/vps/suspend.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - VPSes - Transfer */ /* Admin - VPSes - Transfer */
'^/admin/vps/([0-9]+)/transfer/?$' => array( '^/admin/vps/([0-9]+)/transfer/?$' => array(
'target' => "module.admin.container.transfer.php", 'target' => "modules/admin/vps/transfer.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - VPSes - Terminate */ /* Admin - VPSes - Terminate */
'^/admin/vps/([0-9]+)/terminate/?$' => array( '^/admin/vps/([0-9]+)/terminate/?$' => array(
'target' => "module.admin.container.terminate.php", 'target' => "modules/admin/vps/terminate.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Nodes - Overview */ /* Admin - Nodes - Overview */
'^/admin/nodes/?$' => array( '^/admin/nodes/?$' => array(
'target' => "module.admin.nodes.php", 'target' => "modules/admin/node/list.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Nodes - Lookup */ /* Admin - Nodes - Lookup */
'^/admin/node/([0-9]+)/?$' => array( '^/admin/node/([0-9]+)/?$' => array(
'target' => "module.admin.node.php", 'target' => "modules/admin/node/lookup.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Nodes - Add */ /* Admin - Nodes - Add */
'^/admin/nodes/add/?$' => array( '^/admin/nodes/add/?$' => array(
'target' => "module.admin.nodes.add.php", 'target' => "modules/admin/node/add.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin" '_menu' => "admin"
), ),
/* Admin - Nodes - Create VPS */ /* Admin - Nodes - Create VPS */
'^/admin/node/([0-9]+)/add/?$' => array( '^/admin/node/([0-9]+)/add/?$' => array(
'target' => "module.admin.containers.create.php", 'target' => "modules/admin/vps/create.php",
'authenticator' => "authenticator.admin.php", 'authenticator' => "authenticators/admin.php",
'auth_error' => "error.access.php", 'auth_error' => "modules/error/access.php",
'_menu' => "admin", '_menu' => "admin",
'_prefilled_node' => true '_prefilled_node' => true
), ),
'^/test/?$' => "module.test.php" '^/test/?$' => "modules/test.php"
) )
); );
@ -254,6 +255,7 @@ $sTemplateParameters = array_merge($sTemplateParameters, array(
'logged-in' => $sLoggedIn, 'logged-in' => $sLoggedIn,
'title' => $sPageTitle, 'title' => $sPageTitle,
'main' => $sMainContents, 'main' => $sMainContents,
/* TODO: Return a boolean instead and use this in the template. */
'main-class' => (isset($router->uVariables['menu']) && $router->sAuthenticated === true) ? "shift" : "", 'main-class' => (isset($router->uVariables['menu']) && $router->sAuthenticated === true) ? "shift" : "",
'generation' => "<!-- page generated in " . (round(microtime(true) - $timing_start, 6)) . " seconds. -->" 'generation' => "<!-- page generated in " . (round(microtime(true) - $timing_start, 6)) . " seconds. -->"
)); ));

Loading…
Cancel
Save