From b1dae54aace9e553fdc48bac18d0685b127370fe Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Wed, 18 Jun 2025 12:34:56 +0300 Subject: [PATCH] Fixes templates loading in index --- public_html/index.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/public_html/index.php b/public_html/index.php index aa5da5c..4212279 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -39,6 +39,7 @@ $localConfigPath = str_replace(__DIR__ . '/..', '', $config_file); $app_root = $config['folder'] ?? '/'; // Preparing plugins and hooks +// Initialize HookDispatcher and plugin system require_once __DIR__ . '/../app/core/HookDispatcher.php'; require_once __DIR__ . '/../app/core/PluginManager.php'; use App\Core\HookDispatcher; @@ -153,8 +154,6 @@ $allowed_urls = [ // Let plugins filter/extend allowed_urls $allowed_urls = filter_allowed_urls($allowed_urls); -// Config and app_root are now set at the top of the file - // Dispatch routing and auth require_once __DIR__ . '/../app/core/Router.php'; use App\Core\Router; @@ -329,17 +328,17 @@ if ($page == 'logout') { } else { include '../app/templates/error-notfound.php'; } - include '../app/templates/page-footer.php'; + \App\Helpers\Theme::include('page-footer'); } } else { // The page is not in allowed URLs - include '../app/templates/page-header.php'; - include '../app/templates/page-menu.php'; + \App\Helpers\Theme::include('page-header'); + \App\Helpers\Theme::include('page-menu'); if ($validSession) { - include '../app/templates/page-sidebar.php'; + \App\Helpers\Theme::include('page-sidebar'); } include '../app/templates/error-notfound.php'; - include '../app/templates/page-footer.php'; + \App\Helpers\Theme::include('page-footer'); } }