23require_once __DIR__ .
'/../../root.php';
24require_once __DIR__ .
'/../../classes/actions/class.action.quickPick.php';
34header(
'X-Frame-Options: SAMEORIGIN');
35header(
'X-Content-Type-Options: nosniff');
36header(
'X-XSS-Protection: 1; mode=block');
37header(
'Referrer-Policy: strict-origin-when-cross-origin');
39 "Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' https://api.github.com https://bearsampp.com https://* http://*; img-src 'self' data: https:; font-src 'self' data:;"
70$getLoader =
'<span class = "loader float-end"><img src = "' .
$imagesPath .
'loader.gif" alt="spinner"></span>';
79echo htmlspecialchars($bearsamppLang->getValue(Lang::LOCALE), ENT_QUOTES, 'UTF-8') ?>">
82 <meta charset =
"utf-8">
83 <meta name =
"viewport" content =
"width=device-width, initial-scale=1.0">
84 <meta name =
"description" content =
"Localhost Dashboard">
85 <meta name =
"author" content =
"Bearsampp">
95 "/libs/bootstrap/css/bootstrap.min.css",
96 "/libs/fontawesome/css/all.min.css",
100 "/libs/bootstrap/js/bootstrap.bundle.min.js",
101 "/libs/fontawesome/js/all.min.js",
104 "/js/latestversion.js",
116 "/js/loading-cursor.js"
123 echo
'<link href="' .
$resourcesPath .
'/' . ltrim($file,
'/') .
'" rel="stylesheet">' . PHP_EOL;
128 echo $iconsPath . 'favicon.ico'; ?>" rel =
"icon" />
133 var AJAX_URL =
"<?php echo Path::getWebResourcesUrl(); ?>/ajax.php";
136 if (AJAX_URL.startsWith(
'http://localhost') || AJAX_URL.startsWith(
'https://localhost')) {
137 var pathParts = AJAX_URL.split(
'/');
138 var ajaxIndex = pathParts.findIndex(
function (p) {
139 return p.endsWith(
'.php');
142 AJAX_URL =
"/" + pathParts.slice(ajaxIndex - 1).join(
"/");
147 <!-- Inline script to
set loading cursor immediately -->
150 document.documentElement.classList.add(
'loading-cursor');
153 window.addEventListener(
'DOMContentLoaded',
function () {
155 window.addEventListener(
'load',
function () {
156 document.documentElement.classList.remove(
'loading-cursor');
159 const existingOverlay = document.querySelector(
'.loading-overlay');
160 if (existingOverlay) {
161 existingOverlay.parentNode.removeChild(existingOverlay);
169<nav
class = "navbar navbar-expand-md navbar-light bg-dark fixed-top
" role = "navigation
">
170 <div class = "container-fluid d-flex justify-content-between align-items-center
">
171 <div class = "d-inline-block
">
172 <a class = "navbar-brand
" href = "<?php
173 echo
HttpClient::getWebsiteUrl(); ?>" aria-label = 'Home'>
174 <img class = "p-1" alt = "<?php
175 echo APP_TITLE . ' ' . $bearsamppCore->getAppVersion(); ?>"
177 echo $imagesPath . 'header-logo.png'; ?>">
179 <button class = "navbar-toggler" type = "button" data-bs-toggle = "collapse" data-bs-target = "#navbarSupportedContent" aria-controls = "navbarSupportedContent"
180 aria-expanded = "false" aria-label = "Toggle navigation">
181 <span class = "navbar-toggler-icon"></span>
185 <div class = "d-flex align-items-center quickpick-menu-wrapper">
186 <div class = "collapse navbar-collapse icons" id = "navbarSupportedContent">
187 <div class = "d-flex flex-row flex-nowrap align-items-center mb-0 quickpick-menu">
188 <!-- Enhanced Mode Toggle and QuickPick Container -->
189 <div class = "quickpick-controls">
192 echo $quickPick->loadQuickpick($imagesPath);
195 error_log(
'Error loading QuickPick: ' . $e->getMessage());
196 echo
'<div id="quickPickError" class="text-center">
197 <span>QuickPick unavailable</span>
202 <!-- Social media icons wrapper -->
203 <div
class = "social-icons-wrapper d-none d-lg-flex align-items-center
">
204 <a data-bs-toggle = "tooltip
" data-bs-placement = "top
" data-bs-title = "<?php
207 <i class = 'fa-brands fa-discord'></i>
209 <a data-bs-toggle = "tooltip" data-bs-placement = "top" data-bs-title = "<?php
210 echo $bearsamppLang->getValue(Lang::FACEBOOK); ?>" target = "_blank"
211 href = "https://www.facebook.com/groups/bearsampp" aria-label = "Facebook">
212 <i class = "fa-brands fa-facebook"></i>
214 <a data-bs-toggle = "tooltip" data-bs-placement = "top" data-bs-title = "<?php
215 echo $bearsamppLang->getValue(Lang::GITHUB); ?>" target = "_blank"
217 echo HttpClient::getGithubUrl(); ?>" aria-label = "GitHub">
218 <i class = "fa-brands fa-github"></i>
220 <a data-bs-toggle = "tooltip" data-bs-placement = "top" data-bs-title = "<?php
221 echo $bearsamppLang->getValue(Lang::DONATE); ?>" target = "_blank"
223 echo HttpClient::getWebsiteUrl('donate'); ?>"><img class = "donate" src = "<?php
224 echo $imagesPath . 'donate.png'; ?>" alt = 'Donation Icon' />
233<div id = "page-wrapper">
236 include __DIR__ . '/tpls/hp.latestversion.html';
237 } catch (Exception $e) {
238 error_log('Error including latest version template: ' . $e->getMessage());
239 echo '<div class="alert alert-warning">Latest version information unavailable</div>';
246 $pagePath = __DIR__ .
'/tpls/' . $page .
'.html';
251 include __DIR__ .
'/tpls/hp.index.html';
253 }
catch (Exception $e) {
254 error_log(
'Error including page template: ' . $e->getMessage());
255 echo
'<div class="alert alert-warning">Page content unavailable</div>';
262 echo
'<script src="' .
$resourcesPath .
'/' . ltrim($file,
'/') .
'"></script>' . PHP_EOL;
static getWebResourcesPath()
global $bearsamppHomepage