diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:13 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:13 +0100 |
commit | 7b4af63a90a726b98a59b83e53f040a7a566a11d (patch) | |
tree | b85747947816fe4375e85ab6b822ffabec548c7b /Neutron-trunk/cms-special/admin | |
parent | 80f78c2925530e945503ab603e79d1acc53075f4 (diff) | |
download | electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.gz electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.bz2 electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.zip |
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin')
52 files changed, 70 insertions, 3354 deletions
diff --git a/Neutron-trunk/cms-special/admin/$resources/admin.js b/Neutron-trunk/cms-special/admin/$resources/admin.js index bca683b..bca683b 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/admin.js +++ b/Neutron-trunk/cms-special/admin/$resources/admin.js diff --git a/Neutron-trunk/cms-special/admin/$resources/common.css b/Neutron-trunk/cms-special/admin/$resources/common.css index 3826747..3826747 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/common.css +++ b/Neutron-trunk/cms-special/admin/$resources/common.css diff --git a/Neutron-trunk/cms-special/admin/$resources/header.php b/Neutron-trunk/cms-special/admin/$resources/header.php index e69de29..e69de29 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/header.php +++ b/Neutron-trunk/cms-special/admin/$resources/header.php diff --git a/Neutron-trunk/cms-special/admin/$resources/index-auto.css b/Neutron-trunk/cms-special/admin/$resources/index-auto.css index 773eab9..773eab9 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/index-auto.css +++ b/Neutron-trunk/cms-special/admin/$resources/index-auto.css diff --git a/Neutron-trunk/cms-special/admin/$resources/index-dark.css b/Neutron-trunk/cms-special/admin/$resources/index-dark.css index 1683192..1683192 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/index-dark.css +++ b/Neutron-trunk/cms-special/admin/$resources/index-dark.css diff --git a/Neutron-trunk/cms-special/admin/$resources/index.css b/Neutron-trunk/cms-special/admin/$resources/index.css index 57dd995..57dd995 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/index.css +++ b/Neutron-trunk/cms-special/admin/$resources/index.css diff --git a/Neutron-trunk/cms-special/admin/$resources/postcontent.php b/Neutron-trunk/cms-special/admin/$resources/postcontent.php index 573a1d9..cface57 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/postcontent.php +++ b/Neutron-trunk/cms-special/admin/$resources/postcontent.php @@ -3,4 +3,4 @@ </body> </html> -<script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/admin.js" charset="utf-8"></script>
\ No newline at end of file +<script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js" charset="utf-8"></script>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/$resources/precontent.php b/Neutron-trunk/cms-special/admin/$resources/precontent.php index b133975..e32c599 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/precontent.php +++ b/Neutron-trunk/cms-special/admin/$resources/precontent.php @@ -47,19 +47,19 @@ if (isset($lang["admin-titles"][$pageid])) { $invalid = false; -if (isset($_COOKIE['_NEUTRON_ADMIN_TOKEN']) && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != ".." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "/") { +if (isset($_COOKIE['_NEUTRON_ADMIN_TOKEN']) && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != ".." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "/" && strpos($_COOKIE['_NEUTRON_ADMIN_TOKEN'], "/") === false) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $_COOKIE['_NEUTRON_ADMIN_TOKEN'])) { } else { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin/?pr=" . str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']) . "&pa=" . urlencode("?" . explode("?", $_SERVER['REQUEST_URI'])[1]) . "'</script>"); + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin-v2/?pr=" . str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']) . "&pa=" . urlencode("?" . explode("?", $_SERVER['REQUEST_URI'])[1]) . "'</script>"); } } else { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin/?pr=" . str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']) . "&pa=" . urlencode("?" . explode("?", $_SERVER['REQUEST_URI'])[1]) . "'</script>"); + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin-v2/?pr=" . str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']) . "&pa=" . urlencode("?" . explode("?", $_SERVER['REQUEST_URI'])[1]) . "'</script>"); } if (isset($_POST['password'])) { if (password_verify($_POST['password'], file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/password"))) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin/home';</script>"); + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS["SYSTEM_ROOT"] . "/cms-special/admin-v2/home';</script>"); return; } else { $invalid = true; @@ -127,19 +127,19 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocesso <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css"> <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/codename.css"> <link rel="icon" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/siteicon.png"> - <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/admin.js"></script> + <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js"></script> <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/fonts-import.css" as="style"> <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/alerts.css" as="style"> <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css" as="style"> <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/common.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/index.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/responsive.css" as="style"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/index-dark.css" as="style"> + <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/common.css" as="style"> + <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/index.css" as="style"> + <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/responsive.css" as="style"> + <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/index-dark.css" as="style"> <link rel="preload" href="<?= $_MD_INCLUDES ?>/material-components-web.min.css" as="style"> <link rel="preload" href="<?= $_MDI_PATH ?>" as="style"> <link rel="preload" href="<?= $_MD_INCLUDES ?>/material-components-web.min.js" as="script"> - <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/admin.js" as="script"> + <link rel="preload" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$resources/admin.js" as="script"> <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documenthead.php"; ?> <?php @@ -149,17 +149,17 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocesso } if ($loadEditor) { - echo('<script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/ckeditor.js"></script><script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/translations/fr.js"></script><script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/translations/en.js"></script>'); + echo('<script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/ckeditor.js"></script><script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/ckeditor5/translations/fr.js"></script>'); } ?> <?php if (file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme") == "dark") { - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/$resources/index-dark.css">'); + echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin-v2/$resources/index-dark.css">'); } elseif (file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme") == "auto") { - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/$resources/index-auto.css">'); + echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin-v2/$resources/index-auto.css">'); } else { - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/$resources/index.css">'); + echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin-v2/$resources/index.css">'); } ?> <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.css"> @@ -199,8 +199,13 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocesso ?> </head> -<body id="settings" style="overflow-x:hidden;background-color: transparent !important;"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/spotlight.php"; ?> +<body id="settings" style="display:none;overflow-x:hidden;background-color: transparent !important;"> + <script> + window.addEventListener("load", () => { + $("#settings").fadeIn(75) + }) + </script> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/\$resources/spotlight.php"; ?> <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documentbody.php"; @@ -209,15 +214,14 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocesso $name = $pageConfig['headerName']; ?> - <div id="admin" style="background-color: transparent !important;"> + <div id="admin" style="margin-bottom:50px;margin-top:20px;background-color: transparent !important;"> <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/updates")) { - echo("<div id=\"updates-available\">" . $lang["admin-home"]["updates"][0] . " — <a href=\"/cms-special/admin/updates\">" . $lang["admin-home"]["updates"][1] . "</a></div>"); + echo("<div id=\"updates-available\">" . $lang["admin-home"]["updates"][0] . " — <a href=\"/cms-special/admin-v2/updates\">" . $lang["admin-home"]["updates"][1] . "</a></div>"); $updatable = true; } else { $updatable = false; } - ?> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/header.php"; ?>
\ No newline at end of file + ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/$resources/responsive.css b/Neutron-trunk/cms-special/admin/$resources/responsive.css index 75810b1..75810b1 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/responsive.css +++ b/Neutron-trunk/cms-special/admin/$resources/responsive.css diff --git a/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php b/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php index bffaa87..625f734 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php +++ b/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php @@ -9,6 +9,6 @@ <link rel="stylesheet" href="/resources/lib/material/iconfont.css"> </head> <body> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/spotlight.php"; ?> + <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/\$resources/spotlight.php"; ?> </body> </html>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/$resources/spotlight.php b/Neutron-trunk/cms-special/admin/$resources/spotlight.php index f803f52..2a09ed3 100755..100644 --- a/Neutron-trunk/cms-special/admin/$resources/spotlight.php +++ b/Neutron-trunk/cms-special/admin/$resources/spotlight.php @@ -4,7 +4,7 @@ <?php -$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/home/all/db.json")); +$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/home/all/db.json")); ?> <ul class="spotlight-elements"> diff --git a/Neutron-trunk/cms-special/admin/.htaccess b/Neutron-trunk/cms-special/admin/.htaccess index 90f6271..d53a146 100755..100644 --- a/Neutron-trunk/cms-special/admin/.htaccess +++ b/Neutron-trunk/cms-special/admin/.htaccess @@ -1,4 +1,4 @@ -ErrorDocument 404 "/cms-special/admin/error" -ErrorDocument 403 "/cms-special/admin/error" -ErrorDocument 401 "/cms-special/admin/error" -ErrorDocument 500 "/cms-special/admin/error"
\ No newline at end of file +ErrorDocument 404 "/cms-special/admin-v2/error" +ErrorDocument 403 "/cms-special/admin-v2/error" +ErrorDocument 401 "/cms-special/admin-v2/error" +ErrorDocument 500 "/cms-special/admin-v2/error"
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/about/index.php b/Neutron-trunk/cms-special/admin/about/index.php index 1551ff0..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/about/index.php +++ b/Neutron-trunk/cms-special/admin/about/index.php @@ -1,116 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Mise à jour et sécurité", "headerName" => "Mise à jour et sécurité" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <?php - - $currentVersionP = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/version"); - $currentVersion = $currentVersionP; - - ?> - <h3><?= $lang["admin-about"]["info"] ?></h3> - <ul><li> - <?php - - echo("" . $lang['admin-about']['version']['prefix'] . " <b>" . $currentVersionP . "</b>"); - echo("</li>"); - - $size = 0; - getData($_SERVER['DOCUMENT_ROOT']); - $sizestr = $size . " " . $lang["sizes"]["bytes"] . ""; - if ($size > 1024) { - if ($size > 1048576) { - if ($size > 1073741824) { - $sizestr = round($size / 1073741824, 3) . " " . $lang["sizes"]["gibibytes"] . ""; - } else { - $sizestr = round($size / 1048576, 3) . " " . $lang["sizes"]["mebibytes"] . ""; - } - } else { - $sizestr = round($size / 1024, 3) . " " . $lang["sizes"]["kibibytes"] . ""; - } - } else { - $sizestr = $size . " " . $lang["sizes"]["bytes"] . ""; - } - - echo("<li>" . $lang["admin-about"]["diskspace"][0] . " <b>" . $sizestr . "</b> " . $lang["admin-about"]["diskspace"][1] . "</li>"); - - ?> - </ul> - <h3><?= $lang["admin-about"]["disk"] ?></h3> - <div id="storagebar" value="0" max="1"></div> - <span style="margin-left: 10px;"></span> - <?php - - $globalSize = $size; - - $size = 0; - getData($_SERVER['DOCUMENT_ROOT'] . "/api"); - $mpcmsSize = $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/cms-special"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/widgets"); - $mpcmsSize = $mpcmsSize + $size; - - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/css"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/fonts"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/image"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/js"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/lib"); - $mpcmsSize = $mpcmsSize + $size; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/private"); - $mpcmsSize = $mpcmsSize + $size; - - $size = 0; - getData($_SERVER['DOCUMENT_ROOT'] . "/data"); - $dataSize = $size; - - $calSize = filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json"); - $confSize = filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename") + filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log") + filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widgets.json") + filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/password") + filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/footer"); - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widget-notes-data")) { - $confSize = $confSize + filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widget-notes-data"); - } - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widget-contact-data")) { - $confSize = $confSize + filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widget-contact-data"); - } - - $size = 0; - getData($_SERVER['DOCUMENT_ROOT'] . "/resources/upload"); - $resSize = $size; - - $globalSize = $resSize + $mpcmsSize + $confSize + $dataSize + $calSize; - - ?> - <div style="display:grid;grid-template-columns:1fr 1fr 1fr 1fr;"> - <span><span style="margin-right:5px;border-radius:999px;vertical-align:middle;background-color:#8bcf69;position:relative;width:15px;height:15px;display:inline-block;"></span><span style="margin-right:30px;"><?= $lang["admin-about"]["categories"]['system'] ?> (<?= round(($mpcmsSize*100)/$globalSize, 2) ?>%)</span></span> - <span><span style="margin-right:5px;border-radius:999px;vertical-align:middle;background-color:#e6d450;position:relative;width:15px;height:15px;display:inline-block;"></span><span style="margin-right:30px;"><?= $lang["admin-about"]["categories"]['config'] ?> (<?= round(($dataSize*100)/$globalSize, 2) ?>%)</span></span> - <span><span style="margin-right:5px;border-radius:999px;vertical-align:middle;background-color:#cf82bf;position:relative;width:15px;height:15px;display:inline-block;"></span><span style="margin-right:30px;"><?= $lang["admin-about"]["categories"]['resources'] ?> (<?= round(($resSize*100)/$globalSize, 2) ?>%)</span></span> - <span><span style="margin-right:5px;border-radius:999px;vertical-align:middle;background-color:gray;position:relative;width:15px;height:15px;display:inline-block;"></span><span style="margin-right:30px;"><?= $lang["admin-about"]["categories"]['misc'] ?></span></span> - </div> - <!-- <?= $globalSize - ($mpcmsSize + $dataSize + $resSize) ?> - <?= "<br>" ?> - <?= (($mpcmsSize + $dataSize + $resSize) * 100)/$globalSize ?> --> - <style> - #storagebar { - height: 12px; - width: calc(100% - 16px); - margin: 8px; - border-radius: 5px; - box-shadow: 0 5px 5px -5px #999 inset; - background-image: linear-gradient( - 90deg, - #8bcf69 <?= round(($mpcmsSize*100)/$globalSize, 2) ?>%, - #e6d450 <?= round(($mpcmsSize*100)/$globalSize, 2) ?>%, - #e6d450 <?= round(($dataSize*100)/$globalSize, 2) ?>%, - #cf82bf <?= round(($dataSize*100)/$globalSize, 2) ?>%, - #cf82bf <?= round(($resSize*100)/$globalSize, 2) ?>%, - gray <?= round(($resSize*100)/$globalSize, 2) ?>%, - gray 100% - ); - background-size: 100% 100%; - } - </style> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/advanced/index.php b/Neutron-trunk/cms-special/admin/advanced/index.php index ae80b96..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/advanced/index.php +++ b/Neutron-trunk/cms-special/admin/advanced/index.php @@ -1,8 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Options avancées", "headerName" => "Options avancées" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <ul> - <li> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/advanced/jsonconf" title="<?= $lang["admin-advanced-home"]["placeholders"]['dev'] ?>" class="sblink"><?= $lang["admin-advanced-home"]["dev"] ?></a> - </li> - </ul> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php b/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php index f087b1c..8387b16 100755..100644 --- a/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php +++ b/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php @@ -1,59 +1 @@ -<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Préférences de développement - Options avancées", "headerName" => "Préférences de développement" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <p><table class="message_warning"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_warning.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-advanced-dev"]["warning"] ?></p><p><?= $lang["admin-advanced-dev"]["remove"][0] ?> <code>/data/webcontent/customSettings.json</code>. <?= $lang["admin-advanced-dev"]["remove"][1] ?></p></td></tr></tbody></table></p> - <div id="editing"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/CodeEditor$3.php" ?> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - window.onbeforeunload = function (e) { - e = e || window.event; - - // For IE and Firefox prior to version 4 - if (e) { - e.returnValue = "Quit?"; - } - - // For Safari - return "Quit?"; - }; -</script> - -<script> - -function pushSettings() { - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("content", ace.edit("editor").getValue()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/save_advanced.php", - success: function (data) { - if (data == "ok") { - window.onbeforeunload = undefined; - location.href = "/cms-special/admin/home"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/appearance/index.php b/Neutron-trunk/cms-special/admin/appearance/index.php index 22c5065..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/appearance/index.php +++ b/Neutron-trunk/cms-special/admin/appearance/index.php @@ -1,253 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $loadEditor = false;$pageConfig = [ "domName" => "Apparence", "headerName" => "Apparence" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <span id="appearance-error-box" class="hide"><div id="error"><span id="appearance-error"><?= $lang["admin-appearance"]["error"] ?></span></div></span> - <div id="appearance-settings" style="text-align: center;"> - <?= $lang["admin-appearance"]["site"] ?> <input onchange="validateName()" onkeyup="validateName()" onkeydown="validateName()" type="text" id="name-field" placeholder="Nom du site" value="<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename") ?>"><br> - <p id="04-name-tip" class="tip-red"><?= $lang["admin-appearance"]["name"][0] ?></p> - <input type="file" id="icon-file" class="hide"> - <p><img id="icon-img" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_file_replace.svg" onclick="Icon_UploadFile()" class="icon_button"><br><small><?= $lang["admin-appearance"]["icon"] ?></small></p> - <input type="file" id="banner-file" class="hide"> - <p><img id="icon-img" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_file_replace.svg" onclick="Banner_UploadFile()" class="icon_button"><br><small><?= $lang["admin-appearance"]["banner"] ?></small></p> - <div style="display:none;"><p> - <input type="checkbox" id="oldrenderer" <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/oldRenderer")) {echo("checked");$oldr=true;} else {$oldr=false;} ?> onchange="toggleRender();"><label for="oldrenderer"><?= $lang["admin-appearance"]["old"] ?></label> - </p> - <p id="<?= $oldr ? "" : "onlyold" ?>" class="oldopts"><small id="oo-disclaimer" <?= $oldr ? "style=\"display:none;\"" : "" ?>><?= $lang["admin-appearance"]["oldopts"] ?></small><br><?= $lang["admin-appearance"]["pages"][0] ?> - <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagesInMenuBar")) { $pimb = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagesInMenuBar") + 1 - 1; } else { $pimb = 4; } ?> - <select id="showpages" <?= !$oldr ? "disabled" : "" ?>> - <option value="1"<?= $pimb == 1 ? " selected" : "" ?>>1</option> - <option value="2"<?= $pimb == 2 ? " selected" : "" ?>>2</option> - <option value="3"<?= $pimb == 3 ? " selected" : "" ?>>3</option> - <option value="4"<?= $pimb == 4 ? " selected" : "" ?>>4</option> - <option value="5"<?= $pimb == 5 ? " selected" : "" ?>>5</option> - <option value="6"<?= $pimb == 6 ? " selected" : "" ?>>6</option> - <option value="7"<?= $pimb == 7 ? " selected" : "" ?>>7</option> - <option value="8"<?= $pimb == 8 ? " selected" : "" ?>>8</option> - <option value="9"<?= $pimb == 9 ? " selected" : "" ?>>9</option> - <option value="10"<?= $pimb == 10 ? " selected" : "" ?>>10</option> - </select> - <?= $lang["admin-appearance"]["pages"][1] ?><br> - <input type="checkbox" id="alwaysmenu" <?= !$oldr ? "disabled" : "" ?> <?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/alwaysmenu")) {echo("checked");} ?>><label for="alwaysmenu"><?= $lang["admin-appearance"]["alwaysmenu"] ?></label></p></div> - <br> - <a onclick="submitData()" class="button"><?= $lang["admin-appearance"]["save"] ?></a> - </div> - <div style="text-align: center;"><div id="appearance-loader" class="hide"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div></div> - <h2><?= $lang["admin-appearance"]["footer"] ?></h2> - <span id="footer-error-box" class="hide"><div id="error"><span id="footer-error"><?= $lang["admin-appearance"]["error"] ?></span></div></span> - <div id="footer-settings"><div style="text-align: center;"> - <div style="text-align: center;"><?= $lang["admin-appearance"]["fdesc"] ?></div> - <div name="content" id="fedit"> - <?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/footer") ?> - </div><br> - <a onclick="updateFooter()" class="button"><?= $lang["admin-appearance"]["publish"] ?></a> - <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/ckeditor5/ckeditor.js"></script><script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/ckeditor5/translations/<?= $langsel ?>.js"></script> - <script> - let editor; - ClassicEditor - .create( document.querySelector( '#fedit' ), { - language: { - ui: '<?= $langsel ?>', - content: '<?= $langsel ?>' - }, - toolbar: [ - 'heading', '|', 'bold', 'italic', 'link', '|', 'mediaembed', 'blockquote', 'inserttable', '|', 'bulletedList', 'numberedList', '|', 'undo', 'redo' - ] - } ) - .then( newEditor => { - editor = newEditor; - } ) - .catch( error => { - console.error( error ); - } ); - </script></div> - <p><table class="message_info"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_info.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-appearance"]["fdisc"][0] ?></p><p><?= $lang["admin-appearance"]["fdisc"][1] ?></p></td></tr></tbody></table></p> - </div> - <div style="text-align: center;"><div id="footer-loader" class="hide"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div></div> - <h2><?= $lang["admin-appearance"]["password"] ?></h2> - <span id="password-error-box" class="hide"><div id="error"><span id="password-error"><?= $lang["admin-appearance"]["error"] ?></span></div></span> - <div id="password-settings" style="text-align: center;"> - <p><?= $lang["admin-appearance"]["oldpass"] ?> <input type="password" id="old-password" placeholder="<?= $lang["admin-appearance"]["secure"] ?>"></p> - <p><?= $lang["admin-appearance"]["newpass"] ?> <input type="password" id="new-password" placeholder="<?= $lang["admin-appearance"]["secure"] ?>"></p> - <p><?= $lang["admin-appearance"]["passrep"] ?> <input type="password" id="repeat-password" placeholder="<?= $lang["admin-appearance"]["secure"] ?>"></p> - <a onclick="changePassword()" class="button"><?= $lang["admin-appearance"]["change"] ?></a> - </div> - <div style="text-align: center;"><div id="password-loader" class="hide"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function validateName() { - document.getElementById('04-name-tip').classList.remove('tip-orange') - document.getElementById('04-name-tip').classList.remove('tip-green') - document.getElementById('04-name-tip').classList.remove('tip-red') - document.getElementById('04-name-tip').innerHTML = "..."; - setTimeout(() => { - name = document.getElementById('name-field').value - if (name.trim() == "") { - document.getElementById('04-name-tip').classList.add('tip-red') - document.getElementById('04-name-tip').innerHTML = "<?= $lang["admin-appearance"]["name"][0] ?>"; - return; - } - if (name.includes("<") || name.includes(">") || name.includes("#") || name.includes("@") || name.includes("}") || name.includes("{") || name.includes("|")) { - document.getElementById('04-name-tip').classList.add('tip-red') - document.getElementById('04-name-tip').innerHTML = "<?= $lang["admin-appearance"]["name"][1] ?>"; - return; - } - if (name.length > 75) { - document.getElementById('04-name-tip').classList.add('tip-red') - document.getElementById('04-name-tip').innerHTML = "<?= $lang["admin-appearance"]["name"][2] ?>"; - return; - } - if (name.length < 4) { - document.getElementById('04-name-tip').classList.add('tip-orange') - document.getElementById('04-name-tip').innerHTML = "<?= $lang["admin-appearance"]["name"][3] ?>"; - return; - } - if (name.length > 30) { - document.getElementById('04-name-tip').classList.add('tip-orange') - document.getElementById('04-name-tip').innerHTML = "<?= $lang["admin-appearance"]["name"][4] ?>"; - return; - } - document.getElementById('04-name-tip').classList.add('tip-green') - document.getElementById('04-name-tip').innerHTML = "<?= $lang["admin-appearance"]["name"][5] ?>"; - return; - }, 100) -} - -function Icon_UploadFile() { - $("#icon-file").trigger('click'); -} - -function Banner_UploadFile() { - $("#banner-file").trigger('click'); -} - -function toggleRender() { - if (!document.getElementById('oldrenderer').checked) { - document.getElementsByClassName('oldopts')[0].id = "onlyold"; - $('#oo-disclaimer').show(200); - document.getElementById('showpages').disabled = true; - document.getElementById('alwaysmenu').disabled = true; - } else { - document.getElementsByClassName('oldopts')[0].id = ""; - $('#oo-disclaimer').hide(200); - document.getElementById('showpages').disabled = false; - document.getElementById('alwaysmenu').disabled = false; - } -} - -function submitData() { - document.getElementById('appearance-loader').classList.remove('hide') - document.getElementById('appearance-settings').classList.add('hide') - var formData = new FormData(); - if (document.getElementById('icon-file').value.trim() != "") { - formData.append("icon", document.getElementById('icon-file').files[0], document.getElementById('icon-file').files[0].name); - } - if (document.getElementById('banner-file').value.trim() != "") { - formData.append("banner", document.getElementById('banner-file').files[0], document.getElementById('banner-file').files[0].name); - } - formData.append("sitename", document.getElementById('name-field').value); - formData.append("alwaysmenu", document.getElementById('alwaysmenu').checked.toString()); - formData.append("oldrenderer", document.getElementById('oldrenderer').checked.toString()); - formData.append("showpages", document.getElementById('showpages').value); - document.getElementById('appearance-error-box').classList.add("hide") - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/appearance.php", - success: function (data) { - if (data == "ok") { - reloadPage() - } else { - document.getElementById('appearance-error').innerHTML = data - document.getElementById('appearance-error-box').classList.remove("hide") - document.getElementById('appearance-loader').classList.add('hide') - document.getElementById('appearance-settings').classList.remove('hide') - } - }, - error: function (error) { - document.getElementById('password-error').innerHTML = "<?= $lang["admin-errors"]["connerror"] ?>" - document.getElementById('password-error-box').classList.remove("hide") - document.getElementById('password-loader').classList.add('hide') - document.getElementById('password-settings').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function changePassword() { - document.getElementById('password-loader').classList.remove('hide') - document.getElementById('password-settings').classList.add('hide') - var formData = new FormData(); - formData.append("oldpass", document.getElementById('old-password').value); - formData.append("newpass", document.getElementById('new-password').value); - formData.append("newpassr", document.getElementById('repeat-password').value); - document.getElementById('password-error-box').classList.add("hide") - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/password.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/login"; - } else { - document.getElementById('password-error').innerHTML = data - document.getElementById('password-error-box').classList.remove("hide") - document.getElementById('password-loader').classList.add('hide') - document.getElementById('password-settings').classList.remove('hide') - } - }, - error: function (error) { - document.getElementById('password-error').innerHTML = "<?= $lang["admin-errors"]["connerror"] ?>" - document.getElementById('password-error-box').classList.remove("hide") - document.getElementById('password-loader').classList.add('hide') - document.getElementById('password-settings').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updateFooter() { - document.getElementById('footer-loader').classList.remove('hide') - document.getElementById('footer-settings').classList.add('hide') - var formData = new FormData(); - formData.append("footer", editor.getData()); - document.getElementById('footer-error-box').classList.add("hide") - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/footer.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/appearance"; - } else { - document.getElementById('footer-error').innerHTML = data - document.getElementById('footer-error-box').classList.remove("hide") - document.getElementById('footer-loader').classList.add('hide') - document.getElementById('footer-settings').classList.remove('hide') - } - }, - error: function (error) { - document.getElementById('footer-error').innerHTML = "<?= $lang["admin-errors"]["connerror"] ?>" - document.getElementById('footer-error-box').classList.remove("hide") - document.getElementById('footer-loader').classList.add('hide') - document.getElementById('footer-settings').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -validateName() - -document.getElementById('banner-file').value = "" -document.getElementById('icon-file').value = "" - -</script>
\ No newline at end of file +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/calendar/add/index.php b/Neutron-trunk/cms-special/admin/calendar/add/index.php index 1029788..8387b16 100755..100644 --- a/Neutron-trunk/cms-special/admin/calendar/add/index.php +++ b/Neutron-trunk/cms-special/admin/calendar/add/index.php @@ -1,140 +1 @@ -<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Ajouter un événement - Calendrier", "headerName" => "Ajouter un événement" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="datainput"> - <h3><?= $lang["admin-calendar"]["create"]["date"] ?></h3> - <ul> - <li><?= $lang["admin-calendar"]["create"]["day"] ?> </li> - <select id="day"> - <option value="01" <?php if ("01" == date('d')) {echo("selected");} ?>>1er</option> - <option value="02" <?php if ("02" == date('d')) {echo("selected");} ?>>2</option> - <option value="03" <?php if ("03" == date('d')) {echo("selected");} ?>>3</option> - <option value="04" <?php if ("04" == date('d')) {echo("selected");} ?>>4</option> - <option value="05" <?php if ("05" == date('d')) {echo("selected");} ?>>5</option> - <option value="06" <?php if ("06" == date('d')) {echo("selected");} ?>>6</option> - <option value="07" <?php if ("07" == date('d')) {echo("selected");} ?>>7</option> - <option value="08" <?php if ("08" == date('d')) {echo("selected");} ?>>8</option> - <option value="09" <?php if ("09" == date('d')) {echo("selected");} ?>>9</option> - <option value="10" <?php if ("10" == date('d')) {echo("selected");} ?>>10</option> - <option value="11" <?php if ("11" == date('d')) {echo("selected");} ?>>11</option> - <option value="12" <?php if ("12" == date('d')) {echo("selected");} ?>>12</option> - <option value="13" <?php if ("13" == date('d')) {echo("selected");} ?>>13</option> - <option value="14" <?php if ("14" == date('d')) {echo("selected");} ?>>14</option> - <option value="15" <?php if ("15" == date('d')) {echo("selected");} ?>>15</option> - <option value="16" <?php if ("16" == date('d')) {echo("selected");} ?>>16</option> - <option value="17" <?php if ("17" == date('d')) {echo("selected");} ?>>17</option> - <option value="18" <?php if ("18" == date('d')) {echo("selected");} ?>>18</option> - <option value="19" <?php if ("19" == date('d')) {echo("selected");} ?>>19</option> - <option value="20" <?php if ("20" == date('d')) {echo("selected");} ?>>20</option> - <option value="21" <?php if ("21" == date('d')) {echo("selected");} ?>>21</option> - <option value="22" <?php if ("22" == date('d')) {echo("selected");} ?>>22</option> - <option value="23" <?php if ("23" == date('d')) {echo("selected");} ?>>23</option> - <option value="24" <?php if ("24" == date('d')) {echo("selected");} ?>>24</option> - <option value="25" <?php if ("25" == date('d')) {echo("selected");} ?>>25</option> - <option value="26" <?php if ("26" == date('d')) {echo("selected");} ?>>26</option> - <option value="27" <?php if ("27" == date('d')) {echo("selected");} ?>>27</option> - <option value="28" <?php if ("28" == date('d')) {echo("selected");} ?>>28</option> - <option value="29" <?php if ("29" == date('d')) {echo("selected");} ?>>29</option> - <option value="30" <?php if ("30" == date('d')) {echo("selected");} ?>>30</option> - <option value="31" <?php if ("31" == date('d')) {echo("selected");} ?>>31</option> - </select><br><br> - <li><?= $lang["admin-calendar"]["create"]["month"] ?> </li> - <select id="month"> - <option disabled><?= $lang["admin-calendar"]["create"]["trimesters"][0] ?></option> - <option value="1" <?php if ("01" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][0] ?></option> - <option value="2" <?php if ("02" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][1] ?></option> - <option value="3" <?php if ("03" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][2] ?></option> - <option disabled><?= $lang["admin-calendar"]["create"]["trimesters"][1] ?></option> - <option value="4" <?php if ("04" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][3] ?></option> - <option value="5" <?php if ("05" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][4] ?></option> - <option value="6" <?php if ("06" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][5] ?></option> - <option disabled><?= $lang["admin-calendar"]["create"]["trimesters"][2] ?></option> - <option value="7" <?php if ("07" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][6] ?></option> - <option value="8" <?php if ("08" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][7] ?></option> - <option value="9" <?php if ("09" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][8] ?></option> - <option disabled><?= $lang["admin-calendar"]["create"]["trimesters"][3] ?></option> - <option value="10" <?php if ("10" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][9] ?></option> - <option value="11" <?php if ("11" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][10] ?></option> - <option value="12" <?php if ("12" == date('m')) {echo("selected");} ?>><?= $lang["admin-calendar"]["create"]["months"][11] ?></option> - </select><br><br> - <li><?= $lang["admin-calendar"]["create"]["year"] ?></li> - <select id="year"> - <option value="<?= date('Y') ?>" selected><?= date('Y') ?></option> - <option value="<?= date('Y') + 1 ?>"><?= date('Y') + 1 ?></option> - <option value="<?= date('Y') + 2 ?>"><?= date('Y') + 2 ?></option> - <option value="<?= date('Y') + 3 ?>"><?= date('Y') + 3 ?></option> - <option value="<?= date('Y') + 4 ?>"><?= date('Y') + 4 ?></option> - <option value="<?= date('Y') + 5 ?>"><?= date('Y') + 5 ?></option> - </select> - </ul> - <h3><?= $lang["admin-calendar"]["create"]["info"] ?></h3> - <ul> - <li><?= $lang["admin-calendar"]["create"]["name"] ?></li> - <input type="text" placeholder="<?= $lang["admin-calendar"]["create"]["nameph"] ?>" id="name"><br><br> - <li><?= $lang["admin-calendar"]["create"]["desc"] ?> <i>(<?= $lang["admin-calendar"]["create"]["mandatory"] ?>)</i></li> - <input type="text" placeholder="<?= $lang["admin-calendar"]["create"]["web"] ?>" id="desc"><br><br> - <li><?= $lang["admin-calendar"]["create"]["web"] ?> <i>(<?= $lang["admin-calendar"]["create"]["mandatory"] ?>)</i> :</li> - <input onchange="validateUrl()" onkeyup="validateUrl()" onkeydown="validateUrl()" type="text" placeholder="<?= $lang["admin-calendar"]["create"]["webph"] ?>" id="link"><img id="link_check" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" style="vertical-align:middle;" class="hide" width="24px" height="24px"><a class="hide" id="link_invalid"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/close.svg" style="vertical-align:middle;" class="invert" width="24px" height="24px"></a> - </ul> - <p><table class="message_info"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_info.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-calendar"]["create"]["notice"] ?></p></td></tr></tbody></table></p> - <div style="text-align: center;"><p><a class="button" onclick="createCmsEvent()"><?= $lang["admin-calendar"]["create"]["complete"] ?></a></p></div><br> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function UrlRegex(str) { - var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol - '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name - '((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address - '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path - '(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string - '(\\#[-a-z\\d_]*)?$','i'); // fragment locator - return !!pattern.test(str); -} - -function validateUrl() { - document.getElementById('link_invalid').classList.add('hide'); - document.getElementById('link_check').classList.remove('hide'); - setTimeout(() => { - if (!UrlRegex(document.getElementById('link').value)) { - document.getElementById('link_invalid').classList.remove('hide'); - } else { - document.getElementById('link_invalid').classList.add('hide'); - } - document.getElementById('link_check').classList.add('hide'); - }, 2000) -} - -function createCmsEvent() { - document.getElementById('datainput').classList.add('hide') - var formData = new FormData(); - formData.append("day", document.getElementById('day').value); - formData.append("month", document.getElementById('month').value); - formData.append("year", document.getElementById('year').value); - formData.append("name", document.getElementById('name').value); - formData.append("desc", document.getElementById('desc').value); - formData.append("link", document.getElementById('link').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/calendar_create.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/calendar"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('datainput').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('datainput').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/calendar/index.php b/Neutron-trunk/cms-special/admin/calendar/index.php index e596551..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/calendar/index.php +++ b/Neutron-trunk/cms-special/admin/calendar/index.php @@ -1,86 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Calendrier", "headerName" => "Gestion des événements" ]; include_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <?php - - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/calendar_events")) { - $calevn = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/calendar_events"); - } else { - $calevn = "3"; - } - - ?> - <?= $lang["admin-calendar"]["show"][0] ?> <select onchange="updateNextEvents()" id="nextevents"> - <option value="1" <?php if ($calevn == "1") { echo("selected"); } ?>>1</option> - <option value="2" <?php if ($calevn == "2") { echo("selected"); } ?>>2</option> - <option value="3" <?php if ($calevn == "3") { echo("selected"); } ?>>3</option> - <option value="4" <?php if ($calevn == "4") { echo("selected"); } ?>>4</option> - <option value="5" <?php if ($calevn == "5") { echo("selected"); } ?>>5</option> - <option value="6" <?php if ($calevn == "6") { echo("selected"); } ?>>6</option> - <option value="7" <?php if ($calevn == "7") { echo("selected"); } ?>>7</option> - <option value="8" <?php if ($calevn == "8") { echo("selected"); } ?>>8</option> - <option value="9" <?php if ($calevn == "9") { echo("selected"); } ?>>9</option> - <option value="10" <?php if ($calevn == "10") { echo("selected"); } ?>>10</option> - </select> <?= $lang["admin-calendar"]["show"][1] ?> - <h3><?= $lang["admin-calendar"]["events"] ?></h3> - <ul> - <?php - - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json")) { - $dbraw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json"); - $corrupted = false; - if (isJson($dbraw)) { - $events = json_decode($dbraw); - foreach ($events->events as $event) { - if (isset($event->timestamp)) { - echo("<li><span style=\"cursor:help;\" title=\"" . $event->description . "\">" . $event->name . "</span> (" . $event->datestr . ")" . " - <a class=\"sblink\" href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/calendar/manage/?id=" . $event->timestamp . "\" title=\"{$lang['admin-calendar']['manageph']}\">" . $lang["admin-calendar"]["manage"] . "</a></li>"); - } - } - } else { - echo("<div style=\"color:red; text-align: center;\"><b><u>{$lang['admin-calendar']['corrupt'][0]}</u> {$lang['admin-calendar']['corrupt'][1]} <u>{$lang['admin-calendar']['corrupt'][2]}</u></b></div>"); - $corrupted = true; - } - } else { - echo("<div style=\"text-align: center;\">{$lang['admin-calendar']['nothing']}</div>"); - } - - ?> - <?php - - if (!$corrupted) { - echo('<br><li><i><a href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/calendar/add" title="' . $lang["admin-calendar"]["addph"] . '" class="sblink">' . $lang["admin-calendar"]["add"] . '</a></i></li>'); - } - - ?> - </ul> -<?php include_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> -<script> - -function updateNextEvents() { - value = document.getElementById('nextevents').value; - var formData = new FormData(); - formData.append("value", value); - document.getElementById('nextevents').disabled = true; - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/calendar_nextevents.php", - success: function (data) { - if (data == "ok") { - document.getElementById('nextevents').disabled = false; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('nextevents').disabled = false; - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('nextevents').disabled = false; - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/calendar/manage/index.php b/Neutron-trunk/cms-special/admin/calendar/manage/index.php index a6f4ebd..8387b16 100755..100644 --- a/Neutron-trunk/cms-special/admin/calendar/manage/index.php +++ b/Neutron-trunk/cms-special/admin/calendar/manage/index.php @@ -1,78 +1 @@ -<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Supprimer un événement - Calendrier", "headerName" => "Supprimer un événement" ]; include_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php -$eventsraw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json"); -if (isset($_GET['id'])) {} else { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS['SYSTEM_ROOT'] . "/cms-special/admin/calendar';</script>"); -} -if (isJson($eventsraw)) { - $events = json_decode($eventsraw); - foreach ($events->events as $element) { - if (isset($element->timestamp)) { - if ($element->timestamp == $_GET['id']) { - $event = $element; - } - } - } -} else { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS['SYSTEM_ROOT'] . "/cms-special/admin/calendar';</script>"); -} -if (!isset($event)) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS['SYSTEM_ROOT'] . "/cms-special/admin/calendar';</script>"); -} -?> - <h3><?= $lang["admin-calendar"]["info"] ?></h3> - <ul> - <li><b><?= $event->name ?></b></li> - <?php - - if (trim($event->description) != "") { - echo("<li><i>" . $event->description . "</i></li>"); - } - - if (isset($event->link)) { - if (trim($event->link) != "") { - echo("<li><i>" . $event->link . "</i></li>"); - } - } - - ?> - <li><?= $event->datestr ?> (<code><?= $event->timestamp ?></code>)</li> - </ul> - <h3><?= $lang["admin-calendar"]["deleteask"] ?></h3> - <ul id="delete"> - <li><a class="sblink" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/calendar" title="<?= $lang["admin-calendar"]["deletenoph"] ?>"><?= $lang["admin-calendar"]["deleteno"] ?></a></li> - <li><a class="sblink" onclick="deleteEvent()" title="<?= $lang["admin-calendar"]["deleteyesph"] ?>"><?= $lang["admin-calendar"]["deleteyes"] ?></a></li> - </ul> -<?php include_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function deleteEvent() { - document.getElementById('delete').classList.add('hide') - var formData = new FormData(); - formData.append("id", <?= $event->timestamp ?>); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/calendar_delete.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/calendar"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('delete').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('delete').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/customization/index.php b/Neutron-trunk/cms-special/admin/customization/index.php index 66aee2f..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/customization/index.php +++ b/Neutron-trunk/cms-special/admin/customization/index.php @@ -1,214 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Personnalisation", "headerName" => "Personnalisation" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<div class="hidden"> - <h3><?= $lang["admin-customization"]["theme"] ?></h3> - <select id="theme" onchange="updateTheme()"> - <option value="auto" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme")) == "auto") {echo("selected");} ?>><?= $lang["admin-customization"]["auto"] ?></option> - <option value="light" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme")) == "light") {echo("selected");} ?>><?= $lang["admin-customization"]["light"] ?></option> - <option value="dark" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme")) == "dark") {echo("selected");} ?>><?= $lang["admin-customization"]["dark"] ?></option> - </select> - <h3><?= $lang["admin-customization"]["color"] ?></h3> - <select id="colors" onchange="updateColors()"> - <option value="blue" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "blue") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][0] ?></option> - <option value="green" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "green") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][1] ?></option> - <option value="red" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "red") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][2] ?></option> - <option value="orange" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "orange") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][3] ?></option> - <option value="purple" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "purple") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][4] ?></option> - <option value="brown" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "brown") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][5] ?></option> - <option value="white" <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "white") {echo("selected");} ?>><?= $lang["admin-customization"]["colors"][6] ?></option> - </select> -</div> - -<h3><?= $lang["admin-customization"]["theme"] ?></h3> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme")) == "auto") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('theme').value = 'auto';updateTheme();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card__media mdc-card__media--16-9" style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/theme-auto.jpg');"></div> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["auto2"] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-customization"]["descriptions"][0] ?></h3> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme")) == "dark") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('theme').value = 'dark';updateTheme();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card__media mdc-card__media--16-9" style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/theme-dark.jpg');"></div> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["dark"] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-customization"]["descriptions"][1] ?></h3> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/theme")) == "light") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('theme').value = 'light';updateTheme();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card__media mdc-card__media--16-9" style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/theme-light.jpg');"></div> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["light"] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-customization"]["descriptions"][2] ?></h3> - </div> - </div> -</div> - -<h3><?= $lang["admin-customization"]["color"] ?></h3> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "blue") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'blue';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-blue.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][0] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "green") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'green';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-green.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][1] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "red") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'red';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-red.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][2] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "orange") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'orange';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-orange.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][3] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "purple") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'purple';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-purple.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][4] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "brown") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'brown';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-brown.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][5] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> -<div class="mdc-card mdc-card--outlined <?php if (trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/color")) == "white") {echo("mdc-card--selected");} ?>" onclick="document.getElementById('colors').value = 'white';updateColors();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <table> - <tbody> - <tr> - <td><div style="background-image: url('<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/demos/color-white.jpg');width: 73px;height: 73px;background-size: cover;margin-left: -10px;margin-top: -10px;margin-bottom: -10px;"></div></td> - <td><h2 style="margin-bottom:5px;margin-top: 5px;margin-left: 10px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-customization"]["colors2"][6] ?></h2></td> - </tr> - </tbody> - </table> - </div> - </div> -</div> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> -<script> - -function updateColors() { - $('body').fadeOut(200); - document.getElementById('colors').disabled = true; - var formData = new FormData(); - formData.append("color", document.getElementById('colors').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/customization_colors.php", - success: function (data) { - if (data == "ok") { - console.log("Saved") - setTimeout(() => { - document.getElementById('colors').disabled = false; - ajaxPageReload(); - }, 500) - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data); - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>"); - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updateTheme() { - $('body').fadeOut(200); - document.getElementById('theme').disabled = true; - var formData = new FormData(); - formData.append("theme", document.getElementById('theme').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/customization_theme.php", - success: function (data) { - if (data == "ok") { - console.log("Saved") - setTimeout(() => { - document.getElementById('theme').disabled = false; - ajaxPageReload(); - }, 500) - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data); - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>"); - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/error/index.php b/Neutron-trunk/cms-special/admin/error/index.php index c68c6a6..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/error/index.php +++ b/Neutron-trunk/cms-special/admin/error/index.php @@ -1,11 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Erreur", "headerName" => "Erreur" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <h1><div style="text-align: center;"><?= $lang["admin-errors"]["common"]['title'] ?></div></h1> - <p><div style="text-align: center;"><?= $lang["admin-errors"]["common"]['message'] ?></div></p> - <p><div style="text-align: center;"> - <ul> - <li><a href="<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/bugs") ?>" target="_blank"><?= $lang["admin-errors"]["common"]['report'] ?></a></li> - <li><a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home"><?= $lang["admin-errors"]["common"]['home'] ?></a></li> - </ul> - </div></p> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/flags/index.php b/Neutron-trunk/cms-special/admin/flags/index.php index c243a49..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/flags/index.php +++ b/Neutron-trunk/cms-special/admin/flags/index.php @@ -1,75 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -/** @var boolean $__electrode */ -if (isset($__electrode) && $__electrode) { - header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -function fflag($name, $title, $description) { - echo('<div class="widget"><div id="header-' . $name . '" class="widget-header '); - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/flag_{$name}")) { echo("enabled"); } else { echo("disabled"); } - echo("\"><table><tbody><tr><td><label class=\"switch\"><input name=\"{$name}\" type=\"checkbox\" onclick=\"updateWidgetStatus('{$name}')\" onchange=\"updateWidgetStatus('{$name}')\""); - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/flag_{$name}")) { echo(" checked"); } - echo("><span class=\"slider round\"></span></label></td><td class=\"widget-header-info\"><b>{$title}</b></td></tr></tbody></table></div><p>{$description}</p></div>"); -} - -$pageConfig = [ "domName" => "Drapeaux", "headerName" => "Drapeaux" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <p><table class="message_info"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_info.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-flags"]["notice"] ?></p></td></tr></tbody></table></p> - -<?php fflag("boundaries", "Show Layout Boundaries", "Shows a thin colored border around different DOM elements.") ?> -<?php fflag("trace", "Trace Rendering Process", "Shows technical info on the bottom of each page. May contain personal/confidential information!") ?> - -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function updateWidgetStatus(widget) { - checkbox = document.getElementsByName(widget)[0] - if (typeof checkbox == "undefined") {} else { - if (checkbox.checked) { - enabled = true; - document.getElementById('header-' + widget).classList.remove('disabled'); - document.getElementById('header-' + widget).classList.add('enabled'); - } else { - enabled = false; - document.getElementById('header-' + widget).classList.remove('enabled'); - document.getElementById('header-' + widget).classList.add('disabled'); - } - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - - var formData = new FormData(); - formData.append("element", widget); - if (enabled) { - url = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/flag_enable.php"; - } else { - url = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/flag_disable.php"; - } - $.ajax({ - type: "POST", - dataType: 'html', - url: url, - success: function (data) { - if (data == "ok") { - setTimeout(() => { - location.reload(); - }, 500) - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data); - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>"); - window.onbeforeunload = undefined; - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - - } -} - -</script>
\ No newline at end of file +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/galery/addcategory/index.php b/Neutron-trunk/cms-special/admin/galery/addcategory/index.php index f2438e1..ab09864 100755..100644 --- a/Neutron-trunk/cms-special/admin/galery/addcategory/index.php +++ b/Neutron-trunk/cms-special/admin/galery/addcategory/index.php @@ -1,2 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
-<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/gallery/addcategory") ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/galery/index.php b/Neutron-trunk/cms-special/admin/galery/index.php index 82ad59c..7d45b3e 100755..100644 --- a/Neutron-trunk/cms-special/admin/galery/index.php +++ b/Neutron-trunk/cms-special/admin/galery/index.php @@ -1,2 +1 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
-<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/gallery") ?>
\ No newline at end of file +<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/galery/publish/index.php b/Neutron-trunk/cms-special/admin/galery/publish/index.php index ac5f616..8387b16 100755..100644 --- a/Neutron-trunk/cms-special/admin/galery/publish/index.php +++ b/Neutron-trunk/cms-special/admin/galery/publish/index.php @@ -1,2 +1 @@ -<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
-<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/gallery/publish") ?>
\ No newline at end of file +<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php b/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php index 68451fc..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php +++ b/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php @@ -1,39 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Nouvelle catégorie - Galerie de photos", "headerName" => "Nouvelle catégorie" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="hidding"> - <input type="text" id="catname" placeholder="<?= $lang["admin-gallery"]["addcat"]["placeholder"] ?>"> - <p><i><?= $lang["admin-gallery"]["addcat"]["same"] ?></i></p> - <p><div style="text-align: center;"><a class="button" onclick="createCat()"><?= $lang["admin-gallery"]["addcat"]["confirm"] ?></a></div></p> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function createCat() { - document.getElementById('hidding').classList.add('hide') - var formData = new FormData(); - formData.append("category", document.getElementById('catname').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_create_category.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/gallery"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('hidding').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('hidding').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/gallery/index.php b/Neutron-trunk/cms-special/admin/gallery/index.php index 7623820..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/gallery/index.php +++ b/Neutron-trunk/cms-special/admin/gallery/index.php @@ -1,218 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Galerie de photos", "headerName" => "Galerie de photos" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php - -if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery")) { - mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery"); - mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories"); - mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures"); -} - -?> - <h3><?= $lang["admin-gallery"]["general"]['title'] ?></h3> - <ul> - <li><?php - - $count = 0; - $dirs = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories"); - foreach ($dirs as $el) { - if ($el == "." || $el == "..") {} else { - $count = $count + 1; - } - } - if ($count != 0) { - echo($count); - } else { - echo($lang["admin-gallery"]["none"]); - } - - ?> <?= $lang["admin-gallery"]["lists"]['categories'] ?><?php if ($count > 1) {echo("s");} ?> - <?php - - $count = 0; - $dirs = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures"); - foreach ($dirs as $el) { - if ($el == "." || $el == "..") {} else { - $count = $count + 1; - } - } - if ($count != 0) { - echo($count); - } else { - echo($lang["admin-gallery"]["none"]); - } - - ?> <?= $lang["admin-gallery"]["lists"]['picture'] ?><?php if ($count > 1) {echo("s");} ?></li> - <li><a class="sblink" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/gallery/addcategory"><?= $lang["admin-gallery"]["categories"]["add"] ?></a></li> - </ul> - <h3><?= $lang["admin-gallery"]["categories"]['title'] ?></h3> - <i><?= $lang["admin-gallery"]["categories"]['edit'] ?></i> - <ul> - <?php - - $dirs = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories"); - foreach ($dirs as $el) { - if ($el == "." || $el == "..") {} else { - echo("<li>" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories/" . $el) . ", <a class=\"sblink\" onclick=\"deleteCategory('{$el}')\">" . $lang["admin-gallery"]["categories"]['delete'] . "</a></li>"); - } - } - - ?> - </ul> - <h3><?= $lang["admin-gallery"]["pictures"]['title'] ?></h3> - <ul> - <?php - - $count = 0; - $dirs = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures"); - foreach ($dirs as $el) { - if ($el == "." || $el == "..") {} else { - $count = $count + 1; - } - } - if ($count == 0) { - echo("<i>" . $lang["admin-gallery"]["pictures"]['none'] . "</i><p><a class=\"sblink\" href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/gallery/publish\">" . $lang["admin-gallery"]["pictures"]['add'] . "</a></p>"); - } else { - foreach ($dirs as $el) { - if ($el == "." || $el == "..") {} else { - if (isset(explode('|', file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $el))[2])) { - echo("<li><i>" . explode('|', file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $el))[2] . "</i>, "); - } else { - echo("<li><code>" . $el ."</code>, "); - } - if (explode('|', file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $el))[1] == "unclassed") { - echo($lang["gallery"]["unclassed"]); - } else { - echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories/" . explode('|', file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $el))[1])); - } - echo(", <a onclick=\"labelPicture('$el')\" class=\"sblink\">{$lang["admin-gallery"]["general"]["label"]}</a> - <a href=\"{$GLOBALS["SYSTEM_ROOT"]}" . explode('|', file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $el))[0] . "\" class=\"sblink\" download>" . $lang["admin-gallery"]["pictures"]['download'] . "</a> - <a onclick=\"confirmDelete('$el')\" class=\"sblink\">" . $lang["admin-gallery"]["pictures"]['delete'] . "</a></li>"); - } - } - echo("<b><a class=\"sblink\" href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/gallery/publish\">" . $lang["admin-gallery"]["pictures"]['add'] . "</a></b>"); - } - - ?> - </ul> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function confirmDelete(id) { - if (confirm("<?= $lang["admin-gallery"]["delete"]['title'][0] ?>\n<?= $lang["admin-gallery"]["delete"]['title'][1] ?>")) { - $('#settings').fadeOut(200) - document.title = "<?= $lang["admin-gallery"]["delete"]['removing'] ?>" - var formData = new FormData(); - formData.append("id", id); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_delete_image.php", - success: function (data) { - if (data == "ok") { - reloadPage() - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - reloadPage() - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - reloadPage() - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - } -} - -function deleteCategory(id) { - if (confirm('<?= $lang["admin-gallery"]["delete"]['category'] ?>')) { - $('#settings').fadeOut(200) - document.title = "<?= $lang["admin-gallery"]["delete"]['catrm'] ?>" - var formData = new FormData(); - formData.append("id", id); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_delete_category.php", - success: function (data) { - if (data == "ok") { - reloadPage() - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data, true) - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>", true) - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - } -} - -function labelPicture(id) { - text = prompt("<?= $lang["admin-gallery"]["label"] ?>") - if (typeof text == "string") { - $('#settings').fadeOut(200) - document.title = "<?= $lang["admin-gallery"]["labelling"] ?>" - var formData = new FormData(); - formData.append("id", id); - formData.append("label", text); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_label_picture.php", - success: function (data) { - if (data == "ok") { - reloadPage() - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data, true) - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>", true) - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - } -} - -function changeState() { - document.getElementById('state').disabled = true; - var formData = new FormData(); - if (document.getElementById('state').checked) { - formData.append("state", "1"); - } else { - formData.append("state", "0"); - } - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_toggle_state.php", - success: function (data) { - if (data == "ok") { - document.getElementById('state').disabled = false; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('state').disabled = false; - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('state').disabled = false; - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script> +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/gallery/publish/index.php b/Neutron-trunk/cms-special/admin/gallery/publish/index.php index e2768ac..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/gallery/publish/index.php +++ b/Neutron-trunk/cms-special/admin/gallery/publish/index.php @@ -1,57 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Nouvelle photo - Galerie de photos", "headerName" => "Nouvelle photo" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="hidding"> - <p><?= $lang["admin-gallery"]["publish"]["category"] ?> <select id="category"> - <option value="unclassed" selected><?= $lang["admin-gallery"]["publish"]["default"] ?></option> - <?php - - $categories = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories"); - foreach ($categories as $category) { - if (trim($category) != "" && $category != "." && $category != "..") { - $catname = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories/" . $category); - echo("<option value=\"" . $category . "\">" . $catname . "</option>"); - } - } - - ?> - </select></p> - <p><?= $lang["admin-gallery"]["publish"]["file"] ?> <input type="file" id="file"> <i><?= $lang["admin-gallery"]["publish"]["max"] ?> <?= ini_get("upload_max_filesize") ?></i></p> - <p><div style="text-align: center;"><a class="button" onclick="createCat()"><?= $lang["admin-gallery"]["publish"]["publish"] ?></a></div></p> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function createCat() { - document.getElementById('hidding').classList.add('hide') - var formData = new FormData(); - if (document.getElementById('file').value.trim() != "") { - formData.append("file", document.getElementById('file').files[0], document.getElementById('file').files[0].name); - } - formData.append("category", document.getElementById('category').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_publish_photo.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/gallery"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('hidding').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('hidding').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -document.getElementById('file').value = ""; - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/home/all/db.json b/Neutron-trunk/cms-special/admin/home/all/db.json deleted file mode 100755 index 8a6ad37..0000000 --- a/Neutron-trunk/cms-special/admin/home/all/db.json +++ /dev/null @@ -1,178 +0,0 @@ -[ - { - "name": "pages", - "id": 0, - "icon": "insert_drive_file", - "items": [ - { - "name": "list", - "id": 0, - "icon": "list_alt", - "page": "pages" - }, - { - "name": "create", - "id": 1, - "icon": "add", - "page": "pages/add" - } - ] - }, - { - "name": "gallery", - "id": 1, - "icon": "photo", - "items": [ - { - "name": "list", - "id": 2, - "icon": "photo_library", - "page": "gallery" - }, - { - "name": "add", - "id": 3, - "icon": "add_photo_alternate", - "page": "gallery/publish" - }, - { - "name": "category", - "id": 4, - "icon": "local_offer", - "page": "gallery/addcategory" - }, - { - "name": "userspace", - "id": 5, - "icon": "image_search", - "page": "../gallery" - } - ] - }, - { - "name": "calendar", - "id": 2, - "icon": "event", - "items": [ - { - "name": "all", - "id": 6, - "icon": "event", - "page": "calendar" - }, - { - "name": "create", - "id": 7, - "icon": "event_available", - "page": "calendar/add" - }, - { - "name": "userspace", - "id": 8, - "icon": "event_note", - "page": "../calendar" - } - ] - }, - { - "name": "plugins", - "id": 3, - "icon": "extension", - "items": [ - { - "name": "all", - "id": 9, - "icon": "extension", - "page": "plugins" - } - ] - }, - { - "name": "technical", - "id": 4, - "icon": "build_circle", - "items": [ - { - "name": "all", - "id": 12, - "icon": "engineering", - "page": "advanced" - }, - { - "name": "advanced", - "id": 13, - "icon": "build_circle", - "page": "advanced/jsonconf" - } - ] - }, - { - "name": "data", - "id": 5, - "icon": "pie_chart", - "items": [ - { - "name": "reset", - "id": 15, - "icon": "delete", - "page": "reset" - }, - { - "name": "stats", - "id": 16, - "icon": "pie_chart", - "page": "stats" - }, - { - "name": "logs", - "id": 17, - "icon": "subject", - "page": "logs" - } - ] - }, - { - "name": "updates", - "id": 6, - "icon": "cloud_download", - "items": [ - { - "name": "info", - "id": 19, - "icon": "info", - "page": "about" - } - ] - }, - { - "name": "apparence", - "id": 7, - "icon": "brush", - "items": [ - { - "name": "general", - "id": 22, - "icon": "brush", - "page": "appearance" - }, - { - "name": "theme", - "id": 23, - "icon": "palette", - "page": "customization" - }, - { - "name": "language", - "id": 26, - "icon": "language", - "page": "language" - }, - { - "name": "flags", - "id": 27, - "icon": "flag", - "page": "flags" - } - ] - } -] diff --git a/Neutron-trunk/cms-special/admin/home/all/index.php b/Neutron-trunk/cms-special/admin/home/all/index.php index f844070..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/home/all/index.php +++ b/Neutron-trunk/cms-special/admin/home/all/index.php @@ -1,4 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home");
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/home/appearance/index.php b/Neutron-trunk/cms-special/admin/home/appearance/index.php index 318611a..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/home/appearance/index.php +++ b/Neutron-trunk/cms-special/admin/home/appearance/index.php @@ -1,45 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$pageConfig = [ "domName" => "Tableau de bord", "headerName" => "Tableau de bord" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<div style="text-align: center;"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">arrow_back</i> - <span class="mdc-button__label"><?= $lang["admin-home"]["items"][7] ?></span> - </a> - - <h1><?= $lang["admin-home"]["appearance"]['greeting'] ?></h1> - - <div id="home-grid"> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["appearance"]['items'][0] ?>" id="home-grid-item-appearance" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/appearance" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">tour</a> - <br> - <?= $lang["admin-home"]["appearance"]['items'][0] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["appearance"]['items'][1] ?>" id="home-grid-item-appearance" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/customization" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">palette</a> - <br> - <?= $lang["admin-home"]["appearance"]['items'][1] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["appearance"]['items'][3] ?>" id="home-grid-item-appearance" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/language" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">language</a> - <br> - <?= $lang["admin-home"]["appearance"]['items'][3] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["appearance"]['items'][4] ?>" id="home-grid-item-appearance" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/plugins" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">extension</a> - <br> - <?= $lang["admin-home"]["appearance"]['items'][4] ?> - </div> - <?php /** @var boolean $__electrode */ - if (!isset($__electrode) || !$__electrode): ?> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["appearance"]['items'][5] ?>" id="home-grid-item-appearance" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/flags" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">flag</a> - <br> - <?= $lang["admin-home"]["appearance"]['items'][5] ?> - </div> - <?php endif; ?> - </div> -</div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/home/data/index.php b/Neutron-trunk/cms-special/admin/home/data/index.php index 29205dc..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/home/data/index.php +++ b/Neutron-trunk/cms-special/admin/home/data/index.php @@ -1,27 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$pageConfig = [ "domName" => "Tableau de bord", "headerName" => "Tableau de bord" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<div style="text-align: center;"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">arrow_back</i> - <span class="mdc-button__label"><?= $lang["admin-home"]["items"][7] ?></span> - </a> - - <h1><?= $lang["admin-home"]["data"]['greeting'] ?></h1> - - <div id="home-grid"> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["data"]['items'][0] ?>" id="home-grid-item-data" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/stats" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">pie_chart</a> - <br> - <?= $lang["admin-home"]["data"]['items'][0] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["data"]['items'][1] ?>" id="home-grid-item-data" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/logs" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">text_snippet</a> - <br> - <?= $lang["admin-home"]["data"]['items'][1] ?> - </div> - </div> -</div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/home/housekeeping/index.php b/Neutron-trunk/cms-special/admin/home/housekeeping/index.php index 8c0deae..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/home/housekeeping/index.php +++ b/Neutron-trunk/cms-special/admin/home/housekeeping/index.php @@ -1,27 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$pageConfig = [ "domName" => "Tableau de bord", "headerName" => "Tableau de bord" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<div style="text-align: center;"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">arrow_back</i> - <span class="mdc-button__label"><?= $lang["admin-home"]["items"][7] ?></span> - </a> - - <h1><?= $lang["admin-home"]["housekeeping"]['greeting'] ?></h1> - - <div id="home-grid"> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["housekeeping"]['items'][0] ?>" id="home-grid-item-housekeeping" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/reset" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">restore</a> - <br> - <?= $lang["admin-home"]["housekeeping"]['items'][0] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["housekeeping"]['items'][1] ?>" id="home-grid-item-housekeeping" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/about" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">info</a> - <br> - <?= $lang["admin-home"]["housekeeping"]['items'][1] ?> - </div> - </div> -</div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/home/index.php b/Neutron-trunk/cms-special/admin/home/index.php index 327ab36..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/home/index.php +++ b/Neutron-trunk/cms-special/admin/home/index.php @@ -1,58 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$pageConfig = [ "domName" => "Tableau de bord", "headerName" => "Tableau de bord" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<div style="text-align: center;"> - <a title="<?= $lang["admin-home"]["language"] ?>/Switch Language" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/language" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button" id="language-selector">translate</a> - - <h1><?= $lang["admin-home"]["greeting"] ?></h1> - - <div id="home-grid"> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["items"][0] ?>" id="home-grid-item-pages" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">layers</a> - <br> - <?= $lang["admin-home"]["items"][0] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["items"][1] ?>" id="home-grid-item-calendar" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/calendar" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">event_note</a><br> - <?= $lang["admin-home"]["items"][1] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["items"][2] ?>" id="home-grid-item-gallery" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/gallery" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">photo</a><br> - <?= $lang["admin-home"]["items"][2] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["items"][3] ?>" id="home-grid-item-appearance" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home/appearance" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">brush</a><br> - <?= $lang["admin-home"]["items"][3] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["items"][4] ?>" id="home-grid-item-data" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home/data" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">dns</a><br> - <?= $lang["admin-home"]["items"][4] ?> - </div> - <div class="home-grid-item"> - <a title="<?= $lang["admin-home"]["items"][5] ?>" id="home-grid-item-housekeeping" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home/housekeeping" class="material-icons-outlined mdc-top-app-bar__navigation-icon mdc-icon-button home-grid-item-button">cleaning_services</a><br> - <?= $lang["admin-home"]["items"][5] ?> - </div> - </div> - - <br> - - <a onclick="document.getElementsByTagName('spotlight-bar')[0].show()" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">settings</i> - <span class="mdc-button__label"><?= $lang["admin-home"]["items"][6] ?></span> - </a> - - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/logout" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">power_settings_new</i> - <span class="mdc-button__label"><?= $lang["admin-home"]["items"][8] ?></span> - </a> - - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/?source=admin" target="_blank" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">public</i> - <span class="mdc-button__label"><?= $lang["admin-home"]["items"][9] ?></span> - </a> -</div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/housekeeping/index.php b/Neutron-trunk/cms-special/admin/housekeeping/index.php index a5d0bbc..792609b 100755..100644 --- a/Neutron-trunk/cms-special/admin/housekeeping/index.php +++ b/Neutron-trunk/cms-special/admin/housekeeping/index.php @@ -1,2 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
-<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home/housekeeping"); ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php b/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php index 35b36d1..8387b16 100755..100644 --- a/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php +++ b/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php @@ -1,2 +1 @@ -<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
-<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/reset"); ?>
\ No newline at end of file +<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/index.php b/Neutron-trunk/cms-special/admin/index.php index 8e388b6..6d72277 100755..100644 --- a/Neutron-trunk/cms-special/admin/index.php +++ b/Neutron-trunk/cms-special/admin/index.php @@ -1,135 +1,2 @@ <?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['pr']) || isset($_GET['pa'])) { - if (isset($_GET['pr']) && !isset($_GET['pa'])) { - header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/login/?pr=" . $_GET['pr']); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } - if (!isset($_GET['pr']) && isset($_GET['pa'])) { - header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/login/?pa=" . $_GET['pa']); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } - if (isset($_GET['pr']) && isset($_GET['pa'])) { - header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/login/?pr=" . $_GET['pr'] . "&pa=" . $_GET['pa']); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} - -/** @var boolean $__electrode */ -if (isset($__electrode) && $__electrode) { - header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> - -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Neutron</title> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ajax.css"> - <link rel="icon" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/siteicon.png"> - <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/jquery.js"></script> -</head> -<body> - <iframe id="content" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/login" style="border:none;"></iframe> - <div id="loader"> - <svg class="spinner" width="48px" height="48px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"> - <circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle> - </svg> - </div> -</body> - -<script> - function iframeURLChange(iframe, callback) { - var unloadHandler = function () { - setTimeout(function () { - callback(iframe.contentWindow.location.href); - }, 0); - }; - - function attachUnload() { - iframe.contentWindow.removeEventListener("unload", unloadHandler); - iframe.contentWindow.addEventListener("unload", unloadHandler); - } - - iframe.addEventListener("load", attachUnload); - attachUnload(); - } - - iframeURLChange(document.getElementById("content"), function (newURL) { - $("#loader").fadeIn(200); - }); - - document.getElementById('content').onbeforeunload = () => { - $("#loader").fadeIn(200); - } - - document.getElementById('content').onload = () => { - $("#loader").fadeOut(200); - - setTimeout(() => { - $("#loader").fadeOut(200); - }, 300) - - els2 = document.getElementById('content').contentWindow.location.href.split("/"); - - els2.shift(); - els2.shift(); - els2.shift(); - - url = "/" + els2.join("/"); - if (!url.startsWith("<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin")) { - document.getElementById('content').contentWindow.history.back(); - window.open(url); - } - - els = document.getElementById('content').contentWindow.location.href.split("/"); - - els.shift(); - els.shift(); - els.shift(); - els.shift(); - els.shift(); - <?php if ($GLOBALS["SYSTEM_PREFIXED"]): ?> - els.shift(); - <?php endif; ?> - - oldu = "/" + els.join("/"); - - window.history.replaceState("Neutron", "Neutron", "#/" + els.join("/")); - console.log("<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/" + els.join("/")); - - document.title = document.getElementById('content').contentWindow.document.title; - } - - oldu = null; - setInterval(() => { - hash = location.hash.substr(1); - - if (hash == "" && hash != oldu) { - document.getElementById('content').src = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home"; - console.log("<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home"); - $("#loader").fadeIn(200); - - oldu = hash; - } else if (hash != oldu) { - if (hash.startsWith("/") && (hash.substr(1, 1) != "/")) { - document.getElementById('content').src = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin" + hash; - console.log("<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin" + hash); - $("#loader").fadeIn(200); - } else { - document.getElementById('content').src = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home"; - console.log("<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/home"); - $("#loader").fadeIn(200); - } - - oldu = hash; - } - }, 200) -</script> - -</html>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/language/index.php b/Neutron-trunk/cms-special/admin/language/index.php index 4c16e04..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/language/index.php +++ b/Neutron-trunk/cms-special/admin/language/index.php @@ -1,57 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Langue et région", "headerName" => "Langue et région" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<div style="text-align: center;"><select id="langselect"> - <?php - - $langs = scandir($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n"); - foreach ($langs as $language) { - if ($language != "." && $language != ".." && $language != ".htaccess") { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/" . $language . "/\$metadata.json")) { - echo("<option value=\"" . $language . "\">"); - echo(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/" . $language . "/\$metadata.json"))->localized_name . " — " . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/" . $language . "/\$metadata.json"))->name); - echo("</option>"); - } - } - } - - ?> -</select> -</p> -<input id="langselect-confirm" type="button" value="OK" onclick="changeLanguage()"></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function changeLanguage() { - document.getElementById('langselect').disabled = true; - document.getElementById('langselect-confirm').disabled = true; - var formData = new FormData(); - formData.append("lang", document.getElementById('langselect').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/instant_language_change.php", - success: function (data) { - if (data == "ok") { - document.getElementById('langselect').disabled = false; - document.getElementById('langselect-confirm').disabled = false; - ajaxPageReload(); - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data); - document.getElementById('langselect').disabled = false; - document.getElementById('langselect-confirm').disabled = false; - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>\n\n<?= $lang["admin-errors"]["housekeeping"][1] ?>") - document.getElementById('langselect').disabled = false; - document.getElementById('langselect-confirm').disabled = false; - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/login-old/index.php b/Neutron-trunk/cms-special/admin/login-old/index.php index d4428d7..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/login-old/index.php +++ b/Neutron-trunk/cms-special/admin/login-old/index.php @@ -1,122 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$invalid = false; - -if (isset($_POST['authkey'])) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("UNSUPPORTED"); -} else { - if (isset($_POST['password'])) { - if (isset($_GET['pr'])) { - if (isset($_GET['pa'])) { - $callback = $_GET['pr'] . $_GET['pa']; - } else { - $callback = $_GET['pr']; - } - } else { - $callback = "{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home"; - } - if (password_verify($_POST['password'], file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/password"))) { - $token = str_ireplace("/", "-", password_hash(password_hash(rand(0, 999999) + rand(0, 999999) + rand(0, 999999) + rand(0, 999999) + rand(0, 999999), PASSWORD_BCRYPT, ['cost' => 12,]), PASSWORD_BCRYPT, ['cost' => 12,])); - if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/tokens")) { - mkdir($_SERVER['DOCUMENT_ROOT'] . "/data/tokens"); - } - $tokens = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/tokens"); - foreach ($tokens as $atoken) { - if ($atoken == "." || $atoken == "..") {} else { - unlink($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $atoken); - } - } - file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $token, ""); - header("Set-Cookie: _NEUTRON_ADMIN_TOKEN={$token}; Path=/; Http-Only; SameSite=Strict"); - header("Location: " . $callback); - return; - } else { - $invalid = true; - } - } -} - -if (isset($_COOKIE['_NEUTRON_ADMIN_TOKEN']) && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != ".." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "/") { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $_COOKIE['_NEUTRON_ADMIN_TOKEN'])) { - if (isset($_GET['pr'])) { - if (isset($_GET['pa'])) { - $callback = $_GET['pr'] . $_GET['pa']; - } else { - $callback = $_GET['pr']; - } - } else { - $callback = "{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home"; - } - header("Location: " . $callback); - } -} - -?> - -<?php ob_start();echo("<!--\n\n" . str_replace('%year%', date('Y'), file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/private/license")) . "\n\n-->") ?> -<?php - -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent")) { - $ready = true; -} else { - $ready = false; -} - -?> - -<!DOCTYPE html> -<html lang="fr"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta http-equiv="X-UA-Compatible" content="ie=edge"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/fonts-import.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/header.php"; ?> - <title><?php - - if ($ready) { - echo($lang["login"]["login"] . " - " . $lang["login"]["title"] . " - " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename")); - } else { - echo("Neutron"); - } - - ?></title> - <?php - if (!$ready) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '{$GLOBALS["SYSTEM_ROOT"]}/cms-special/setup';</script></head>"); - } - ?> -</head> -<body id="login"> - <div class="centered"> - <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/upload/siteicon.png" style="border-radius:100%;" class="intro-element"> - <h2 style="margin-bottom:0;"><?= $lang["login"]["title"] ?></h2> - <p><small><?= str_replace("}", "</a>", str_replace("{", "<a class=\"clink\" href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/login\">", $lang["login"]["redirect"])); ?></small></p> - <p><?php - - if (isset($_GET['authkey'])) { - echo('<small>' . $lang["login"]["uauth"] . '<br><a href="." class="clink">' . $lang['login']['pass'] . '</a></small>'); - } else { - echo('<small>' . $lang["login"]["upass"] . '<br><a href="./?authkey" class="clink">' . $lang['login']['auth'] . '</a></small>'); - } - - ?></p> - <?php if ($invalid) {echo('<div id="error">' . $lang["login"]["invalid"] . '</div>');} ?> - - <?php if (!isset($_GET['authkey'])): ?> - <form action="./<?php if (isset($_GET['pr'])) {echo("?pr=" . $_GET['pr']);if (isset($_GET['pa'])) {echo("&pa=" . urlencode($_GET['pa']));}} ?>" method="post"> - <input name="password" type="password" placeholder="<?= isset($_GET['authkey']) ? $lang["login"]["authph"] : $lang["login"]["password"] ?>"><br><br> - <input type="submit" class="button" value="<?= $lang["login"]["login"] ?>"> - </form><br> - <?php else: ?> - <form action="#" method="post"> - <input name="authkey" type="password" placeholder="<?= isset($_GET['authkey']) ? $lang["login"]["authph"] : $lang["login"]["password"] ?>" disabled><br><br> - <small><?= $lang["login"]["nokey"][0] . " <a class=\"clink\" href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/login\">" . $lang["login"]["nokey"][1] . "</a> " . $lang["login"]["nokey"][2] ?></small> - </form><br> - <?php endif ?> - </div> -</body> -</html>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/login/index.php b/Neutron-trunk/cms-special/admin/login/index.php index 57a1b6a..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/login/index.php +++ b/Neutron-trunk/cms-special/admin/login/index.php @@ -1,219 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_COOKIE['_NEUTRON_ADMIN_TOKEN']) && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != ".." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "/") { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $_COOKIE['_NEUTRON_ADMIN_TOKEN'])) { - if (isset($_GET['pr'])) { - if (isset($_GET['pa'])) { - $callback = $_GET['pr'] . $_GET['pa']; - } else { - $callback = $_GET['pr']; - } - } else { - $callback = "{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home"; - } - header("Location: " . $callback); - } -} - -if (isset($_GET['pr'])) { - if (isset($_GET['pa'])) { - $callback = $_GET['pr'] . $_GET['pa']; - } else { - $callback = $_GET['pr']; - } -} else { - $callback = "{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/home"; -} - -?> - -<?php ob_start();echo("<!--\n\n" . str_replace('%year%', date('Y'), file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/private/license")) . "\n\n-->") ?> -<?php - -if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent")) { - $ready = true; -} else { - $ready = false; -} - -require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocessor.php"; - -?> - -<!DOCTYPE html> -<html lang="fr"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta http-equiv="X-UA-Compatible" content="ie=edge"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/fonts-import.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/alerts.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/codename.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ajax.css"> - <link href="<?= $_MD_INCLUDES ?>/material-components-web.min.css" rel="stylesheet"> - <script src="<?= $_MD_INCLUDES ?>/material-components-web.min.js"></script> - <link rel="stylesheet" href="<?= $_MDI_PATH ?>"> - <?php - echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/$resources/index-dark.css">'); - ?> - <title><?php - - if ($ready) { - echo($lang["login"]["login"] . " - " . $lang["login"]["title"] . " - " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename")); - } else { - echo("Neutron"); - } - - ?></title> - <?php - if (!$ready) { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '{$GLOBALS["SYSTEM_ROOT"]}/cms-special/setup';</script></head>"); - } - ?> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documenthead.php"; ?> - <script> - - window.onerror = () => { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/login-old"; - } - - </script> -</head> -<body id="login"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documentbody.php"; ?> - <div id="loader" style="display:none;z-index:99;"> - <svg class="spinner" width="48px" height="48px" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg"> - <circle class="path" fill="none" stroke-width="6" stroke-linecap="round" cx="33" cy="33" r="30"></circle> - </svg> - </div> - <div id="admin"> - <main class="main-content" id="main-content"> - <div class="content"> - <div class="inner"> - <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/upload/siteicon.png" style="border-radius:100%;" class="intro-element"> - <h2><?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename"); ?></h2> - - <div id="loginwith"> - <button class="mdc-button mdc-button--raised" id="loginwith-password" onclick="disableAuthKey();"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">vpn_key</i> - <span class="mdc-button__label"><?= $lang["admin-login"]["modes"][0] ?></span> - </button> - <?php if (file_exists($GLOBALS["ORIGINAL_DOCUMENT_ROOT"] . "/NeutronCloud") && is_file($GLOBALS["ORIGINAL_DOCUMENT_ROOT"] . "/NeutronCloud")): ?> - <button onclick="window.parent.location.href='https://minteck.ro.lt/admin/NeutronManage/?_='+location.pathname.split('/')[1];" class="mdc-button mdc-button--outlined" id="loginwith-authkey"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">admin_panel_settings</i> - <span class="mdc-button__label">Cloud Admin Console</span> - </button> - <?php else: ?> - <button class="mdc-button mdc-button--outlined" id="loginwith-authkey" <?php if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/authkey")) { echo("disabled"); } else { echo('onclick="enableAuthKey();"'); } ?>> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">fingerprint</i> - <span class="mdc-button__label"><?= $lang["admin-login"]["modes"][1] ?></span> - </button> - <?php endif; ?> - </div> - <script>useAuthKey = false;</script> - - <div id="login-password"> - <div class="nd_Field fallback nd_Field_input" id="searchbox"> - <input id="password-box" type="password" placeholder="<?= $lang["admin-login"]["password"] ?>" spellcheck="false" autocomplete="off"> - </div> - </div> - - <div id="login-authkey" style="display:none;"> - <div class="nd_Field fallback nd_Field_input" id="searchbox"> - <input id="authkey-box" type="password" placeholder="<?= $lang["admin-login"]["key"] ?>" spellcheck="false" autocomplete="off"> - </div> - </div> - - <button class="mdc-button mdc-button--raised" id="loginwith-password" onclick="loginConfirm();"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-login"]["confirm"] ?></span> - </button> - - <p> - <small id="links"> - <a onclick="window.parent.location.href = '<?= $GLOBALS["SYSTEM_ROOT"] ?>/';" class="sblink"> - <?= $lang["admin-login"]["back"] ?></a> - - <a onclick="window.open('<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/api/bugs') ?>');" target="_blank" class="sblink"> - <?= $lang["admin-login"]["report"] ?></a> - - <a onclick="window.open('<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/api/public') ?>');" class="sblink"> - <?= $lang["admin-login"]["branding"] ?></a> - </small> - </p> - </div> - </div> - </main> - </div> -</body> - -<script> - function alert(message) { - alert_full(message); - } - - function enableAuthKey() { - useAuthKey = true; - document.getElementById('loginwith-authkey').classList.remove('mdc-button--outlined'); - document.getElementById('loginwith-authkey').classList.add('mdc-button--raised'); - document.getElementById('loginwith-password').classList.remove('mdc-button--raised'); - document.getElementById('loginwith-password').classList.add('mdc-button--outlined'); - document.getElementById('login-password').style.display = "none"; - document.getElementById('login-authkey').style.display = ""; - document.getElementById('password-box').value = ""; - document.getElementById('authkey-box').value = ""; - document.getElementById('authkey-box').focus(); - } - - function disableAuthKey() { - useAuthKey = false; - document.getElementById('loginwith-authkey').classList.add('mdc-button--outlined'); - document.getElementById('loginwith-authkey').classList.remove('mdc-button--raised'); - document.getElementById('loginwith-password').classList.add('mdc-button--raised'); - document.getElementById('loginwith-password').classList.remove('mdc-button--outlined'); - document.getElementById('login-password').style.display = ""; - document.getElementById('login-authkey').style.display = "none"; - document.getElementById('password-box').value = ""; - document.getElementById('authkey-box').value = ""; - document.getElementById('password-box').focus(); - } - - function loginConfirm() { - $("#loader").fadeIn(200); - var formData = new FormData(); - if (useAuthKey) { - formData.append("password", document.getElementById('authkey-box').value); - formData.append("authkey", "1"); - } else { - formData.append("password", document.getElementById('password-box').value); - } - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/login.php", - success: function (data) { - $("#loader").fadeOut(200); - if (data == "ok") { - location.href = "<?= $callback ?>"; - } else { - alert(data) - } - }, - error: function (error) { - $("#loader").fadeOut(200); - alert("<?= $lang["admin-errors"]["connerror"] ?>") - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - } -</script> -</html>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/logout/index.php b/Neutron-trunk/cms-special/admin/logout/index.php index 5c51269..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/logout/index.php +++ b/Neutron-trunk/cms-special/admin/logout/index.php @@ -1,15 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_COOKIE['_NEUTRON_ADMIN_TOKEN']) && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != ".." && $_COOKIE['_NEUTRON_ADMIN_TOKEN'] != "/") { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $_COOKIE['_NEUTRON_ADMIN_TOKEN'])) { - $tokens = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/tokens"); - foreach ($tokens as $token) { - if ($token == "." || $token == "..") {} else { - unlink($_SERVER['DOCUMENT_ROOT'] . "/data/tokens/" . $token); - } - } - } -} -header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/login"); -require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit();
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/logs/index.php b/Neutron-trunk/cms-special/admin/logs/index.php index b653ad0..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/logs/index.php +++ b/Neutron-trunk/cms-special/admin/logs/index.php @@ -1,17 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Historique d'activité", "headerName" => "Historique d'activité" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="logs"> - <?php - - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log")) { - $file = file($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log"); - for ($i = max(0, count($file)-100); $i < count($file); $i++) { - echo $file[$i] . "<br>"; - } - } else { - echo($lang["admin-logs"]["nothing"][0] . "<br><br>" . $lang["admin-logs"]["nothing"][1]); - } - - ?> - </div><br><br> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/add/index.php b/Neutron-trunk/cms-special/admin/pages/add/index.php index 54dacdb..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/add/index.php +++ b/Neutron-trunk/cms-special/admin/pages/add/index.php @@ -1,145 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Nouvelle page - Pages", "headerName" => "Nouvelle page" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <p> - <form name="settings"> - <div class="nd_Field nd_Field_input nd_Field__centered" id="namebox"> - <input id="name" name="name" type="text" placeholder="<?= $lang["admin-pages"]["pagename"] ?>" spellcheck="false" autocomplete="off"> - <label for="name"><?= $lang["admin-pages"]["pagename"] ?></label> - </div><br> - <input style="display:none;" type="radio" id="type-visual" value="visual" onchange="switchEditor()" name="type" checked> - <input style="display:none;" type="radio" id="type-html" onchange="switchEditor()" value="html" name="type"> - <div style="text-align: center;"><div id="ptype-visual" class="mdc-card mdc-card--outlined mdc-card--selected" onclick="document.getElementsByName('type')[0].value = 'visual';switchEditor();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-pages"]["editors"][0] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-pages"]["editordescs"][0] ?></h3> - </div> - </div> - </div> - <div id="ptype-html" class="mdc-card mdc-card--outlined" onclick="document.getElementsByName('type')[0].value = 'html';switchEditor();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-pages"]["editors"][1] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-pages"]["editordescs"][1] ?></h3> - </div> - </div> - </div></div> - </form> - </p> - <div id="editing"><div id="editor-visual"> - <?php - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/VisualEditor$2.php"; - ?></div> - <div id="editor-html" class="hide"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/CodeEditor$2.php" ?> - </div> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - window.onbeforeunload = function (e) { - e = e || window.event; - - // For IE and Firefox prior to version 4 - if (e) { - e.returnValue = "<?= $lang["admin-pages"]["quitwarn"] ?>"; - } - - // For Safari - return "<?= $lang["admin-pages"]["quitwarn"] ?>"; - }; -</script> - -<script> - -function createPageVisual() { - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", document.getElementById('name').value); - formData.append("type", "0"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/create_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function createPageVisualNoBack() { - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", document.getElementById('name').value); - formData.append("type", "0"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/create_page.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-pages"]["saved"] ?>"); - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function switchEditor() { - if (document.forms['settings'].type.value == "visual") { - document.getElementById('editor-visual').classList.remove('hide') - document.getElementById('editor-html').classList.add('hide') - document.getElementById('ptype-html').classList.remove('mdc-card--selected'); - document.getElementById('ptype-visual').classList.add('mdc-card--selected'); - } else { - document.getElementById('editor-visual').classList.add('hide') - document.getElementById('editor-html').classList.remove('hide') - document.getElementById('ptype-visual').classList.remove('mdc-card--selected'); - document.getElementById('ptype-html').classList.add('mdc-card--selected'); - loadAce() - } - document.body.focus(); -} - -document.forms['settings'].type.value = "visual" - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/delete/index.php b/Neutron-trunk/cms-special/admin/pages/delete/index.php index 4cbcb49..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/delete/index.php +++ b/Neutron-trunk/cms-special/admin/pages/delete/index.php @@ -1,88 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['slug'])) { - $currentSlug = $_GET['slug']; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $currentSlug)) {} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php - -if ($currentSlug == "index") { - $currentName = "{$lang["admin-pages"]["home"]}"; - echo("<script>page = \"index\"</script>"); -} else { - $currentName = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $currentSlug . "/pagename"); - echo("<script>page = \"{$currentSlug}\"</script>"); -} - -?> - <div id="confirm"> - <div style="text-align:center;"> - <p><?= $lang["admin-pages"]["deletec"][0] . $currentName . $lang["admin-pages"]["deletec"][1] ?></p> - <?php - - if ($currentSlug == "index") { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<i>{$lang["admin-pages"]["deletec"][2]}</i></div></body></html>"); - } - - ?> - <!--<ul> - <li><a onclick="deletePage()" class="sblink" title="<?= $lang["admin-pages"]["deleteyl"] ?>"><?= $lang["admin-pages"]["deletey"] ?></a></li> - <li><a onclick="location.href='/cms-special/admin/pages/manage/?slug=<?= $currentSlug ?>'" class="sblink" title="<?= $lang["admin-pages"]["deletenl"] ?>"><?= $lang["admin-pages"]["deleten"] ?></a></li> - </ul>--> - <a title="<?= $lang["admin-pages"]["deletenl"] ?>" onclick="location.href='/cms-special/admin/pages';" class="mdc-button mdc-button--raised"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["deleten"] ?></span> - </a> - <a title="<?= $lang["admin-pages"]["deleteyl"] ?>" onclick="deletePage();" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["deletey"] ?></span> - </a> - </div> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function deletePage() { - document.getElementById('confirm').classList.add('hide') - document.getElementById('loader').classList.remove('hide') - var formData = new FormData(); - formData.append("page", "<?= $currentSlug ?>"); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/delete_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/edit/index.php b/Neutron-trunk/cms-special/admin/pages/edit/index.php index b198566..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/edit/index.php +++ b/Neutron-trunk/cms-special/admin/pages/edit/index.php @@ -1,194 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['slug'])) { - $currentSlug = $_GET['slug']; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $currentSlug)) {} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="editing"> - <?php - - if ($currentSlug == "index") { - $currentName = "{$lang["admin-pages"]["home"]}"; - echo("<script>page = \"index\"</script>"); - } else { - $currentName = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $currentSlug . "/pagename"); - echo("<script>page = \"{$currentSlug}\"</script>"); - } - - $type = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $currentSlug); - if (isset($_GET['forcehtml'])) { - $type = "1"; - } - if ($type == "0") { - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/VisualEditor.php"; - } - if ($type == "1"): - - ?> - <p><table class="message_warning"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_warning.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-pages"]["htmlw"][0] ?></p><p><?= $lang["admin-pages"]["htmlw"][1] ?></p></td></tr></tbody></table></p> - <?php - - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/CodeEditor.php"; - endif; - - ?> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - window.onbeforeunload = function (e) { - e = e || window.event; - - // For IE and Firefox prior to version 4 - if (e) { - e.returnValue = "<?= $lang["admin-pages"]["quitwarn"] ?>"; - } - - // For Safari - return "<?= $lang["admin-pages"]["quitwarn"] ?>"; - }; -</script> - -<script> - -function updatePage() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - window.onbeforeunload = null; - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updatePageNoBack() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-pages"]["saved"] ?>"); - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updatePageHTMLNoBack() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", ace.edit("editor").getValue()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-pages"]["saved"] ?>"); - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updatePageHTML() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", ace.edit("editor").getValue()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/index.php b/Neutron-trunk/cms-special/admin/pages/index.php index d8e1e3d..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/index.php +++ b/Neutron-trunk/cms-special/admin/pages/index.php @@ -1,66 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Gestionnaire de pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - - <div class="admin-pages-list"> - <?php - - $pages = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/"); - $sizetotal = 0; - foreach ($pages as $page) { - if ($page != "." && $page != "..") { - $type = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $page); - $size = filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $page); - if ($size > 1024) { - if ($size > 1048576) { - $sizestr = round($size / 1048576, 2) . " " . $lang["sizes"]["mib"]; - } else { - $sizestr = round($size / 1024, 2) . " " . $lang["sizes"]["kib"]; - } - } else { - $sizestr = $size . " " . $lang["sizes"]["bytes"]; - } - $sizetotal = $sizetotal + $size; - $sizestr = str_replace(".", ",", $sizestr); - if ($page == "index"): ?> -<!-- echo("<li><a href='/cms-special/admin/pages/manage/?slug={$page}' class='sblink' title='{$lang['admin-pages']['lore']}'>{$lang['admin-pages']['home']}</a> ({$page}), {$typestr}, {$sizestr}</li>");--> - <div class="mdc-card mdc-card--outlined" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-pages"]["home"] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?php $text = strip_tags(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $page));if (strlen($text)>100){echo(substr($text,0,100) . " …");}else{echo($text);} ?></h3> - </div><br><br> - <div class="mdc-card__actions mdc-card__actions-pages-list"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/edit/?slug=<?= $page ?>" title="<?= $lang["admin-pages"]["editl"] ?>" class="mdc-button mdc-card__action mdc-card__action--button"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["edit"] ?></span> - </a> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/edit/?slug=<?= $page ?>&forcehtml" class="material-icons mdc-icon-button mdc-card__action mdc-card__action--icon mdi-icbtn-card" title="<?= $lang["admin-pages"]["editcode"] ?>">code</a> - </div> - </div> - <?php else: ?> - <div class="mdc-card mdc-card--outlined" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;" class="mdc-typography mdc-typography--headline6"><?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $page . "/pagename") ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?php $text = strip_tags(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $page));if (strlen($text)>100){echo(substr($text,0,100) . " …");}else{echo($text);} ?></h3> - </div><br><br> - <div class="mdc-card__actions mdc-card__actions-pages-list"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/edit/?slug=<?= $page ?>" title="<?= $lang["admin-pages"]["editl"] ?>" class="mdc-button mdc-card__action mdc-card__action--button"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["edit"] ?></span> - </a> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/rename/?slug=<?= $page ?>" class="material-icons mdc-icon-button mdc-card__action mdc-card__action--icon mdi-icbtn-card" title="<?= $lang["admin-pages"]["renamel"] ?>">create</a> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/delete/?slug=<?= $page ?>" class="material-icons mdc-icon-button mdc-card__action mdc-card__action--icon mdi-icbtn-card" title="<?= $lang["admin-pages"]["deletel"] ?>">delete</a> - </div> - </div> - <?php endif; - } - } - ?> - </div> - <p><div style="text-align: center;"> - <a title="<?= $lang["admin-pages"]["alore"] ?>" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/add" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">add</i> - <span class="mdc-button__label"><?= $lang["admin-pages"]["create"] ?></span> - </a> - </div></p> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/rename/index.php b/Neutron-trunk/cms-special/admin/pages/rename/index.php index d7118ba..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/rename/index.php +++ b/Neutron-trunk/cms-special/admin/pages/rename/index.php @@ -1,89 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['slug'])) { - $currentSlug = $_GET['slug']; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $currentSlug)) {} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php - -if ($currentSlug == "index") { - $currentName = "{$lang["admin-pages"]["home"]}"; - echo("<script>page = \"index\"</script>"); -} else { - $currentName = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $currentSlug . "/pagename"); - echo("<script>page = \"{$currentSlug}\"</script>"); -} - -?> - <div id="confirm"> - <p><?= $lang["admin-pages"]["renamew"][0] . $currentName . $lang["admin-pages"]["renamew"][1] ?></p> - <?php - - if ($currentSlug == "index") { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<i>{$lang["admin-pages"]["renamew"][2]}</i></div></body></html>"); - } - - ?> - <div class="nd_Field nd_Field_input nd_Field__centered nd_Field__disabled" id="onamebox"> - <input id="oldname" name="oldname" type="text" placeholder="<?= $lang["admin-pages"]["oname"] ?>" spellcheck="false" disabled autocomplete="off" value="<?= $currentName ?>"> - <label for="name"><?= $lang["admin-pages"]["oname"] ?></label> - </div><div class="nd_Field nd_Field_input nd_Field__centered" id="nnamebox"> - <input id="newname" name="newname" type="text" placeholder="<?= $lang["admin-pages"]["nname"] ?>" spellcheck="false" autocomplete="off" value="<?= $currentName ?>"> - <label for="name"><?= $lang["admin-pages"]["nname"] ?></label> - </div> - <p><div style="text-align: center;"> - <a title="<?= $lang["admin-pages"]["renamel2"] ?>" onclick="renamePage();" class="mdc-button mdc-button--raised"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">edit</i> - <span class="mdc-button__label"><?= $lang["admin-pages"]["rename2"] ?></span> - </a> - </div></p> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="/resources/image/loader.svg" class="loader"> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function renamePage() { - document.getElementById('confirm').classList.add('hide') - document.getElementById('loader').classList.remove('hide') - var formData = new FormData(); - formData.append("page", "<?= $currentSlug ?>"); - formData.append("newname", document.getElementById('newname').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/rename_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/plugins/index.php b/Neutron-trunk/cms-special/admin/plugins/index.php index 58be08f..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/plugins/index.php +++ b/Neutron-trunk/cms-special/admin/plugins/index.php @@ -1,79 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$pageConfig = [ "domName" => "Extensions", "headerName" => "Extensions" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <p><table class="message_info"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_info.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-plugins"]["newnotice"] ?></p></td></tr></tbody></table></p> - <?php - - $widgets = scandir($_SERVER['DOCUMENT_ROOT'] . "/widgets/"); - $json = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/widgets.json")); - foreach ($widgets as $widget) { - if ($widget != "." && $widget != ".." && $widget != ".htaccess") { - $config = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/widgets/" . $widget . "/feature.json")); - echo("<div class=\"widget\"><div id=\"header-{$widget}\" class=\"widget-header "); - if (array_search($widget, $json->list) === false) { - echo("disabled"); - } else { - echo("enabled"); - } - echo("\"><table><tbody><tr><td><label class=\"switch\"><input name=\"" . $widget . "\" type=\"checkbox\" onclick=\"updateWidgetStatus('" . $widget . "')\" onchange=\"updateWidgetStatus('" . $widget . "')\""); - if (array_search($widget, $json->list) === false) {} else { - echo(" checked"); - } - echo("><span class=\"slider round\"></span></label></td><td class=\"widget-header-info\"><b>" . getName($config) . "</b>"); - if (isset($config->config)) { - echo("<a href=\"" . $config->config . "\" title=\"" . $lang["admin-plugins"]["config"] . "\" class=\"configure_ext\"><img src=\"{$GLOBALS["SYSTEM_ROOT"]}/resources/image/ext-settings.svg\"></a>"); - } - echo("</td></tr></tbody></table></div><p>" . getDescription($config) . "</p>"); - echo("</div>"); - } - } - - ?> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function updateWidgetStatus(widget) { - checkbox = document.getElementsByName(widget)[0] - if (typeof checkbox == "undefined") {} else { - if (checkbox.checked) { - document.getElementById('header-' + widget).classList.remove('disabled'); - document.getElementById('header-' + widget).classList.add('enabled'); - } else { - document.getElementById('header-' + widget).classList.remove('enabled'); - document.getElementById('header-' + widget).classList.add('disabled'); - } - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - - var formData = new FormData(); - formData.append("element", widget); - formData.append("value", checkbox.checked.toString()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/widgets.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-plugins"]["saved"] ?>"); - setTimeout(() => { - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - }, 500) - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data); - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>"); - window.onbeforeunload = undefined; - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); - - } -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/reset/index.php b/Neutron-trunk/cms-special/admin/reset/index.php index efa215c..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/reset/index.php +++ b/Neutron-trunk/cms-special/admin/reset/index.php @@ -1,118 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Réinitialisation - Maintenance", "headerName" => "Réinitialisation" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="page-confirm"> - <div style="text-align: center;"><p><?= $lang["admin-housekeeping"]["disclaimer"][0] ?><ul><li><?= $lang["admin-housekeeping"]["disclaimer"][1] ?></li><li><?= $lang["admin-housekeeping"]["disclaimer"][2] ?></li><li><?= $lang["admin-housekeeping"]["disclaimer"][3] ?></li><li><?= $lang["admin-housekeeping"]["disclaimer"][4] ?></li></ul></p> - <p><b><?= $lang["admin-housekeeping"]["confirm"] ?></b></p><input id="confirm" onkeyup="validate()" onkeydown="validate()" onchange="validate()" type="text" placeholder="<?= $lang["admin-housekeeping"]["confirmboxph"] ?>"></div> - <p><div style="text-align: center;"><a onclick="confirmPass()" id="reset-confirm" class="hide button-dangerous"><?= $lang["admin-housekeeping"]["confirmbutton"] ?></a></div></p> - </div> - <div id="page-select" class="hide"> - <?= $lang["admin-housekeeping"]["select"][0] ?> - <p><table class="message_warning"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_warning.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-housekeeping"]["select"][1] ?></p></td></tr></tbody></table></p> - <div class="reset-option" onclick="resetKeep()"> - <b><?= $lang["admin-housekeeping"]["select"][2] ?></b> - <p><?= $lang["admin-housekeeping"]["select"][3] ?></p> - </div> - <div class="reset-option" onclick="resetClear()"> - <b><?= $lang["admin-housekeeping"]["select"][4] ?></b> - <p><?= $lang["admin-housekeeping"]["select"][5] ?></p> - </div> - </div> - </div> - <div class="hide" id="resetbox-placeholder"> - <div id="resetbox" class="centered"> - <p><?= $lang["admin-housekeeping"]["select"][6] ?></p> - <div id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div> - <p><small><?= $lang["admin-housekeeping"]["select"][7] ?><br><span id="reset-message">-</span></small></p> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function resetKeep() { - document.getElementById('reset-message').innerHTML = "<?= $lang["admin-housekeeping"]["select"][2] ?>" - progressbox(true) - var formData = new FormData(); - formData.append("keep", "1"); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/reset.php", - success: function (data) { - if (data == "ok") { - window.parent.location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/resetted"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data + "\n\n<?= $lang["admin-errors"]["housekeeping"][0] ?>") - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - progressbox(false) - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>\n\n<?= $lang["admin-errors"]["housekeeping"][1] ?>") - progressbox(false) - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function resetClear() { - document.getElementById('reset-message').innerHTML = "<?= $lang["admin-housekeeping"]["select"][4] ?>" - progressbox(true) - var formData = new FormData(); - formData.append("keep", "0"); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/reset.php", - success: function (data) { - if (data == "ok") { - window.parent.location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/resetted"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data + "\n\n<?= $lang["admin-errors"]["housekeeping"][0] ?>") - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - progressbox(false) - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>\n\n<?= $lang["admin-errors"]["housekeeping"][1] ?>") - progressbox(false) - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function progressbox(toggle) { - if (typeof toggle != "boolean") { - throw new TypeError("Argument 1 expected to be boolean, " + typeof toggle + " given") - } else { - if (toggle) { - $('#resetbox-placeholder').fadeIn(200) - document.getElementById('settings').classList.add('blurred') - } else { - $('#resetbox-placeholder').fadeOut(200) - document.getElementById('settings').classList.remove('blurred') - } - } -} - -function confirmPass() { - document.getElementById('page-confirm').classList.add('hide') - document.getElementById('page-select').classList.remove('hide') -} - -function validate() { - if (document.getElementById('confirm').value == "<?= trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename")) ?>") { - document.getElementById('reset-confirm').classList.remove('hide') - } else { - document.getElementById('reset-confirm').classList.add('hide') - } -} - -document.getElementById('confirm').value = "" - -</script> +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/resetted/index.php b/Neutron-trunk/cms-special/admin/resetted/index.php index 21fe104..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/resetted/index.php +++ b/Neutron-trunk/cms-special/admin/resetted/index.php @@ -1,21 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php ob_start();echo("<!--\n\n" . str_replace('%year%', date('Y'), file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/private/license")) . "\n\n-->") ?> - -<!DOCTYPE html> -<html lang="fr"> -<head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <meta http-equiv="X-UA-Compatible" content="ie=edge"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/fonts-import.css"> - <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/ui.css"> - <title>Neutron</title> -</head> -<body> - <div id="settings" class="centered"> - <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/resetted.png" height="64px" width="64px"> - <p><a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/" class="button">OK</a></p> - </div> -</body> -</html>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/stats/index.php b/Neutron-trunk/cms-special/admin/stats/index.php index 81b4b69..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/stats/index.php +++ b/Neutron-trunk/cms-special/admin/stats/index.php @@ -1,280 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Statistiques", "headerName" => "Statistiques" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats")) { echo("<h2>" . $lang["admin-stats"]["new"] . "</h2><p>" . $lang["admin-stats"]["notice"] . "</p>"); } ?> -<?php - -function gystat($year, $month, $showYear = false) { - global $lang; - - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . $year . "/" . $month)) { - - $files = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . $year . "/" . $month); - $cmonth = 0; - foreach ($files as $file) { - if ($file != "." && $file != "..") { - $count = count(explode("\n", trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . $year . "/" . $month . "/" . $file)))); - if ($count > 0) { - $cmonth = $cmonth + $count; - } - } - } - - if ($cmonth > 0) { - if ($cmonth > 1) { - if ($showYear) { - echo("<tr><td><b>{$lang["admin-stats"]["months"][$month - 1]} {$year}{$lang["admin-stats"]["separator"]}</b></td><td> {$cmonth}</td><td> {$lang["admin-stats"]["visits2"]}</td></tr>"); - } else { - echo("<tr><td><b>{$lang["admin-stats"]["months"][$month - 1]}{$lang["admin-stats"]["separator"]}</b></td><td> {$cmonth}</td><td> {$lang["admin-stats"]["visits2"]}</td></tr>"); - } - } else { - if ($showYear) { - echo("<tr><td><b>{$lang["admin-stats"]["months"][$month - 1]} {$year}{$lang["admin-stats"]["separator"]}</b></td><td> {$cmonth}</td><td> {$lang["admin-stats"]["visit1"]}</td></tr>"); - } else { - echo("<tr><td><b>{$lang["admin-stats"]["months"][$month - 1]}{$lang["admin-stats"]["separator"]}</b></td><td> {$cmonth}</td><td> {$lang["admin-stats"]["visit1"]}</td></tr>"); - } - } - } - } -} - -?> -<h3><?= $lang["admin-stats"]["thisMonth"]?></h3> -<table> - <tbody> - <?php - - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . date('Y') . "/" . date('m'))) { - $mtxt = $lang["admin-stats"]["monthslc"][date('m') - 1]; - - $files = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . date('Y') . "/" . date('m')); - foreach ($files as $file) { - if ($file != "." && $file != "..") { - $count = count(explode("\n", trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/newstats/" . date('Y') . "/" . date('m') . "/" . $file)))); - if ($count > 0) { - $day = (int)trim($file); - if ($count > 1) { - echo("<tr><td><b>{$day} {$mtxt}{$lang["admin-stats"]["separator"]}</b></td><td> {$count}</td><td> {$lang["admin-stats"]["visits2"]}</td></tr>"); - } else { - echo("<tr><td><b>{$day} {$mtxt}{$lang["admin-stats"]["separator"]}</b></td><td> {$count}</td><td> {$lang["admin-stats"]["visit1"]}</td></tr>"); - } - } - } - } - } - - ?> - </tbody> -</table> - -<h3><?= $lang["admin-stats"]["year"]?></h3> -<table> - <tbody> - <?php - - gystat(date('Y'), "01", false); - gystat(date('Y'), "02", false); - gystat(date('Y'), "03", false); - gystat(date('Y'), "04", false); - gystat(date('Y'), "05", false); - gystat(date('Y'), "06", false); - gystat(date('Y'), "07", false); - gystat(date('Y'), "08", false); - gystat(date('Y'), "09", false); - gystat(date('Y'), "10", false); - gystat(date('Y'), "11", false); - gystat(date('Y'), "12", false); - - ?> - </tbody> -</table> - -<h3><?= $lang["admin-stats"]["last2"]?><?= date('Y') - 1 ?></h3> -<table> - <tbody> - <?php - - gystat(date('Y') - 1, "1", true); - gystat(date('Y') - 1, "2", true); - gystat(date('Y') - 1, "3", true); - gystat(date('Y') - 1, "4", true); - gystat(date('Y') - 1, "5", true); - gystat(date('Y') - 1, "6", true); - gystat(date('Y') - 1, "7", true); - gystat(date('Y') - 1, "8", true); - gystat(date('Y') - 1, "9", true); - gystat(date('Y') - 1, "10", true); - gystat(date('Y') - 1, "11", true); - gystat(date('Y') - 1, "12", true); - - ?> - </tbody> -</table> - -<?php if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats")): ?> -<hr style="border-top:none;"> -<h2><?= $lang["admin-stats"]["old"] ?></h2> -<p><?= $lang["admin-stats"]["notice"] ?></p> - <h3><?= $lang["admin-stats"]["thisMonth"]?></h3> -<table><tbody><?php - -$dates = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats"); -foreach ($dates as $date) { - if ($date != "." && $date != "..") { - if (startsWith($date, date("Y-m-"))) { - $newdate = str_replace(date("Y-m-"), "", $date); - $newdatestr = $newdate . date("/m/Y"); - echo("<tr><td><b>{$newdatestr}{$lang["admin-stats"]["separator"]}</b></td><td>" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $date) . "</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - } - } -} - -?> -</tbody></table> - <h3><?= $lang["admin-stats"]["year"] ?></h3> - <table> - <tbody> - <?php - - $visits = []; - $visits['01'] = 0; - $visits['02'] = 0; - $visits['03'] = 0; - $visits['04'] = 0; - $visits['05'] = 0; - $visits['06'] = 0; - $visits['07'] = 0; - $visits['08'] = 0; - $visits['09'] = 0; - $visits['10'] = 0; - $visits['11'] = 0; - $visits['12'] = 0; - $lists = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats"); - foreach ($lists as $list) { - if (startsWith($list, date("Y") . "-01")) { - $visits['01'] = $visits['01'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-02")) { - $visits['02'] = $visits['02'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-03")) { - $visits['03'] = $visits['03'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-04")) { - $visits['04'] = $visits['04'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-05")) { - $visits['05'] = $visits['05'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-06")) { - $visits['06'] = $visits['06'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-07")) { - $visits['07'] = $visits['07'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-08")) { - $visits['08'] = $visits['08'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-09")) { - $visits['09'] = $visits['09'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-10")) { - $visits['10'] = $visits['10'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-11")) { - $visits['11'] = $visits['11'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, date("Y") . "-12")) { - $visits['12'] = $visits['12'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - } - - echo("<tr><td><b>{$lang["admin-stats"]["months"][0]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['01']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][1]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['02']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][2]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['03']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][3]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['04']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][4]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['05']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][5]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['06']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][6]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['07']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][7]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['08']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][8]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['09']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][9]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['10']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][10]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['11']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][11]}{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['12']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - ?> - </tbody> - </table> - <h3><?= $lang["admin-stats"]["last"] ?></h3> - <table> - <tbody> - <?php - - $visits = []; - $visits['01'] = 0; - $visits['02'] = 0; - $visits['03'] = 0; - $visits['04'] = 0; - $visits['05'] = 0; - $visits['06'] = 0; - $visits['07'] = 0; - $visits['08'] = 0; - $visits['09'] = 0; - $visits['10'] = 0; - $visits['11'] = 0; - $visits['12'] = 0; - $lists = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats"); - foreach ($lists as $list) { - if (startsWith($list, ((int)date("Y") - 1) . "-01")) { - $visits['01'] = $visits['01'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-02")) { - $visits['02'] = $visits['02'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-03")) { - $visits['03'] = $visits['03'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-04")) { - $visits['04'] = $visits['04'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-05")) { - $visits['05'] = $visits['05'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-06")) { - $visits['06'] = $visits['06'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-07")) { - $visits['07'] = $visits['07'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-08")) { - $visits['08'] = $visits['08'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-09")) { - $visits['09'] = $visits['09'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-10")) { - $visits['10'] = $visits['10'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-11")) { - $visits['11'] = $visits['11'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - if (startsWith($list, ((int)date("Y") - 1) . "-12")) { - $visits['12'] = $visits['12'] + (int)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/stats/" . $list); - } - } - - echo("<tr><td><b>{$lang["admin-stats"]["months"][0]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['01']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][1]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['02']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][2]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['03']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][3]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['04']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][4]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['05']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][5]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['06']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][6]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['07']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][7]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['08']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][8]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['09']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][9]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['10']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][10]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['11']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - echo("<tr><td><b>{$lang["admin-stats"]["months"][11]} " . ((int)date("Y") - 1) . "{$lang["admin-stats"]["separator"]}</b></td><td>{$visits['12']}</td><td> {$lang["admin-stats"]["visits"]}</td></tr>"); - ?> - </tbody> - </table> - <?php endif; ?> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/widgets/index.php b/Neutron-trunk/cms-special/admin/widgets/index.php index ed6d9db..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/widgets/index.php +++ b/Neutron-trunk/cms-special/admin/widgets/index.php @@ -1,5 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/plugins"); -require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit();
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file |