Reorganizes the pages loading in index.php
parent
318f5356c0
commit
172a545acf
|
@ -114,10 +114,8 @@ $firstPlatform = $platformsAll[0]['id'];
|
||||||
$platform_id = $_REQUEST['platform'] ?? $firstPlatform;
|
$platform_id = $_REQUEST['platform'] ?? $firstPlatform;
|
||||||
$platformDetails = $platformObject->getPlatformDetails($platform_id);
|
$platformDetails = $platformObject->getPlatformDetails($platform_id);
|
||||||
|
|
||||||
// page building
|
// logout is a special case, as we can't use session vars for notices
|
||||||
if (in_array($page, $allowed_urls)) {
|
if ($page == 'logout') {
|
||||||
// logout is a special case, as we can't use session vars for notices
|
|
||||||
if ($page == 'logout') {
|
|
||||||
|
|
||||||
// clean up session
|
// clean up session
|
||||||
session_unset();
|
session_unset();
|
||||||
|
@ -130,8 +128,12 @@ if (in_array($page, $allowed_urls)) {
|
||||||
include '../app/templates/block-message.php';
|
include '../app/templates/block-message.php';
|
||||||
include '../app/pages/login.php';
|
include '../app/pages/login.php';
|
||||||
|
|
||||||
// all other normal pages
|
} else {
|
||||||
} else {
|
|
||||||
|
// page building
|
||||||
|
if (in_array($page, $allowed_urls)) {
|
||||||
|
|
||||||
|
// all normal pages
|
||||||
include '../app/templates/page-header.php';
|
include '../app/templates/page-header.php';
|
||||||
include '../app/templates/page-menu.php';
|
include '../app/templates/page-menu.php';
|
||||||
include '../app/templates/block-message.php';
|
include '../app/templates/block-message.php';
|
||||||
|
@ -139,10 +141,10 @@ if (in_array($page, $allowed_urls)) {
|
||||||
include '../app/templates/page-sidebar.php';
|
include '../app/templates/page-sidebar.php';
|
||||||
}
|
}
|
||||||
include "../app/pages/{$page}.php";
|
include "../app/pages/{$page}.php";
|
||||||
}
|
|
||||||
|
|
||||||
// the page is not in allowed urls, loading front page
|
} else {
|
||||||
} else {
|
|
||||||
|
// the page is not in allowed urls, loading front page
|
||||||
$error = 'The page "' . $page . '" is not found';
|
$error = 'The page "' . $page . '" is not found';
|
||||||
include '../app/templates/page-header.php';
|
include '../app/templates/page-header.php';
|
||||||
include '../app/templates/page-menu.php';
|
include '../app/templates/page-menu.php';
|
||||||
|
@ -151,7 +153,9 @@ if (in_array($page, $allowed_urls)) {
|
||||||
include '../app/templates/page-sidebar.php';
|
include '../app/templates/page-sidebar.php';
|
||||||
}
|
}
|
||||||
include '../app/pages/front.php';
|
include '../app/pages/front.php';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// end with the footer
|
||||||
include '../app/templates/page-footer.php';
|
include '../app/templates/page-footer.php';
|
||||||
|
|
||||||
// flush the output buffer and show the page
|
// flush the output buffer and show the page
|
||||||
|
|
Loading…
Reference in New Issue