aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/resources/private/headers/documenthead.php
diff options
context:
space:
mode:
authorGitea <gitea@fake.local>2021-11-10 17:53:50 +0100
committerGitea <gitea@fake.local>2021-11-10 17:53:50 +0100
commit8fabf77b2a7720a357c63817c07035a9908818a0 (patch)
treed689fcac1403e2473010fe80bc337599a78c21a4 /Neutron-trunk/resources/private/headers/documenthead.php
parent7b4af63a90a726b98a59b83e53f040a7a566a11d (diff)
downloadelectrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.gz
electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.bz2
electrode-8fabf77b2a7720a357c63817c07035a9908818a0.zip
Update
Diffstat (limited to 'Neutron-trunk/resources/private/headers/documenthead.php')
-rw-r--r--Neutron-trunk/resources/private/headers/documenthead.php139
1 files changed, 0 insertions, 139 deletions
diff --git a/Neutron-trunk/resources/private/headers/documenthead.php b/Neutron-trunk/resources/private/headers/documenthead.php
deleted file mode 100644
index a628016..0000000
--- a/Neutron-trunk/resources/private/headers/documenthead.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-
-global $_FNSN_DUMP_STARTDATE;
-$_FNSN_DUMP_STARTDATE = new DateTime("now");
-
-// Preloader, if enabled
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/semantic_resourcesPreload")) {
- echo('<link rel="preload" href="/resources/themes/colors/dark.js" as="script">');
- echo('<link rel="preload" href="/resources/themes/icons/classic.js" as="script">');
- echo('<link rel="preload" href="/resources/themes/icons/suru.js" as="script">');
- echo('<link rel="preload" href="/resources/js/right-click.js" as="script">');
- echo('<link rel="preload" href="/resources/js/jquery.js" as="script">');
- echo('<link rel="preload" href="/resources/lib/pushbar.js/library.js" as="script">');
- echo('<link rel="preload" href="/resources/lib/pushbar.js/library.css" as="style">');
- echo('<link rel="preload" href="/resources/css/ui.css" as="style">');
- echo('<link rel="preload" href="/resources/css/snowapi.css" as="style">');
- echo('<link rel="preload" href="/resources/css/setup.css" as="style">');
- echo('<link rel="preload" href="/resources/css/right-click.css" as="style">');
- echo('<link rel="preload" href="/resources/css/preview.css" as="style">');
- echo('<link rel="preload" href="/resources/css/main.css" as="style">');
- echo('<link rel="preload" href="/resources/css/index.php" as="style">');
- echo('<link rel="preload" href="/resources/css/error.css" as="style">');
- echo('<link rel="preload" href="/resources/css/admin.css" as="style">');
-}
-
-// This will run only if the website is ready
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent")) {
- // Custom settings parser
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json")) {
- if (dataValid(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json"))) {
- $customSettings = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json"));
- if (isset($customSettings->AfficherBoutonAdministration) && isset($customSettings->AdministrationBarreNavigation) && isset($customSettings->RessourcesPersonnalisées) && isset($customSettings->RessourcesPersonnalisées->CSS) && isset($customSettings->RessourcesPersonnalisées->JS) && isset($customSettings->PagesMasquées)) { // If it's using the old system, delete the file and generate a new one.
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json.bak", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json"));
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/csettings-base.json"));
- $continue = true;
- } else {
- $continue = true;
- }
- if ($continue) {
- if (isset($customSettings->showAdminButton) && isset($customSettings->customResources) && isset($customSettings->customResources->styles) && isset($customSettings->customResources->script) && isset($customSettings->hiddenPages)) {
- if (!$customSettings->showAdminButton) {
- echo("<style>#siteadmin-button{display:none;}</style>");
- }
- echo("<style type=\"text/css\">" . $customSettings->customResources->styles . "</style>");
- echo("<script type=\"text/javascript\">" . $customSettings->customResources->script . "</script>");
- } else {
- require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<h1>" . $lang["header"]["internalError"][0] . "</h1><p>" . $lang["header"]["internalError"][1] . "</p><p>" . $lang["header"]["internalError"][2] . "<code>/data/webcontent/customSettings.json</code>" . $lang["header"]["internalError"][3] . "</p><hr><i> " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/version") . " " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/codename") . "</i>");
- }
- }
- } else {
- require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<h1>" . $lang["header"]["internalError"][0] . "</h1><p>" . $lang["header"]["internalError"][4] . "</p><p>" . $lang["header"]["internalError"][2] . "<code>/data/webcontent/customSettings.json</code>" . $lang["header"]["internalError"][3] . "</p><hr><i> " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/version") . " " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/codename") . "</i>");
- }
- } else {
- file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/customSettings.json", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/csettings-base.json"));
- }
-}
-
-if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/upload/styles.css")) {
- echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/upload/styles.css">'); // Custom styles loader
-}
-echo('<script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/jquery.js"></script>'); // JQuery, used at almost all pages
-
-echo("<script>");
-require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/global.js._/index.php";
-echo("</script>"); // Global Scripts
-
-?>
-
-<script>
-
-String.prototype.replaceAll = function(search, replacement) {
- var target = this;
- return target.replace(new RegExp(search, 'g'), replacement);
-};
-
-roo_alert = false;
-
-function alert_full(text, refreshOnOk) {
- try {
- if (text == "ResizeObserver loop completed with undelivered notifications.") {
- return;
- }
- if (typeof refreshOnOk == "boolean") {
- roo_alert = refreshOnOk;
- }
- if (typeof text == "string") {
- document.querySelector('pjse-message').innerHTML = text.replaceAll(">", "&gt;").replaceAll("<", "&lt;").replaceAll("\n", "<br>")
- } else {
- document.querySelector('pjse-message').innerHTML = "<?= $lang["header"]["pjseDefault"][1] ?>"
- }
- $("pjse-placeholder").fadeIn(200)
- document.querySelector('body').childNodes.forEach((el) => {
- if (typeof el.classList != "undefined") {
- if (el.localName != "pjse-placeholder") {
- el.classList.add("pjse-blurry")
- }
- }
- })
- } catch (err) {
- alert("<?= $lang["header"]["errorError"] ?>");
- }
-}
-
-function alert(text, refreshOnOk) {
- if (typeof refreshOnOk == "boolean") {
- if (refreshOnOk == true) {
- console.warn("The refresh on OK feature isn't available on new errors, showing the legacy one");
- alert_full(text, refreshOnOk)
- return;
- }
- }
- var x = document.getElementById("snackbar");
-
- if (typeof text == "string") {
- x.innerHTML = text.replaceAll(">", "&gt;").replaceAll("<", "&lt;").replaceAll("\n", "<br>");
- } else {
- x.innerHTML = "<?= $lang["header"]["snackbarDefault"] ?>";
- }
-
- x.className = "snackbar_show";
-
- setTimeout(function(){ x.className = x.className.replace("show", ""); }, 5000);
-}
-
-function closeError() {
- $("pjse-placeholder").fadeOut(200)
- document.querySelector('body').childNodes.forEach((el) => {
- if (typeof el.classList != "undefined") {
- if (el.localName != "pjse-placeholder") {
- el.classList.remove("pjse-blurry")
- }
- }
- })
- if (roo_alert) {
- reloadPage()
- }
-}
-
-</script>