Do some maintenance with phpstorm
This commit is contained in:
@@ -1,39 +1,40 @@
|
||||
<?php
|
||||
|
||||
$template_dir = "templates/";
|
||||
require_once "lib/routing.php";
|
||||
|
||||
$diddoAjax = true;
|
||||
function render()
|
||||
{
|
||||
global $routerConfig;
|
||||
$diddoAjax = true;
|
||||
|
||||
switch($_POST["action"]){
|
||||
case "login":
|
||||
doLogin();
|
||||
break;
|
||||
case "register":
|
||||
doRegister();
|
||||
break;
|
||||
case "logout":
|
||||
doLogout();
|
||||
break;
|
||||
default:
|
||||
$diddoAjax = false;
|
||||
break;
|
||||
}
|
||||
switch ($_POST["action"]) {
|
||||
case "login":
|
||||
doLogin();
|
||||
break;
|
||||
case "register":
|
||||
doRegister();
|
||||
break;
|
||||
case "logout":
|
||||
doLogout();
|
||||
break;
|
||||
default:
|
||||
$diddoAjax = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if($diddoAjax){
|
||||
return; // dont use templates on ajax calls
|
||||
}
|
||||
if ($diddoAjax) {
|
||||
exit();
|
||||
}
|
||||
|
||||
ob_start();
|
||||
ob_start();
|
||||
|
||||
if ($_SESSION["ID"] > 0){
|
||||
$account_template = file_get_contents($template_dir . "account.html");
|
||||
echo $account_template;
|
||||
}
|
||||
else{
|
||||
$login_template = file_get_contents($template_dir . "login.html");
|
||||
echo $login_template;
|
||||
}
|
||||
if ($_SESSION["ID"] > 0) {
|
||||
$account_template = file_get_contents($routerConfig["template_dir"] . "account.html");
|
||||
echo $account_template;
|
||||
} else {
|
||||
$login_template = file_get_contents($routerConfig["template_dir"] . "login.html");
|
||||
echo $login_template;
|
||||
}
|
||||
|
||||
return ob_get_clean();
|
||||
|
||||
?>
|
||||
return ob_get_clean();
|
||||
}
|
Reference in New Issue
Block a user