Add templates.json and fix bugs

This commit is contained in:
admin committed 2026-10-02 07:11:57 +00:00
1 parent dd33901255
commit 7dffa95fed
7 files changed
+36 -4

No files matched your search

Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
+4 -2
View File
@@ -4,7 +4,7 @@ class HTMLLoader {
function __construct() { function __construct() {
// Check if Paths variables exists // Check if Paths variables exists
if (!defined(TEMPLATE_PATH) || !defined(TEMPLATE_CONF)) { if (!defined("TEMPLATE_PATH") || !defined("TEMPLATE_CONF")) {
die("TEMPLATE_PATH or TEMPLATE_CONF are not defined at " . __FILE__); die("TEMPLATE_PATH or TEMPLATE_CONF are not defined at " . __FILE__);
} }
} }
@@ -17,6 +17,8 @@ class HTMLLoader {
if (!array_key_exists($template, $json) && array_key_exists("error", $json)) { if (!array_key_exists($template, $json) && array_key_exists("error", $json)) {
$this->showError('Template "' . $template . '" was not found.'); $this->showError('Template "' . $template . '" was not found.');
} }else{
die("Error Template was not found.");
}
} }
} }
Regular → Executable
+4 -1
View File
@@ -1,7 +1,10 @@
<?php <?php
// Debug setting
$debug = true;
// Load GB Libary // Load GB Libary
require "main.php"; require "main.php";
// Init GB Class // Init GB Class
$gb = new gb(); $gb = new gb(true);
Regular → Executable
+8 -1
View File
@@ -1,6 +1,13 @@
<?php <?php
class gb { class gb {
function __construct() { function __construct($debug) {
// Debug
if ($debug) {
error_reporting(E_ALL);
ini_set("display_errors", 1);
ini_set("display_startup_errors", 1);
}
// Define Paths // Define Paths
define("APP_PATH", __DIR__ . "/.."); define("APP_PATH", __DIR__ . "/..");
define("FRONTEND_PATH", __DIR__ . "/"); define("FRONTEND_PATH", __DIR__ . "/");
+20
View File
@@ -0,0 +1,20 @@
{
"templates":[
{
"name":"error",
"dir_name":"error",
"html_file":"error.html",
"css_files":[
"error.css"
]
},
{
"name":"setup",
"dir_name":"setup",
"html_file":"setup.html",
"css_files":[
"setup.css"
]
}
]
}