aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/cms-special
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-24 15:38:16 +0200
committerMinteck <nekostarfan@gmail.com>2021-08-24 15:38:16 +0200
commit529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch)
tree8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/cms-special
parent15e4724761c50b30803df1811a525c85058f70bf (diff)
downloadelectrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz
electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2
electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip
Update
Diffstat (limited to 'Neutron-trunk/cms-special')
-rw-r--r--Neutron-trunk/cms-special/.htaccess4
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$panes/system.php51
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/admin.js16
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/common.css523
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/header.php0
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/index-auto.css3
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/index-dark.css45
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/index.css31
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/postcontent.php6
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/precontent.php223
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/responsive.css31
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/spotlight-test.php14
-rw-r--r--Neutron-trunk/cms-special/admin-v2/$resources/spotlight.php24
-rw-r--r--Neutron-trunk/cms-special/admin-v2/.htaccess4
-rw-r--r--Neutron-trunk/cms-special/admin-v2/about/index.php116
-rw-r--r--Neutron-trunk/cms-special/admin-v2/advanced/index.php8
-rw-r--r--Neutron-trunk/cms-special/admin-v2/advanced/jsonconf/index.php59
-rw-r--r--Neutron-trunk/cms-special/admin-v2/appearance/index.php253
-rw-r--r--Neutron-trunk/cms-special/admin-v2/calendar/add/index.php140
-rw-r--r--Neutron-trunk/cms-special/admin-v2/calendar/index.php86
-rw-r--r--Neutron-trunk/cms-special/admin-v2/calendar/manage/index.php78
-rw-r--r--Neutron-trunk/cms-special/admin-v2/customization/index.php214
-rw-r--r--Neutron-trunk/cms-special/admin-v2/error/index.php11
-rw-r--r--Neutron-trunk/cms-special/admin-v2/flags/index.php75
-rw-r--r--Neutron-trunk/cms-special/admin-v2/galery/addcategory/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin-v2/galery/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin-v2/galery/publish/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin-v2/gallery/addcategory/index.php39
-rw-r--r--Neutron-trunk/cms-special/admin-v2/gallery/index.php218
-rw-r--r--Neutron-trunk/cms-special/admin-v2/gallery/publish/index.php57
-rw-r--r--Neutron-trunk/cms-special/admin-v2/home/all/db.json178
-rw-r--r--Neutron-trunk/cms-special/admin-v2/home/all/index.php4
-rw-r--r--Neutron-trunk/cms-special/admin-v2/home/appearance/index.php45
-rw-r--r--Neutron-trunk/cms-special/admin-v2/home/data/index.php27
-rw-r--r--Neutron-trunk/cms-special/admin-v2/home/housekeeping/index.php27
-rw-r--r--Neutron-trunk/cms-special/admin-v2/home/index.php58
-rw-r--r--Neutron-trunk/cms-special/admin-v2/housekeeping/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin-v2/housekeeping/reset/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin-v2/index.php126
-rw-r--r--Neutron-trunk/cms-special/admin-v2/language/index.php57
-rw-r--r--Neutron-trunk/cms-special/admin-v2/login-old/index.php122
-rw-r--r--Neutron-trunk/cms-special/admin-v2/login/index.php219
-rw-r--r--Neutron-trunk/cms-special/admin-v2/logout/index.php15
-rw-r--r--Neutron-trunk/cms-special/admin-v2/logs/index.php17
-rw-r--r--Neutron-trunk/cms-special/admin-v2/pages/add/index.php145
-rw-r--r--Neutron-trunk/cms-special/admin-v2/pages/delete/index.php88
-rw-r--r--Neutron-trunk/cms-special/admin-v2/pages/edit/index.php194
-rw-r--r--Neutron-trunk/cms-special/admin-v2/pages/index.php66
-rw-r--r--Neutron-trunk/cms-special/admin-v2/pages/rename/index.php89
-rw-r--r--Neutron-trunk/cms-special/admin-v2/plugins/index.php79
-rw-r--r--Neutron-trunk/cms-special/admin-v2/reset/index.php118
-rw-r--r--Neutron-trunk/cms-special/admin-v2/resetted/index.php21
-rw-r--r--Neutron-trunk/cms-special/admin-v2/stats/index.php280
-rw-r--r--Neutron-trunk/cms-special/admin-v2/widgets/index.php5
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/admin.js16
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/common.css523
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/header.php0
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/index-auto.css3
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/index-dark.css45
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/index.css31
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/postcontent.php6
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/precontent.php223
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/responsive.css31
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/spotlight-test.php14
-rw-r--r--Neutron-trunk/cms-special/admin/$resources/spotlight.php24
-rw-r--r--Neutron-trunk/cms-special/admin/.htaccess4
-rw-r--r--Neutron-trunk/cms-special/admin/about/index.php116
-rw-r--r--Neutron-trunk/cms-special/admin/advanced/index.php8
-rw-r--r--Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php59
-rw-r--r--Neutron-trunk/cms-special/admin/appearance/index.php253
-rw-r--r--Neutron-trunk/cms-special/admin/calendar/add/index.php140
-rw-r--r--Neutron-trunk/cms-special/admin/calendar/index.php86
-rw-r--r--Neutron-trunk/cms-special/admin/calendar/manage/index.php78
-rw-r--r--Neutron-trunk/cms-special/admin/customization/index.php214
-rw-r--r--Neutron-trunk/cms-special/admin/error/index.php11
-rw-r--r--Neutron-trunk/cms-special/admin/flags/index.php75
-rw-r--r--Neutron-trunk/cms-special/admin/galery/addcategory/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin/galery/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin/galery/publish/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin/gallery/addcategory/index.php39
-rw-r--r--Neutron-trunk/cms-special/admin/gallery/index.php218
-rw-r--r--Neutron-trunk/cms-special/admin/gallery/publish/index.php57
-rw-r--r--Neutron-trunk/cms-special/admin/home/all/db.json178
-rw-r--r--Neutron-trunk/cms-special/admin/home/all/index.php4
-rw-r--r--Neutron-trunk/cms-special/admin/home/appearance/index.php45
-rw-r--r--Neutron-trunk/cms-special/admin/home/data/index.php27
-rw-r--r--Neutron-trunk/cms-special/admin/home/housekeeping/index.php27
-rw-r--r--Neutron-trunk/cms-special/admin/home/index.php58
-rw-r--r--Neutron-trunk/cms-special/admin/housekeeping/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin/housekeeping/reset/index.php2
-rw-r--r--Neutron-trunk/cms-special/admin/index.php135
-rw-r--r--Neutron-trunk/cms-special/admin/language/index.php57
-rw-r--r--Neutron-trunk/cms-special/admin/login-old/index.php122
-rw-r--r--Neutron-trunk/cms-special/admin/login/index.php219
-rw-r--r--Neutron-trunk/cms-special/admin/logout/index.php15
-rw-r--r--Neutron-trunk/cms-special/admin/logs/index.php17
-rw-r--r--Neutron-trunk/cms-special/admin/pages/add/index.php145
-rw-r--r--Neutron-trunk/cms-special/admin/pages/delete/index.php88
-rw-r--r--Neutron-trunk/cms-special/admin/pages/edit/index.php194
-rw-r--r--Neutron-trunk/cms-special/admin/pages/index.php66
-rw-r--r--Neutron-trunk/cms-special/admin/pages/rename/index.php89
-rw-r--r--Neutron-trunk/cms-special/admin/plugins/index.php79
-rw-r--r--Neutron-trunk/cms-special/admin/reset/index.php118
-rw-r--r--Neutron-trunk/cms-special/admin/resetted/index.php21
-rw-r--r--Neutron-trunk/cms-special/admin/stats/index.php280
-rw-r--r--Neutron-trunk/cms-special/admin/widgets/index.php5
-rw-r--r--Neutron-trunk/cms-special/calendar/index.php159
-rw-r--r--Neutron-trunk/cms-special/error/index.php71
-rw-r--r--Neutron-trunk/cms-special/galery/index.php5
-rw-r--r--Neutron-trunk/cms-special/galery/preview/index.php5
-rw-r--r--Neutron-trunk/cms-special/gallery/index.php61
-rw-r--r--Neutron-trunk/cms-special/gallery/preview/index.php129
-rw-r--r--Neutron-trunk/cms-special/setup/index.php156
-rw-r--r--Neutron-trunk/cms-special/version/index.php36
114 files changed, 9214 insertions, 0 deletions
diff --git a/Neutron-trunk/cms-special/.htaccess b/Neutron-trunk/cms-special/.htaccess
new file mode 100644
index 0000000..bc839cb
--- /dev/null
+++ b/Neutron-trunk/cms-special/.htaccess
@@ -0,0 +1,4 @@
+ErrorDocument 401 /cms-special/error/?id=401&description=Accès%20refusé
+ErrorDocument 403 /cms-special/error/?id=403&description=Accès%20interdit
+ErrorDocument 404 /cms-special/error/?id=404&description=Ressource%20introuvable
+ErrorDocument 500 /cms-special/error/?id=500&description=Erreur%20interne \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$panes/system.php b/Neutron-trunk/cms-special/admin-v2/$panes/system.php
new file mode 100644
index 0000000..916f798
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$panes/system.php
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin_v2/main.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin_v2/inner.css">
+ <style>:root { --mpcms-banner: url(<?php
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/upload/banner.jpg")) {
+ echo('"' . $GLOBALS["SYSTEM_ROOT"] . '/resources/upload/banner.jpg"');
+ } else {
+ echo('"' . $GLOBALS["SYSTEM_ROOT"] . '/resources/image/default.jpg"');
+ }
+
+ ?>); }</style>
+ </head>
+
+ <body>
+ <div id="system-head">
+ <div id="system-head-banner">
+ <div id="system-head-banner-image"></div>
+ </div>
+ <div id="system-head-version">
+ <div>
+ <b>Neutron 10</b><br>
+ version <?= trim(file_get_contents($_SERVER["DOCUMENT_ROOT"] . "/api/prettyver")) ?>
+ </div>
+ </div>
+ </div>
+
+ <div id="inner-items">
+ <div class="inner-item">
+ <div class="inner-item-image-outer">
+ <img class="inner-item-image" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/about.png">
+ </div>
+ <div class="inner-item-text">
+ <div>
+ <span class="inner-item-title">About Neutron</span><br>
+ <span class="inner-item-description">View Neutron versions and data usage</span>
+ </div>
+ </div>
+ <div class="inner-item-enter-outer">
+ <img class="inner-item-enter" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/enter.png">
+ </div>
+ </div>
+ </div>
+ </body>
+
+</html> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/admin.js b/Neutron-trunk/cms-special/admin-v2/$resources/admin.js
new file mode 100644
index 0000000..bca683b
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/admin.js
@@ -0,0 +1,16 @@
+window.onscroll = () => {
+ // console.log("> Scroll");
+ if (window.scrollY >= 52 && !document.getElementById('portal-background').classList.contains('scrolled')) {
+ // console.log("> ADD");
+ document.getElementById('portal-background').classList.add('scrolled');
+ } else if (window.scrollY < 52 && document.getElementById('portal-background').classList.contains('scrolled')) {
+ // console.log("> REMOVE");
+ document.getElementById('portal-background').classList.remove('scrolled');
+ } else {
+ // console.log("> Nothing");
+ }
+}
+
+window.onbeforeunload = () => {
+ window.parent.$("#loader").fadeIn(200);
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/common.css b/Neutron-trunk/cms-special/admin-v2/$resources/common.css
new file mode 100644
index 0000000..3826747
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/common.css
@@ -0,0 +1,523 @@
+@import "./responsive.css";
+
+html, body {
+ margin: 0;
+ color: var(--mpc-text) !important;
+ background-color: var(--mpc-background);
+}
+
+.mdc-drawer {
+ color: var(--mpc-text) !important;
+ background-color: var(--mpc-menu-background) !important;
+ height: 100vh;
+ z-index: 99999999999 !important;
+}
+
+.mdc-drawer .mdc-list-item--activated .mdc-list-item__graphic {
+ color: var(--mpc-menu-selected) !important;
+}
+
+.mdc-list-item__graphic {
+ color: var(--mpc-icons) !important;
+}
+
+.mdc-list-group__subheader {
+ color: var(--mpc-menu-header) !important;
+}
+
+.mdc-drawer__subtitle {
+ color: var(--mpc-menu-subtitle) !important;
+}
+
+.mdc-drawer__title {
+ color: var(--mpc-text) !important;
+}
+
+.mdc-list-divider {
+ border-bottom-color: var(--mpc-separator);
+}
+
+.mdc-list-item__text {
+ color: var(--mpc-text);
+}
+
+.mdc-list-item.mdc-list-item--activated .mdc-list-item__text {
+ color: var(--mpc-menu-selected);
+}
+
+.ttdemo {
+ padding: 10px;
+ font-family: "CMS", "Ubuntu", "Roboto", "Google Sans", "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif !important;
+}
+
+* {
+ font-family: "CMS", "Ubuntu", "Roboto", "Google Sans", "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif;
+}
+
+span, p, body, div, h1, h2, h3, h4, h5, h6 {
+ font-family: "CMS", "Ubuntu", "Roboto", "Google Sans", "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif !important;
+}
+
+#main-content {
+ padding: 16px;
+ margin-top: 64px;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ overflow-y: auto;
+}
+
+html, body, #app-grid {
+ height: 100%;
+}
+
+#app-frame {
+ margin: -16px;
+ border: none;
+ width: calc(100% + 32px);
+ height: calc(100% + 32px);
+}
+
+.mdc-top-app-bar--fixed-adjust {
+ margin: 0;
+ padding: 0;
+ height: calc(100% - 64px);
+}
+
+.dualtitle-top {
+ margin-bottom: 4px;
+}
+
+.dualtitle-bottom {
+ margin-top: 4px;
+}
+
+.mdc-top-app-bar__section.mdc-top-app-bar__section--align-start > a {
+ color: inherit;
+ text-decoration: inherit;
+}
+
+code {
+ font-family: monospace
+}
+
+a {
+ color: slategray;
+}
+
+a:hover {
+ color: gray;
+}
+
+a:active {
+ color: lightgray;
+}
+
+.mdc-card__primary-action {
+ padding: 0 16px;
+}
+
+.mdc-icon-button.material-icons.mdc-card__action.mdc-card__action--icon--unbounded {
+ color: whitesmoke;
+}
+
+img[width="128px"] {
+ border-radius: 9999px;
+}
+
+.demo-card__primary {
+ display: grid;
+ grid-template-columns: 69.6px 1fr;
+}
+
+.ccard_p1 {
+ margin-left: -15px;
+ border-top-right-radius: 2px;
+ border-top-left-radius: 2px;
+ height: 100%;
+ background-size: 100%;
+}
+
+.ccard_p2 {
+ margin-left: 10px;
+}
+
+.ccard_p2 h2 {
+ margin-bottom: 0;
+}
+
+.ccard_p2 h3 {
+ margin-top: 0;
+}
+
+.card_link, .card_link:hover, .card_link:active {
+ color: var(--mpc-text);
+ text-decoration: none;
+}
+
+.mdc-list-item {
+ cursor: pointer;
+}
+
+.mdc-list-item > i {
+ transform: rotate(0deg);
+ transition: transform 500ms;
+}
+
+.mdc-list-item:hover > i {
+ transform: rotate(360deg) scale(125%);
+}
+
+.mdc-drawer__header {
+ background: linear-gradient(to bottom, var(--mpc-menu-background-image) 50%, var(--mpc-menu-background)), url('../../../resources/image/codename.jpg');
+ background-size: 100%;
+}
+
+.mdc-top-app-bar__row {
+ width: 100% !important;
+}
+
+#header-desktop {
+ height: 190px;
+ z-index: 2;
+}
+
+#app-grid {
+ z-index: 5;
+ position: absolute;
+ width: 100%;
+ top: 170px;
+}
+
+#main-content {
+ z-index: 5;
+ background: var(--mpc-background);
+ border-radius: 15px;
+ position: initial;
+ margin: 0;
+ min-height: 200px;
+}
+
+#portal-background {
+ position: fixed;
+ top: -20px;
+ left: -20px;
+ right: -20px;
+ height: 230px;
+ background-image: linear-gradient(to bottom, var(--mpc-menu-background-image) 50%, var(--mpc-menu-background-image)), url('../../../resources/image/codename.jpg');
+ background-size: 100%;
+ background-position: center;
+ transition: filter 200ms, background-size 200ms, background-image 200ms;
+ filter: none;
+}
+
+#portal-background.updates {
+ z-index: 2;
+}
+
+#portal-background.scrolled {
+ background-image: linear-gradient(to bottom, var(--mpc-menu-background-image-more) 50%, var(--mpc-menu-background-image-more)), url('../../../resources/image/codename.jpg');
+ filter: blur(5px);
+ background-size: 110%;
+}
+
+#header-desktop {
+ background: transparent;
+ color: var(--mpc-text);
+}
+
+.mdc-top-app-bar__section.mdc-top-app-bar__section--align-end .material-icons-outlined.mdc-top-app-bar__navigation-icon.mdc-icon-button {
+ color: var(--mpc-text);
+}
+
+#version-place {
+ position: absolute;
+ top: -20px;
+ font-size: 12px;
+ opacity: .5;
+}
+
+#language-selector {
+ position: absolute;
+ font-size: 18px;
+ opacity: .5;
+ left: 0;
+ top: 0;
+}
+
+#home-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+}
+
+.home-grid-item {
+ margin: 20px;
+}
+
+#home-grid-item-pages {
+ color: var(--mpc-home-pages);
+ --mpc-icons: var(--mpc-home-pages);
+}
+
+#home-grid-item-calendar {
+ color: var(--mpc-home-calendar);
+ --mpc-icons: var(--mpc-home-calendar);
+}
+
+#home-grid-item-gallery {
+ color: var(--mpc-home-gallery);
+ --mpc-icons: var(--mpc-home-gallery);
+}
+
+#home-grid-item-appearance {
+ color: var(--mpc-home-appearance);
+ --mpc-icons: var(--mpc-home-appearance);
+}
+
+#home-grid-item-data {
+ color: var(--mpc-home-data);
+ --mpc-icons: var(--mpc-home-data);
+}
+
+#home-grid-item-housekeeping {
+ color: var(--mpc-home-housekeeping);
+ --mpc-icons: var(--mpc-home-housekeeping);
+}
+
+.home-grid-item-button {
+ font-size: 64px;
+ width: 86px;
+ height: 86px;
+}
+
+a:not(.material-icons):not(.material-icons-outlined):not(.button):not(.spotlight-link) {
+ color: var(--codename-theme);
+ text-decoration-color: var(--codename-theme);
+}
+
+a:not(.material-icons):not(.material-icons-outlined):not(.button):active, a:not(.material-icons):not(.material-icons-outlined):not(.button):focus:not(.spotlight-link) {
+ opacity: .75;
+}
+
+.ck.ck-editor__main a {
+ color: inherit !important;
+ text-decoration-color: inherit !important;
+}
+
+.all-item-icon {
+ margin-right: 5px;
+ vertical-align: middle;
+}
+
+.all-item-text {
+ vertical-align: middle;
+}
+
+.all-item-link {
+ color: white !important;
+ text-decoration: none !important;
+}
+
+.nd_Field {
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+ min-width: 0;
+ position: relative;
+ margin: 1em 0;
+ border-radius: 4px;
+ -webkit-transition: border-color .25s;
+ transition: border-color .25s;
+ border: 1px solid var(--codename-theme);
+}
+
+.nd_Field input {
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.nd_Field input, .nd_Field select {
+ color: var(--mpc-text);
+}
+
+.nd_Field input[type="password"], .nd_Field input[type="text"] {
+ color: var(--mpc-text);
+}
+
+.nd_Field input, .nd_Field select, .nd_Field textarea {
+ font-weight: 400;
+ font-size: 1.4rem;
+ border: none;
+ border-radius: 4px;
+ padding: 8px 9px;
+ color: var(--mpc-text);
+ background-color: transparent;
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+ min-width: 0;
+}
+
+.nd_Field input[type="password"], .nd_Field input[type="text"], .nd_Field textarea {
+ background-color: transparent;
+ color: var(--mpc-text);
+}
+
+.nd_Field input[type="password"]::placeholder, .nd_Field input[type="text"]::placeholder, .nd_Field textarea::placeholder {
+ color: transparent;
+}
+
+.nd_Field.fallback input[type="password"]::placeholder, .nd_Field.fallback input[type="text"]::placeholder, .nd_Field.fallback textarea::placeholder {
+ color: var(--codename-theme);
+ opacity: 1;
+}
+
+.nd_Field input[type="password"], .nd_Field input[type="search"], .nd_Field input[type="text"] {
+ padding: 9px;
+ font-size: 14px;
+ font-weight: 600;
+ min-width: 0;
+}
+
+.nd_Field_labelAlwaysTopLeft label, .nd_Field input:focus + label, .nd_Field input:not(:placeholder-shown) + label, .nd_Field select + label, .nd_Field textarea:focus + label, .nd_Field textarea:not(:placeholder-shown) + label {
+ background-color: transparent;
+}
+
+.nd_Field_labelAlwaysTopLeft label, .nd_Field input:focus + label, .nd_Field input:not(:placeholder-shown) + label, .nd_Field select + label, .nd_Field textarea:focus + label, .nd_Field textarea:not(:placeholder-shown) + label {
+ -webkit-transition: font-size .25s ease-out 0s,color .25s ease-out 0s,top .25s ease-out 0s,background-color .25s ease-out 0s;
+ transition: font-size .25s ease-out 0s,width .25s ease-out 0s,color .25s ease-out 0s,top .25s ease-out 0s,background-color .25s ease-out 0s;
+ font-size: 14px;
+ top: -14px;
+ padding: 0 2px;
+ background-color: var(--mpc-background);
+ pointer-events: auto;
+}
+
+.nd_Field label {
+ width: 100%;
+ -webkit-transition: font-size .25s ease-out .1s,color .25s ease-out .1s,top .25s ease-out .1s,background-color .25s ease-out .1s;
+ transition: font-size .25s ease-out .1s,color .25s ease-out .1s,top .25s ease-out .1s,background-color .25s ease-out .1s;
+ color: var(--codename-theme);
+ background-color: transparent;
+ font-size: 14px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ margin: 7px 8px;
+ padding: 2px;
+ pointer-events: none;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ max-width: calc(100% - 20px);
+}
+
+#search {
+ width: 256px;
+}
+
+#searchbox {
+ width: 256px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.nd_Field input {
+ border: none !important;
+ font-weight: normal !important;
+}
+
+.search-match {
+ color: var(--codename-theme);
+ text-decoration: underline;
+}
+
+a.discreet, a.discreet:hover, a.discreet:active {
+ color: inherit !important;
+ text-decoration: none;
+}
+
+.updates-status {
+ font-size: 64px;
+}
+
+.separator {
+ border-bottom: none;
+ border-color: rgba(0, 0, 0, .5);
+}
+
+#updates-available {
+ background-color: rgba(211, 211, 0, 0.5);
+ text-align: center;
+ z-index: 999999;
+ position: relative;
+}
+
+.admin-pages-list {
+ display: grid;
+ grid-template-columns: 256px 256px 256px 256px 256px;
+ grid-column-gap: 20px;
+}
+
+@media (max-width: 1424px) {
+ .admin-pages-list {
+ grid-template-columns: 256px 256px 256px 256px;
+ }
+}
+
+@media (max-width: 968px) {
+ .admin-pages-list {
+ grid-template-columns: 256px 256px 256px;
+ }
+}
+
+@media (max-width: 712px) {
+ .admin-pages-list {
+ grid-template-columns: 256px 256px;
+ }
+}
+
+@media (max-width: 556px) {
+ .admin-pages-list {
+ grid-template-columns: 256px;
+ }
+}
+
+.mdc-card__actions-pages-list {
+ position: absolute;
+ bottom: 0;
+}
+
+.mdc-button--raised {
+ color: var(--mdc-theme-on-primary) !important;
+}
+
+.nd_Field, .nd_Field * {
+ outline: none;
+}
+
+.nd_Field input {
+ padding-top: 10px !important;
+}
+
+.nd_Field {
+ width: 256px;
+}
+
+.nd_Field label {
+ text-align: center;
+}
+
+.nd_Field__centered {
+ margin-right: auto;
+ margin-left: auto;
+}
+
+.nd_Field__disabled {
+ opacity: .5;
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/header.php b/Neutron-trunk/cms-special/admin-v2/$resources/header.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/header.php
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/index-auto.css b/Neutron-trunk/cms-special/admin-v2/$resources/index-auto.css
new file mode 100644
index 0000000..773eab9
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/index-auto.css
@@ -0,0 +1,3 @@
+@import url("./index.css") only screen and (prefers-color-scheme: light);
+@import url("./index.css") only screen and (prefers-color-scheme: no-preference);
+@import url("./index-dark.css") only screen and (prefers-color-scheme: dark); \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/index-dark.css b/Neutron-trunk/cms-special/admin-v2/$resources/index-dark.css
new file mode 100644
index 0000000..1683192
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/index-dark.css
@@ -0,0 +1,45 @@
+@import "./common.css";
+
+:root {
+ --mdc-theme-primary: var(--codename-theme);
+ --mdc-theme-secondary: var(--codename-secondary);
+ --mdc-theme-secondary-light: var(--codename-light);
+ --mdc-theme-on-primary: #ffffff;
+ --mdc-theme-on-secondary: white;
+ --mdc-theme-surface: rgb(44, 44, 44);
+ --mdc-theme-on-surface: whitesmoke;
+ --mpc-background: rgb(46, 46, 46);
+ --mpc-menu-background: rgb(22, 22, 22);
+ --mpc-menu-background-image: rgb(22, 22, 22, .5);
+ --mpc-menu-background-image-more: rgb(22, 22, 22, .75);
+ --mpc-text: whitesmoke;
+ --mpc-menu-selected: var(--mdc-theme-secondary-light);
+ --mpc-menu-header: rgb(223, 223, 223);
+ --mpc-menu-subtitle: rgb(182, 182, 182);
+ --mpc-icons: rgb(226, 226, 226);
+ --mpc-separator: rgb(138, 138, 138);
+
+ --mpc-home-pages: rgb(179, 229, 252);
+ --mpc-home-calendar: rgb(200, 230, 201);
+ --mpc-home-gallery: rgb(255, 205, 210);
+ --mpc-home-appearance: rgb(255, 249, 196);
+ --mpc-home-data: rgb(178, 223, 219);
+ --mpc-home-housekeeping: rgb(209, 196, 233);
+
+ --mpc-slse-hover1: rgba(255, 255, 255, 0.25);
+ --mpc-slse-hover2: rgba(255, 255, 255, 0.1);
+}
+
+/* --------------------- */
+
+.ck.ck-content {
+ background: #4a4a4a !important;
+}
+
+.message_img {
+ filter: invert(100%);
+}
+
+.mdi-icbtn-card {
+ color: rgba(255,255,255,1) !important;
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/index.css b/Neutron-trunk/cms-special/admin-v2/$resources/index.css
new file mode 100644
index 0000000..57dd995
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/index.css
@@ -0,0 +1,31 @@
+@import "./common.css";
+
+:root {
+ --mdc-theme-primary: var(--codename-theme);
+ --mdc-theme-secondary: var(--codename-secondary);
+ --mdc-theme-secondary-light: var(--codename-light);
+ --mdc-theme-on-primary: white;
+ --mdc-theme-on-secondary: white;
+ --mdc-theme-surface: rgb(238, 238, 238);
+ --mdc-theme-on-surface: #000000;
+ --mpc-background: rgb(255, 255, 255);
+ --mpc-menu-background: rgb(240, 240, 240);
+ --mpc-menu-background-image: rgb(240, 240, 240, .5);
+ --mpc-menu-background-image-more: rgb(240, 240, 240, .75);
+ --mpc-text: rgb(0, 0, 0);
+ --mpc-menu-selected: var(--mdc-theme-secondary-light);
+ --mpc-menu-header: rgb(80, 80, 80);
+ --mpc-menu-subtitle: rgb(34, 34, 34);
+ --mpc-icons: rgb(78, 78, 78);
+ --mpc-separator: rgb(202, 202, 202);
+
+ --mpc-home-pages: rgb(25, 118, 210);
+ --mpc-home-calendar: rgb(56, 142, 60);
+ --mpc-home-gallery: rgb(211, 47, 47);
+ --mpc-home-appearance: rgb(251, 192, 45);
+ --mpc-home-data: rgb(0, 121, 107);
+ --mpc-home-housekeeping: rgb(81, 45, 168);
+
+ --mpc-slse-hover1: rgba(0, 0, 0, 0.25);
+ --mpc-slse-hover2: rgba(0, 0, 0, 0.1);
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/postcontent.php b/Neutron-trunk/cms-special/admin-v2/$resources/postcontent.php
new file mode 100644
index 0000000..573a1d9
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/postcontent.php
@@ -0,0 +1,6 @@
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/debug.php";debugDump(); ?>
+ </div>
+</body>
+</html>
+
+<script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$resources/admin.js" charset="utf-8"></script> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/precontent.php b/Neutron-trunk/cms-special/admin-v2/$resources/precontent.php
new file mode 100644
index 0000000..af8d999
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/precontent.php
@@ -0,0 +1,223 @@
+<?php
+
+require $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php";
+
+$pageid = explode("/", $_SERVER['REQUEST_URI'])[3];
+if (isset(explode("/", $_SERVER['REQUEST_URI'])[4])) {
+ if (explode("/", $_SERVER['REQUEST_URI'])[4] != "index.php" && substr(explode("/", $_SERVER['REQUEST_URI'])[4], 0, 1) != "?" && substr(explode("/", $_SERVER['REQUEST_URI'])[4], 0, 1) != "#") {
+ if (isset($lang["admin-titles"][$pageid]['subpages'])) {
+ $subpageid = explode("/", $_SERVER['REQUEST_URI'])[4];
+ $subpageel = (array)$lang["admin-titles"][$pageid]['subpages'];
+ } else {
+ $subpageid = "";
+ }
+ } else {
+ $subpageid = "";
+ }
+} else {
+ $subpageid = "";
+}
+
+if (isset($lang["admin-titles"][$pageid])) {
+ if (isset($lang["admin-titles"][$pageid]['dom']) && isset($lang["admin-titles"][$pageid]['header'])) {
+ if (isset($lang["admin-titles"][$pageid]['subpages'])) {
+ if ($subpageid != "") {
+ $subpages = $lang["admin-titles"][$pageid]['subpages'];
+ if (isset($subpageel)) {
+ if (isset($subpageel[$subpageid])) {
+ $pageConfig = [ "domName" => $subpageel[$subpageid]['dom'] . " — " . $lang["admin-titles"][$pageid]['dom'], "headerName" => $subpageel[$subpageid]['header'] ];
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"]["fallback-subpages"] . " — " . $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"]["fallback-subpages"] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"]["fallback"]['dom'], "headerName" => $lang["admin-titles"]["fallback"]['header'] ];
+ }
+} else {
+ $pageConfig = [ "domName" => $lang["admin-titles"]["fallback"], "headerName" => $lang["admin-titles"]["fallback"] ];
+}
+
+$invalid = false;
+
+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'])) {
+
+ } 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>");
+ }
+} 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>");
+}
+
+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>");
+ return;
+ } else {
+ $invalid = true;
+ }
+}
+
+?>
+
+<?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;
+}
+
+function startsWith ($string, $startString) {
+ $len = strlen($startString);
+ return (substr($string, 0, $len) === $startString);
+}
+
+function getData(string $dir, $ignoreUploadDir = false) {
+ global $size;
+ $dircontent = scandir($dir);
+ foreach ($dircontent as $direl) {
+ if (($ignoreUploadDir && ($direl == "/upload" || $dir . "/" . $direl == $_SERVER['DOCUMENT_ROOT'] . "/resources/upload")) || $direl == ".git") {} else {
+ if ($direl == "." || $direl == "..") {} else {
+ if (is_link($dir . "/" . $direl)) {} else {
+ if (is_dir($dir . "/" . $direl)) {
+ getData($dir . "/" . $direl);
+ } else {
+ try {
+ $size = $size + filesize($dir . "/" . $direl);
+ } catch (Error $err) {}
+ }
+ }
+ }
+ }
+ }
+}
+
+function isJson(string $json) {
+ json_decode($json);
+ return (json_last_error() == JSON_ERROR_NONE);
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocessor.php";
+
+?>
+
+<!DOCTYPE html>
+<html>
+<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/fonts-import.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/alerts.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 ?>">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/spotlight.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css">
+ <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>
+ <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="<?= $_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">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documenthead.php"; ?>
+
+ <?php
+
+ if (!isset($loadEditor)) {
+ $loadEditor = true;
+ }
+
+ 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>');
+ }
+
+ ?>
+ <?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">');
+ } 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">');
+ } else {
+ echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/$resources/index.css">');
+ }
+ ?>
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.css">
+ <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.js"></script>
+ <title><?php
+
+ if ($ready) {
+ echo("{$lang["admin-titles"]["suffix"]} — " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename"));
+ } else {
+ echo("{$lang["admin-titles"]["suffix"]} — 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
+
+ getData($_SERVER['DOCUMENT_ROOT']);
+ $sizestr = $size . " " . $lang["sizes"]["bytes"];
+ if ($size > 1024) {
+ if ($size > 1048576) {
+ if ($size > 1073741824) {
+ $sizestr = round($size / 1073741824, 2) . " " . $lang["sizes"]["gib"];
+ } else {
+ $sizestr = round($size / 1048576, 2) . " " . $lang["sizes"]["mib"];
+ }
+ } else {
+ $sizestr = round($size / 1024, 2) . " " . $lang["sizes"]["kib"];
+ }
+ } else {
+ $sizestr = $size . " " . $lang["sizes"]["bytes"];
+ }
+ $sizestr = str_replace(".", $lang["sizes"]["separator"], $sizestr);
+
+ ?>
+</head>
+<body id="settings" style="overflow-x:hidden;">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/spotlight.php"; ?>
+ <?php
+
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documentbody.php";
+
+ $path = str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']);
+ $name = $pageConfig['headerName'];
+
+ ?>
+ <div id="admin">
+ <?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>");
+ $updatable = true;
+ } else {
+ $updatable = false;
+ }
+
+ ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/header.php"; ?> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/responsive.css b/Neutron-trunk/cms-special/admin-v2/$resources/responsive.css
new file mode 100644
index 0000000..75810b1
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/responsive.css
@@ -0,0 +1,31 @@
+@media (max-width: 500px) {
+ /* The following CSS will apply ONLY to smartphones or small screens */
+ .error-desktop {
+ display: none;
+ }
+ .error-mobile {
+ display: initial;
+ }
+ div#home-grid {
+ display: grid;
+ grid-template-columns: 1fr !important;
+ }
+}
+
+@media (max-width: 720px) {
+ /* The following CSS will apply ONLY to medium screens (less than 720p) */
+ #home-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr !important;
+ }
+}
+
+@media (min-width: 500px) {
+ /* The following CSS will NEVER apply to smartphones or small screens */
+ .error-desktop {
+ display: initial;
+ }
+ .error-mobile {
+ display: none;
+ }
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/spotlight-test.php b/Neutron-trunk/cms-special/admin-v2/$resources/spotlight-test.php
new file mode 100644
index 0000000..bffaa87
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/spotlight-test.php
@@ -0,0 +1,14 @@
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php"; ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Spotlight search test</title>
+ <link rel="stylesheet" href="/resources/css/spotlight.css">
+ <link rel="stylesheet" href="/resources/lib/material/iconfont.css">
+</head>
+<body>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/spotlight.php"; ?>
+</body>
+</html> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/$resources/spotlight.php b/Neutron-trunk/cms-special/admin-v2/$resources/spotlight.php
new file mode 100644
index 0000000..f803f52
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/$resources/spotlight.php
@@ -0,0 +1,24 @@
+<?php // Tutoriel utilisé : https://www.youtube.com/watch?v=5Y3Urj_DVMw
+?>
+<script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/spotlight.js" defer></script>
+
+<?php
+
+$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/home/all/db.json"));
+
+?>
+<ul class="spotlight-elements">
+ <?php foreach ($data as $category): ?>
+ <?php foreach ($category->items as $item): ?>
+ <li class="spotlight-element">
+ <a href="#/<?= $item->page ?>" cat="<?= $category->name ?>" icon="<?= $category->icon ?>" class="spotlight-link"><?= $lang["admin-home"]["allitems"][$item->id] ?></a>
+ </li>
+
+ <script>
+ sysroot = "<?= $GLOBALS["SYSTEM_ROOT"] ?>";
+ </script>
+ <?php endforeach; ?>
+ <?php endforeach; ?>
+</ul>
+<spotlight-bar target=".spotlight-elements a" placeholder="<?= $lang["spotlight"]["search"] ?>">
+</spotlight-bar> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/.htaccess b/Neutron-trunk/cms-special/admin-v2/.htaccess
new file mode 100644
index 0000000..90f6271
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/.htaccess
@@ -0,0 +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
diff --git a/Neutron-trunk/cms-special/admin-v2/about/index.php b/Neutron-trunk/cms-special/admin-v2/about/index.php
new file mode 100644
index 0000000..1551ff0
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/about/index.php
@@ -0,0 +1,116 @@
+<?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"; ?>
diff --git a/Neutron-trunk/cms-special/admin-v2/advanced/index.php b/Neutron-trunk/cms-special/admin-v2/advanced/index.php
new file mode 100644
index 0000000..ae80b96
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/advanced/index.php
@@ -0,0 +1,8 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/advanced/jsonconf/index.php b/Neutron-trunk/cms-special/admin-v2/advanced/jsonconf/index.php
new file mode 100644
index 0000000..f087b1c
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/advanced/jsonconf/index.php
@@ -0,0 +1,59 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/appearance/index.php b/Neutron-trunk/cms-special/admin-v2/appearance/index.php
new file mode 100644
index 0000000..22c5065
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/appearance/index.php
@@ -0,0 +1,253 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/calendar/add/index.php b/Neutron-trunk/cms-special/admin-v2/calendar/add/index.php
new file mode 100644
index 0000000..1029788
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/calendar/add/index.php
@@ -0,0 +1,140 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/calendar/index.php b/Neutron-trunk/cms-special/admin-v2/calendar/index.php
new file mode 100644
index 0000000..e596551
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/calendar/index.php
@@ -0,0 +1,86 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/calendar/manage/index.php b/Neutron-trunk/cms-special/admin-v2/calendar/manage/index.php
new file mode 100644
index 0000000..a6f4ebd
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/calendar/manage/index.php
@@ -0,0 +1,78 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/customization/index.php b/Neutron-trunk/cms-special/admin-v2/customization/index.php
new file mode 100644
index 0000000..66aee2f
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/customization/index.php
@@ -0,0 +1,214 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/error/index.php b/Neutron-trunk/cms-special/admin-v2/error/index.php
new file mode 100644
index 0000000..c68c6a6
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/error/index.php
@@ -0,0 +1,11 @@
+<?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"; ?>
diff --git a/Neutron-trunk/cms-special/admin-v2/flags/index.php b/Neutron-trunk/cms-special/admin-v2/flags/index.php
new file mode 100644
index 0000000..c243a49
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/flags/index.php
@@ -0,0 +1,75 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/galery/addcategory/index.php b/Neutron-trunk/cms-special/admin-v2/galery/addcategory/index.php
new file mode 100644
index 0000000..f2438e1
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/galery/addcategory/index.php
@@ -0,0 +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
diff --git a/Neutron-trunk/cms-special/admin-v2/galery/index.php b/Neutron-trunk/cms-special/admin-v2/galery/index.php
new file mode 100644
index 0000000..82ad59c
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/galery/index.php
@@ -0,0 +1,2 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/galery/publish/index.php b/Neutron-trunk/cms-special/admin-v2/galery/publish/index.php
new file mode 100644
index 0000000..ac5f616
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/galery/publish/index.php
@@ -0,0 +1,2 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/gallery/addcategory/index.php b/Neutron-trunk/cms-special/admin-v2/gallery/addcategory/index.php
new file mode 100644
index 0000000..68451fc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/gallery/addcategory/index.php
@@ -0,0 +1,39 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/gallery/index.php b/Neutron-trunk/cms-special/admin-v2/gallery/index.php
new file mode 100644
index 0000000..7623820
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/gallery/index.php
@@ -0,0 +1,218 @@
+<?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>
diff --git a/Neutron-trunk/cms-special/admin-v2/gallery/publish/index.php b/Neutron-trunk/cms-special/admin-v2/gallery/publish/index.php
new file mode 100644
index 0000000..e2768ac
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/gallery/publish/index.php
@@ -0,0 +1,57 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/home/all/db.json b/Neutron-trunk/cms-special/admin-v2/home/all/db.json
new file mode 100644
index 0000000..8a6ad37
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/home/all/db.json
@@ -0,0 +1,178 @@
+[
+ {
+ "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-v2/home/all/index.php b/Neutron-trunk/cms-special/admin-v2/home/all/index.php
new file mode 100644
index 0000000..f844070
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/home/all/index.php
@@ -0,0 +1,4 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/home/appearance/index.php b/Neutron-trunk/cms-special/admin-v2/home/appearance/index.php
new file mode 100644
index 0000000..318611a
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/home/appearance/index.php
@@ -0,0 +1,45 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/home/data/index.php b/Neutron-trunk/cms-special/admin-v2/home/data/index.php
new file mode 100644
index 0000000..29205dc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/home/data/index.php
@@ -0,0 +1,27 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/home/housekeeping/index.php b/Neutron-trunk/cms-special/admin-v2/home/housekeeping/index.php
new file mode 100644
index 0000000..8c0deae
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/home/housekeeping/index.php
@@ -0,0 +1,27 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/home/index.php b/Neutron-trunk/cms-special/admin-v2/home/index.php
new file mode 100644
index 0000000..327ab36
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/home/index.php
@@ -0,0 +1,58 @@
+<?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>
+ &nbsp;
+ <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>
+ &nbsp;
+ <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"; ?>
diff --git a/Neutron-trunk/cms-special/admin-v2/housekeeping/index.php b/Neutron-trunk/cms-special/admin-v2/housekeeping/index.php
new file mode 100644
index 0000000..a5d0bbc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/housekeeping/index.php
@@ -0,0 +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
diff --git a/Neutron-trunk/cms-special/admin-v2/housekeeping/reset/index.php b/Neutron-trunk/cms-special/admin-v2/housekeeping/reset/index.php
new file mode 100644
index 0000000..35b36d1
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/housekeeping/reset/index.php
@@ -0,0 +1,2 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/index.php b/Neutron-trunk/cms-special/admin-v2/index.php
new file mode 100644
index 0000000..55e029a
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/index.php
@@ -0,0 +1,126 @@
+<?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<!DOCTYPE html>
+<html>
+
+<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="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin_v2/main.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin_v2/navigation.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin_v2/iframe.css">
+ <?php if (strpos($_SERVER['HTTP_USER_AGENT'], "Chrome/")): ?>
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin_v2/chromium.css">
+ <style>:root { --mpcms-banner: url(<?php
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/upload/banner.jpg")) {
+ echo('"' . $GLOBALS["SYSTEM_ROOT"] . '/resources/upload/banner.jpg"');
+ } else {
+ echo('"' . $GLOBALS["SYSTEM_ROOT"] . '/resources/image/default.jpg"');
+ }
+
+ ?>); }</style>
+ <?php endif; ?>
+ <link rel="icon" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/siteicon.png">
+ <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/jquery.js"></script>
+</head>
+
+<body>
+ <div class="bg"></div>
+ <main>
+ <aside>
+ <div id="nav-header">
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/upload/siteicon.png" id="nav-header-icon">
+ <div id="nav-header-names-outer">
+ <div id="nav-header-names">
+ <b><?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename") ?></b><br>
+ <?php
+
+ if (file_exists($GLOBALS['ORIGINAL_DOCUMENT_ROOT'] . "/NeutronCloud")):
+ echo("Neutron Cloud X" . trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Tier")));
+ else:
+ echo("Neutron On-premises");
+ endif;
+
+ ?>
+ </div>
+ </div>
+ </div>
+ <div id="nav-items">
+ <div class="nav-item selected" data-pane="system">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/system.png" alt="">
+ <span class="nav-item-name">System</span>
+ </div>
+
+ <div class="nav-item" data-pane="content">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/content.png" alt="">
+ <span class="nav-item-name">Content</span>
+ </div>
+
+ <div class="nav-item" data-pane="personalization">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/personalization.png" alt="">
+ <span class="nav-item-name">Personalization</span>
+ </div>
+
+ <div class="nav-item" data-pane="features">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/features.png" alt="">
+ <span class="nav-item-name">Features</span>
+ </div>
+
+ <div class="nav-item" data-pane="accounts">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/accounts.png" alt="">
+ <span class="nav-item-name">Accounts</span>
+ </div>
+
+ <div class="nav-item" data-pane="language">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/language.png" alt="">
+ <span class="nav-item-name">Region & language</span>
+ </div>
+
+ <div class="nav-item" data-pane="security">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/security.png" alt="">
+ <span class="nav-item-name">Data & security</span>
+ </div>
+
+ <div class="nav-item" data-pane="maintenance">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/maintenance.png" alt="">
+ <span class="nav-item-name">Advanced options</span>
+ </div>
+
+ <div class="nav-item" data-pane="cloud">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/cloud.png" alt="">
+ <span class="nav-item-name">Neutron Cloud</span>
+ </div>
+
+ <div class="nav-item" data-pane="electrode">
+ <img class="nav-item-icon" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/admin2/electrode.png" alt="">
+ <span class="nav-item-name">Electrode Server</span>
+ </div>
+
+ <script>
+ Array.from(document.getElementsByClassName("nav-item")).forEach((item) => {
+ item.onclick = () => {
+ if (item.classList.contains("selected")) { return; }
+
+ Array.from(document.getElementsByClassName("nav-item")).forEach((i) => {
+ i.classList.remove("selected");
+ })
+ item.classList.add("selected")
+
+ document.getElementById("main-iframe").src = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$panes/" + item.getAttribute("data-pane") + ".php";
+ document.getElementById("main-title").innerText = item.children[1].innerText;
+ }
+ })
+ </script>
+ </div>
+ </aside>
+
+ <article id="main-content">
+ <span id="main-title">System</span>
+ <iframe id="main-iframe" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin-v2/$panes/system.php"></iframe>
+ </article>
+ </main>
+</body>
+
+</html> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin-v2/language/index.php b/Neutron-trunk/cms-special/admin-v2/language/index.php
new file mode 100644
index 0000000..4c16e04
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/language/index.php
@@ -0,0 +1,57 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/login-old/index.php b/Neutron-trunk/cms-special/admin-v2/login-old/index.php
new file mode 100644
index 0000000..d4428d7
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/login-old/index.php
@@ -0,0 +1,122 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/login/index.php b/Neutron-trunk/cms-special/admin-v2/login/index.php
new file mode 100644
index 0000000..57a1b6a
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/login/index.php
@@ -0,0 +1,219 @@
+<?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>
+ &nbsp;
+ <a onclick="window.open('<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/api/bugs') ?>');" target="_blank" class="sblink">
+ <?= $lang["admin-login"]["report"] ?></a>
+ &nbsp;
+ <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
diff --git a/Neutron-trunk/cms-special/admin-v2/logout/index.php b/Neutron-trunk/cms-special/admin-v2/logout/index.php
new file mode 100644
index 0000000..5c51269
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/logout/index.php
@@ -0,0 +1,15 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/logs/index.php b/Neutron-trunk/cms-special/admin-v2/logs/index.php
new file mode 100644
index 0000000..b653ad0
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/logs/index.php
@@ -0,0 +1,17 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/pages/add/index.php b/Neutron-trunk/cms-special/admin-v2/pages/add/index.php
new file mode 100644
index 0000000..54dacdb
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/pages/add/index.php
@@ -0,0 +1,145 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/pages/delete/index.php b/Neutron-trunk/cms-special/admin-v2/pages/delete/index.php
new file mode 100644
index 0000000..4cbcb49
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/pages/delete/index.php
@@ -0,0 +1,88 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/pages/edit/index.php b/Neutron-trunk/cms-special/admin-v2/pages/edit/index.php
new file mode 100644
index 0000000..b198566
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/pages/edit/index.php
@@ -0,0 +1,194 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/pages/index.php b/Neutron-trunk/cms-special/admin-v2/pages/index.php
new file mode 100644
index 0000000..d8e1e3d
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/pages/index.php
@@ -0,0 +1,66 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/pages/rename/index.php b/Neutron-trunk/cms-special/admin-v2/pages/rename/index.php
new file mode 100644
index 0000000..d7118ba
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/pages/rename/index.php
@@ -0,0 +1,89 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/plugins/index.php b/Neutron-trunk/cms-special/admin-v2/plugins/index.php
new file mode 100644
index 0000000..58be08f
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/plugins/index.php
@@ -0,0 +1,79 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/reset/index.php b/Neutron-trunk/cms-special/admin-v2/reset/index.php
new file mode 100644
index 0000000..efa215c
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/reset/index.php
@@ -0,0 +1,118 @@
+<?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>
diff --git a/Neutron-trunk/cms-special/admin-v2/resetted/index.php b/Neutron-trunk/cms-special/admin-v2/resetted/index.php
new file mode 100644
index 0000000..21fe104
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/resetted/index.php
@@ -0,0 +1,21 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/stats/index.php b/Neutron-trunk/cms-special/admin-v2/stats/index.php
new file mode 100644
index 0000000..81b4b69
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/stats/index.php
@@ -0,0 +1,280 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin-v2/widgets/index.php b/Neutron-trunk/cms-special/admin-v2/widgets/index.php
new file mode 100644
index 0000000..ed6d9db
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/widgets/index.php
@@ -0,0 +1,5 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/$resources/admin.js b/Neutron-trunk/cms-special/admin/$resources/admin.js
new file mode 100644
index 0000000..bca683b
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/admin.js
@@ -0,0 +1,16 @@
+window.onscroll = () => {
+ // console.log("> Scroll");
+ if (window.scrollY >= 52 && !document.getElementById('portal-background').classList.contains('scrolled')) {
+ // console.log("> ADD");
+ document.getElementById('portal-background').classList.add('scrolled');
+ } else if (window.scrollY < 52 && document.getElementById('portal-background').classList.contains('scrolled')) {
+ // console.log("> REMOVE");
+ document.getElementById('portal-background').classList.remove('scrolled');
+ } else {
+ // console.log("> Nothing");
+ }
+}
+
+window.onbeforeunload = () => {
+ window.parent.$("#loader").fadeIn(200);
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/$resources/common.css b/Neutron-trunk/cms-special/admin/$resources/common.css
new file mode 100644
index 0000000..3826747
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/common.css
@@ -0,0 +1,523 @@
+@import "./responsive.css";
+
+html, body {
+ margin: 0;
+ color: var(--mpc-text) !important;
+ background-color: var(--mpc-background);
+}
+
+.mdc-drawer {
+ color: var(--mpc-text) !important;
+ background-color: var(--mpc-menu-background) !important;
+ height: 100vh;
+ z-index: 99999999999 !important;
+}
+
+.mdc-drawer .mdc-list-item--activated .mdc-list-item__graphic {
+ color: var(--mpc-menu-selected) !important;
+}
+
+.mdc-list-item__graphic {
+ color: var(--mpc-icons) !important;
+}
+
+.mdc-list-group__subheader {
+ color: var(--mpc-menu-header) !important;
+}
+
+.mdc-drawer__subtitle {
+ color: var(--mpc-menu-subtitle) !important;
+}
+
+.mdc-drawer__title {
+ color: var(--mpc-text) !important;
+}
+
+.mdc-list-divider {
+ border-bottom-color: var(--mpc-separator);
+}
+
+.mdc-list-item__text {
+ color: var(--mpc-text);
+}
+
+.mdc-list-item.mdc-list-item--activated .mdc-list-item__text {
+ color: var(--mpc-menu-selected);
+}
+
+.ttdemo {
+ padding: 10px;
+ font-family: "CMS", "Ubuntu", "Roboto", "Google Sans", "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif !important;
+}
+
+* {
+ font-family: "CMS", "Ubuntu", "Roboto", "Google Sans", "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif;
+}
+
+span, p, body, div, h1, h2, h3, h4, h5, h6 {
+ font-family: "CMS", "Ubuntu", "Roboto", "Google Sans", "Segoe UI", "Noto Sans", Tahoma, Geneva, Verdana, sans-serif !important;
+}
+
+#main-content {
+ padding: 16px;
+ margin-top: 64px;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ overflow-y: auto;
+}
+
+html, body, #app-grid {
+ height: 100%;
+}
+
+#app-frame {
+ margin: -16px;
+ border: none;
+ width: calc(100% + 32px);
+ height: calc(100% + 32px);
+}
+
+.mdc-top-app-bar--fixed-adjust {
+ margin: 0;
+ padding: 0;
+ height: calc(100% - 64px);
+}
+
+.dualtitle-top {
+ margin-bottom: 4px;
+}
+
+.dualtitle-bottom {
+ margin-top: 4px;
+}
+
+.mdc-top-app-bar__section.mdc-top-app-bar__section--align-start > a {
+ color: inherit;
+ text-decoration: inherit;
+}
+
+code {
+ font-family: monospace
+}
+
+a {
+ color: slategray;
+}
+
+a:hover {
+ color: gray;
+}
+
+a:active {
+ color: lightgray;
+}
+
+.mdc-card__primary-action {
+ padding: 0 16px;
+}
+
+.mdc-icon-button.material-icons.mdc-card__action.mdc-card__action--icon--unbounded {
+ color: whitesmoke;
+}
+
+img[width="128px"] {
+ border-radius: 9999px;
+}
+
+.demo-card__primary {
+ display: grid;
+ grid-template-columns: 69.6px 1fr;
+}
+
+.ccard_p1 {
+ margin-left: -15px;
+ border-top-right-radius: 2px;
+ border-top-left-radius: 2px;
+ height: 100%;
+ background-size: 100%;
+}
+
+.ccard_p2 {
+ margin-left: 10px;
+}
+
+.ccard_p2 h2 {
+ margin-bottom: 0;
+}
+
+.ccard_p2 h3 {
+ margin-top: 0;
+}
+
+.card_link, .card_link:hover, .card_link:active {
+ color: var(--mpc-text);
+ text-decoration: none;
+}
+
+.mdc-list-item {
+ cursor: pointer;
+}
+
+.mdc-list-item > i {
+ transform: rotate(0deg);
+ transition: transform 500ms;
+}
+
+.mdc-list-item:hover > i {
+ transform: rotate(360deg) scale(125%);
+}
+
+.mdc-drawer__header {
+ background: linear-gradient(to bottom, var(--mpc-menu-background-image) 50%, var(--mpc-menu-background)), url('../../../resources/image/codename.jpg');
+ background-size: 100%;
+}
+
+.mdc-top-app-bar__row {
+ width: 100% !important;
+}
+
+#header-desktop {
+ height: 190px;
+ z-index: 2;
+}
+
+#app-grid {
+ z-index: 5;
+ position: absolute;
+ width: 100%;
+ top: 170px;
+}
+
+#main-content {
+ z-index: 5;
+ background: var(--mpc-background);
+ border-radius: 15px;
+ position: initial;
+ margin: 0;
+ min-height: 200px;
+}
+
+#portal-background {
+ position: fixed;
+ top: -20px;
+ left: -20px;
+ right: -20px;
+ height: 230px;
+ background-image: linear-gradient(to bottom, var(--mpc-menu-background-image) 50%, var(--mpc-menu-background-image)), url('../../../resources/image/codename.jpg');
+ background-size: 100%;
+ background-position: center;
+ transition: filter 200ms, background-size 200ms, background-image 200ms;
+ filter: none;
+}
+
+#portal-background.updates {
+ z-index: 2;
+}
+
+#portal-background.scrolled {
+ background-image: linear-gradient(to bottom, var(--mpc-menu-background-image-more) 50%, var(--mpc-menu-background-image-more)), url('../../../resources/image/codename.jpg');
+ filter: blur(5px);
+ background-size: 110%;
+}
+
+#header-desktop {
+ background: transparent;
+ color: var(--mpc-text);
+}
+
+.mdc-top-app-bar__section.mdc-top-app-bar__section--align-end .material-icons-outlined.mdc-top-app-bar__navigation-icon.mdc-icon-button {
+ color: var(--mpc-text);
+}
+
+#version-place {
+ position: absolute;
+ top: -20px;
+ font-size: 12px;
+ opacity: .5;
+}
+
+#language-selector {
+ position: absolute;
+ font-size: 18px;
+ opacity: .5;
+ left: 0;
+ top: 0;
+}
+
+#home-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+}
+
+.home-grid-item {
+ margin: 20px;
+}
+
+#home-grid-item-pages {
+ color: var(--mpc-home-pages);
+ --mpc-icons: var(--mpc-home-pages);
+}
+
+#home-grid-item-calendar {
+ color: var(--mpc-home-calendar);
+ --mpc-icons: var(--mpc-home-calendar);
+}
+
+#home-grid-item-gallery {
+ color: var(--mpc-home-gallery);
+ --mpc-icons: var(--mpc-home-gallery);
+}
+
+#home-grid-item-appearance {
+ color: var(--mpc-home-appearance);
+ --mpc-icons: var(--mpc-home-appearance);
+}
+
+#home-grid-item-data {
+ color: var(--mpc-home-data);
+ --mpc-icons: var(--mpc-home-data);
+}
+
+#home-grid-item-housekeeping {
+ color: var(--mpc-home-housekeeping);
+ --mpc-icons: var(--mpc-home-housekeeping);
+}
+
+.home-grid-item-button {
+ font-size: 64px;
+ width: 86px;
+ height: 86px;
+}
+
+a:not(.material-icons):not(.material-icons-outlined):not(.button):not(.spotlight-link) {
+ color: var(--codename-theme);
+ text-decoration-color: var(--codename-theme);
+}
+
+a:not(.material-icons):not(.material-icons-outlined):not(.button):active, a:not(.material-icons):not(.material-icons-outlined):not(.button):focus:not(.spotlight-link) {
+ opacity: .75;
+}
+
+.ck.ck-editor__main a {
+ color: inherit !important;
+ text-decoration-color: inherit !important;
+}
+
+.all-item-icon {
+ margin-right: 5px;
+ vertical-align: middle;
+}
+
+.all-item-text {
+ vertical-align: middle;
+}
+
+.all-item-link {
+ color: white !important;
+ text-decoration: none !important;
+}
+
+.nd_Field {
+ display: -webkit-box;
+ display: -ms-flexbox;
+ display: flex;
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+ min-width: 0;
+ position: relative;
+ margin: 1em 0;
+ border-radius: 4px;
+ -webkit-transition: border-color .25s;
+ transition: border-color .25s;
+ border: 1px solid var(--codename-theme);
+}
+
+.nd_Field input {
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+.nd_Field input, .nd_Field select {
+ color: var(--mpc-text);
+}
+
+.nd_Field input[type="password"], .nd_Field input[type="text"] {
+ color: var(--mpc-text);
+}
+
+.nd_Field input, .nd_Field select, .nd_Field textarea {
+ font-weight: 400;
+ font-size: 1.4rem;
+ border: none;
+ border-radius: 4px;
+ padding: 8px 9px;
+ color: var(--mpc-text);
+ background-color: transparent;
+ -webkit-box-flex: 1;
+ -ms-flex: 1;
+ flex: 1;
+ min-width: 0;
+}
+
+.nd_Field input[type="password"], .nd_Field input[type="text"], .nd_Field textarea {
+ background-color: transparent;
+ color: var(--mpc-text);
+}
+
+.nd_Field input[type="password"]::placeholder, .nd_Field input[type="text"]::placeholder, .nd_Field textarea::placeholder {
+ color: transparent;
+}
+
+.nd_Field.fallback input[type="password"]::placeholder, .nd_Field.fallback input[type="text"]::placeholder, .nd_Field.fallback textarea::placeholder {
+ color: var(--codename-theme);
+ opacity: 1;
+}
+
+.nd_Field input[type="password"], .nd_Field input[type="search"], .nd_Field input[type="text"] {
+ padding: 9px;
+ font-size: 14px;
+ font-weight: 600;
+ min-width: 0;
+}
+
+.nd_Field_labelAlwaysTopLeft label, .nd_Field input:focus + label, .nd_Field input:not(:placeholder-shown) + label, .nd_Field select + label, .nd_Field textarea:focus + label, .nd_Field textarea:not(:placeholder-shown) + label {
+ background-color: transparent;
+}
+
+.nd_Field_labelAlwaysTopLeft label, .nd_Field input:focus + label, .nd_Field input:not(:placeholder-shown) + label, .nd_Field select + label, .nd_Field textarea:focus + label, .nd_Field textarea:not(:placeholder-shown) + label {
+ -webkit-transition: font-size .25s ease-out 0s,color .25s ease-out 0s,top .25s ease-out 0s,background-color .25s ease-out 0s;
+ transition: font-size .25s ease-out 0s,width .25s ease-out 0s,color .25s ease-out 0s,top .25s ease-out 0s,background-color .25s ease-out 0s;
+ font-size: 14px;
+ top: -14px;
+ padding: 0 2px;
+ background-color: var(--mpc-background);
+ pointer-events: auto;
+}
+
+.nd_Field label {
+ width: 100%;
+ -webkit-transition: font-size .25s ease-out .1s,color .25s ease-out .1s,top .25s ease-out .1s,background-color .25s ease-out .1s;
+ transition: font-size .25s ease-out .1s,color .25s ease-out .1s,top .25s ease-out .1s,background-color .25s ease-out .1s;
+ color: var(--codename-theme);
+ background-color: transparent;
+ font-size: 14px;
+ position: absolute;
+ left: 0;
+ top: 0;
+ margin: 7px 8px;
+ padding: 2px;
+ pointer-events: none;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ max-width: calc(100% - 20px);
+}
+
+#search {
+ width: 256px;
+}
+
+#searchbox {
+ width: 256px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.nd_Field input {
+ border: none !important;
+ font-weight: normal !important;
+}
+
+.search-match {
+ color: var(--codename-theme);
+ text-decoration: underline;
+}
+
+a.discreet, a.discreet:hover, a.discreet:active {
+ color: inherit !important;
+ text-decoration: none;
+}
+
+.updates-status {
+ font-size: 64px;
+}
+
+.separator {
+ border-bottom: none;
+ border-color: rgba(0, 0, 0, .5);
+}
+
+#updates-available {
+ background-color: rgba(211, 211, 0, 0.5);
+ text-align: center;
+ z-index: 999999;
+ position: relative;
+}
+
+.admin-pages-list {
+ display: grid;
+ grid-template-columns: 256px 256px 256px 256px 256px;
+ grid-column-gap: 20px;
+}
+
+@media (max-width: 1424px) {
+ .admin-pages-list {
+ grid-template-columns: 256px 256px 256px 256px;
+ }
+}
+
+@media (max-width: 968px) {
+ .admin-pages-list {
+ grid-template-columns: 256px 256px 256px;
+ }
+}
+
+@media (max-width: 712px) {
+ .admin-pages-list {
+ grid-template-columns: 256px 256px;
+ }
+}
+
+@media (max-width: 556px) {
+ .admin-pages-list {
+ grid-template-columns: 256px;
+ }
+}
+
+.mdc-card__actions-pages-list {
+ position: absolute;
+ bottom: 0;
+}
+
+.mdc-button--raised {
+ color: var(--mdc-theme-on-primary) !important;
+}
+
+.nd_Field, .nd_Field * {
+ outline: none;
+}
+
+.nd_Field input {
+ padding-top: 10px !important;
+}
+
+.nd_Field {
+ width: 256px;
+}
+
+.nd_Field label {
+ text-align: center;
+}
+
+.nd_Field__centered {
+ margin-right: auto;
+ margin-left: auto;
+}
+
+.nd_Field__disabled {
+ opacity: .5;
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/$resources/header.php b/Neutron-trunk/cms-special/admin/$resources/header.php
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ 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
new file mode 100644
index 0000000..773eab9
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/index-auto.css
@@ -0,0 +1,3 @@
+@import url("./index.css") only screen and (prefers-color-scheme: light);
+@import url("./index.css") only screen and (prefers-color-scheme: no-preference);
+@import url("./index-dark.css") only screen and (prefers-color-scheme: dark); \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/$resources/index-dark.css b/Neutron-trunk/cms-special/admin/$resources/index-dark.css
new file mode 100644
index 0000000..1683192
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/index-dark.css
@@ -0,0 +1,45 @@
+@import "./common.css";
+
+:root {
+ --mdc-theme-primary: var(--codename-theme);
+ --mdc-theme-secondary: var(--codename-secondary);
+ --mdc-theme-secondary-light: var(--codename-light);
+ --mdc-theme-on-primary: #ffffff;
+ --mdc-theme-on-secondary: white;
+ --mdc-theme-surface: rgb(44, 44, 44);
+ --mdc-theme-on-surface: whitesmoke;
+ --mpc-background: rgb(46, 46, 46);
+ --mpc-menu-background: rgb(22, 22, 22);
+ --mpc-menu-background-image: rgb(22, 22, 22, .5);
+ --mpc-menu-background-image-more: rgb(22, 22, 22, .75);
+ --mpc-text: whitesmoke;
+ --mpc-menu-selected: var(--mdc-theme-secondary-light);
+ --mpc-menu-header: rgb(223, 223, 223);
+ --mpc-menu-subtitle: rgb(182, 182, 182);
+ --mpc-icons: rgb(226, 226, 226);
+ --mpc-separator: rgb(138, 138, 138);
+
+ --mpc-home-pages: rgb(179, 229, 252);
+ --mpc-home-calendar: rgb(200, 230, 201);
+ --mpc-home-gallery: rgb(255, 205, 210);
+ --mpc-home-appearance: rgb(255, 249, 196);
+ --mpc-home-data: rgb(178, 223, 219);
+ --mpc-home-housekeeping: rgb(209, 196, 233);
+
+ --mpc-slse-hover1: rgba(255, 255, 255, 0.25);
+ --mpc-slse-hover2: rgba(255, 255, 255, 0.1);
+}
+
+/* --------------------- */
+
+.ck.ck-content {
+ background: #4a4a4a !important;
+}
+
+.message_img {
+ filter: invert(100%);
+}
+
+.mdi-icbtn-card {
+ color: rgba(255,255,255,1) !important;
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/$resources/index.css b/Neutron-trunk/cms-special/admin/$resources/index.css
new file mode 100644
index 0000000..57dd995
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/index.css
@@ -0,0 +1,31 @@
+@import "./common.css";
+
+:root {
+ --mdc-theme-primary: var(--codename-theme);
+ --mdc-theme-secondary: var(--codename-secondary);
+ --mdc-theme-secondary-light: var(--codename-light);
+ --mdc-theme-on-primary: white;
+ --mdc-theme-on-secondary: white;
+ --mdc-theme-surface: rgb(238, 238, 238);
+ --mdc-theme-on-surface: #000000;
+ --mpc-background: rgb(255, 255, 255);
+ --mpc-menu-background: rgb(240, 240, 240);
+ --mpc-menu-background-image: rgb(240, 240, 240, .5);
+ --mpc-menu-background-image-more: rgb(240, 240, 240, .75);
+ --mpc-text: rgb(0, 0, 0);
+ --mpc-menu-selected: var(--mdc-theme-secondary-light);
+ --mpc-menu-header: rgb(80, 80, 80);
+ --mpc-menu-subtitle: rgb(34, 34, 34);
+ --mpc-icons: rgb(78, 78, 78);
+ --mpc-separator: rgb(202, 202, 202);
+
+ --mpc-home-pages: rgb(25, 118, 210);
+ --mpc-home-calendar: rgb(56, 142, 60);
+ --mpc-home-gallery: rgb(211, 47, 47);
+ --mpc-home-appearance: rgb(251, 192, 45);
+ --mpc-home-data: rgb(0, 121, 107);
+ --mpc-home-housekeeping: rgb(81, 45, 168);
+
+ --mpc-slse-hover1: rgba(0, 0, 0, 0.25);
+ --mpc-slse-hover2: rgba(0, 0, 0, 0.1);
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/$resources/postcontent.php b/Neutron-trunk/cms-special/admin/$resources/postcontent.php
new file mode 100644
index 0000000..573a1d9
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/postcontent.php
@@ -0,0 +1,6 @@
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/debug.php";debugDump(); ?>
+ </div>
+</body>
+</html>
+
+<script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/$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
new file mode 100644
index 0000000..b133975
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/precontent.php
@@ -0,0 +1,223 @@
+<?php
+
+require $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php";
+
+$pageid = explode("/", $_SERVER['REQUEST_URI'])[3];
+if (isset(explode("/", $_SERVER['REQUEST_URI'])[4])) {
+ if (explode("/", $_SERVER['REQUEST_URI'])[4] != "index.php" && substr(explode("/", $_SERVER['REQUEST_URI'])[4], 0, 1) != "?" && substr(explode("/", $_SERVER['REQUEST_URI'])[4], 0, 1) != "#") {
+ if (isset($lang["admin-titles"][$pageid]['subpages'])) {
+ $subpageid = explode("/", $_SERVER['REQUEST_URI'])[4];
+ $subpageel = (array)$lang["admin-titles"][$pageid]['subpages'];
+ } else {
+ $subpageid = "";
+ }
+ } else {
+ $subpageid = "";
+ }
+} else {
+ $subpageid = "";
+}
+
+if (isset($lang["admin-titles"][$pageid])) {
+ if (isset($lang["admin-titles"][$pageid]['dom']) && isset($lang["admin-titles"][$pageid]['header'])) {
+ if (isset($lang["admin-titles"][$pageid]['subpages'])) {
+ if ($subpageid != "") {
+ $subpages = $lang["admin-titles"][$pageid]['subpages'];
+ if (isset($subpageel)) {
+ if (isset($subpageel[$subpageid])) {
+ $pageConfig = [ "domName" => $subpageel[$subpageid]['dom'] . " — " . $lang["admin-titles"][$pageid]['dom'], "headerName" => $subpageel[$subpageid]['header'] ];
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"]["fallback-subpages"] . " — " . $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"]["fallback-subpages"] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"][$pageid]['dom'], "headerName" => $lang["admin-titles"][$pageid]['header'] ];
+ }
+ } else {
+ $pageConfig = [ "domName" => $lang["admin-titles"]["fallback"]['dom'], "headerName" => $lang["admin-titles"]["fallback"]['header'] ];
+ }
+} else {
+ $pageConfig = [ "domName" => $lang["admin-titles"]["fallback"], "headerName" => $lang["admin-titles"]["fallback"] ];
+}
+
+$invalid = false;
+
+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'])) {
+
+ } 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>");
+ }
+} 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>");
+}
+
+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>");
+ return;
+ } else {
+ $invalid = true;
+ }
+}
+
+?>
+
+<?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;
+}
+
+function startsWith ($string, $startString) {
+ $len = strlen($startString);
+ return (substr($string, 0, $len) === $startString);
+}
+
+function getData(string $dir, $ignoreUploadDir = false) {
+ global $size;
+ $dircontent = scandir($dir);
+ foreach ($dircontent as $direl) {
+ if (($ignoreUploadDir && ($direl == "/upload" || $dir . "/" . $direl == $_SERVER['DOCUMENT_ROOT'] . "/resources/upload")) || $direl == ".git") {} else {
+ if ($direl == "." || $direl == "..") {} else {
+ if (is_link($dir . "/" . $direl)) {} else {
+ if (is_dir($dir . "/" . $direl)) {
+ getData($dir . "/" . $direl);
+ } else {
+ try {
+ $size = $size + filesize($dir . "/" . $direl);
+ } catch (Error $err) {}
+ }
+ }
+ }
+ }
+ }
+}
+
+function isJson(string $json) {
+ json_decode($json);
+ return (json_last_error() == JSON_ERROR_NONE);
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/preprocessor.php";
+
+?>
+
+<!DOCTYPE html>
+<html style="overflow-x:hidden;background-color: transparent !important;" lang="en">
+<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/fonts-import.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/alerts.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 ?>">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/spotlight.css">
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/css/admin.css">
+ <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>
+ <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="<?= $_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">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documenthead.php"; ?>
+
+ <?php
+
+ if (!isset($loadEditor)) {
+ $loadEditor = true;
+ }
+
+ 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>');
+ }
+
+ ?>
+ <?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">');
+ } 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">');
+ } else {
+ echo('<link rel="stylesheet" href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/$resources/index.css">');
+ }
+ ?>
+ <link rel="stylesheet" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.css">
+ <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/pushbar.js/library.js"></script>
+ <title><?php
+
+ if ($ready) {
+ echo("{$lang["admin-titles"]["suffix"]} — " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename"));
+ } else {
+ echo("{$lang["admin-titles"]["suffix"]} — 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
+
+ getData($_SERVER['DOCUMENT_ROOT']);
+ $sizestr = $size . " " . $lang["sizes"]["bytes"];
+ if ($size > 1024) {
+ if ($size > 1048576) {
+ if ($size > 1073741824) {
+ $sizestr = round($size / 1073741824, 2) . " " . $lang["sizes"]["gib"];
+ } else {
+ $sizestr = round($size / 1048576, 2) . " " . $lang["sizes"]["mib"];
+ }
+ } else {
+ $sizestr = round($size / 1024, 2) . " " . $lang["sizes"]["kib"];
+ }
+ } else {
+ $sizestr = $size . " " . $lang["sizes"]["bytes"];
+ }
+ $sizestr = str_replace(".", $lang["sizes"]["separator"], $sizestr);
+
+ ?>
+</head>
+<body id="settings" style="overflow-x:hidden;background-color: transparent !important;">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/spotlight.php"; ?>
+ <?php
+
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/headers/documentbody.php";
+
+ $path = str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']);
+ $name = $pageConfig['headerName'];
+
+ ?>
+ <div id="admin" style="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>");
+ $updatable = true;
+ } else {
+ $updatable = false;
+ }
+
+ ?>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/header.php"; ?> \ 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
new file mode 100644
index 0000000..75810b1
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/responsive.css
@@ -0,0 +1,31 @@
+@media (max-width: 500px) {
+ /* The following CSS will apply ONLY to smartphones or small screens */
+ .error-desktop {
+ display: none;
+ }
+ .error-mobile {
+ display: initial;
+ }
+ div#home-grid {
+ display: grid;
+ grid-template-columns: 1fr !important;
+ }
+}
+
+@media (max-width: 720px) {
+ /* The following CSS will apply ONLY to medium screens (less than 720p) */
+ #home-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr !important;
+ }
+}
+
+@media (min-width: 500px) {
+ /* The following CSS will NEVER apply to smartphones or small screens */
+ .error-desktop {
+ display: initial;
+ }
+ .error-mobile {
+ display: none;
+ }
+} \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php b/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php
new file mode 100644
index 0000000..bffaa87
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/spotlight-test.php
@@ -0,0 +1,14 @@
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php"; ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Spotlight search test</title>
+ <link rel="stylesheet" href="/resources/css/spotlight.css">
+ <link rel="stylesheet" href="/resources/lib/material/iconfont.css">
+</head>
+<body>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$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
new file mode 100644
index 0000000..f803f52
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/$resources/spotlight.php
@@ -0,0 +1,24 @@
+<?php // Tutoriel utilisé : https://www.youtube.com/watch?v=5Y3Urj_DVMw
+?>
+<script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/spotlight.js" defer></script>
+
+<?php
+
+$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/home/all/db.json"));
+
+?>
+<ul class="spotlight-elements">
+ <?php foreach ($data as $category): ?>
+ <?php foreach ($category->items as $item): ?>
+ <li class="spotlight-element">
+ <a href="#/<?= $item->page ?>" cat="<?= $category->name ?>" icon="<?= $category->icon ?>" class="spotlight-link"><?= $lang["admin-home"]["allitems"][$item->id] ?></a>
+ </li>
+
+ <script>
+ sysroot = "<?= $GLOBALS["SYSTEM_ROOT"] ?>";
+ </script>
+ <?php endforeach; ?>
+ <?php endforeach; ?>
+</ul>
+<spotlight-bar target=".spotlight-elements a" placeholder="<?= $lang["spotlight"]["search"] ?>">
+</spotlight-bar> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/admin/.htaccess b/Neutron-trunk/cms-special/admin/.htaccess
new file mode 100644
index 0000000..90f6271
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/.htaccess
@@ -0,0 +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
diff --git a/Neutron-trunk/cms-special/admin/about/index.php b/Neutron-trunk/cms-special/admin/about/index.php
new file mode 100644
index 0000000..1551ff0
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/about/index.php
@@ -0,0 +1,116 @@
+<?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"; ?>
diff --git a/Neutron-trunk/cms-special/admin/advanced/index.php b/Neutron-trunk/cms-special/admin/advanced/index.php
new file mode 100644
index 0000000..ae80b96
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/advanced/index.php
@@ -0,0 +1,8 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php b/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php
new file mode 100644
index 0000000..f087b1c
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/advanced/jsonconf/index.php
@@ -0,0 +1,59 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/appearance/index.php b/Neutron-trunk/cms-special/admin/appearance/index.php
new file mode 100644
index 0000000..22c5065
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/appearance/index.php
@@ -0,0 +1,253 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/calendar/add/index.php b/Neutron-trunk/cms-special/admin/calendar/add/index.php
new file mode 100644
index 0000000..1029788
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/calendar/add/index.php
@@ -0,0 +1,140 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/calendar/index.php b/Neutron-trunk/cms-special/admin/calendar/index.php
new file mode 100644
index 0000000..e596551
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/calendar/index.php
@@ -0,0 +1,86 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/calendar/manage/index.php b/Neutron-trunk/cms-special/admin/calendar/manage/index.php
new file mode 100644
index 0000000..a6f4ebd
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/calendar/manage/index.php
@@ -0,0 +1,78 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/customization/index.php b/Neutron-trunk/cms-special/admin/customization/index.php
new file mode 100644
index 0000000..66aee2f
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/customization/index.php
@@ -0,0 +1,214 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/error/index.php b/Neutron-trunk/cms-special/admin/error/index.php
new file mode 100644
index 0000000..c68c6a6
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/error/index.php
@@ -0,0 +1,11 @@
+<?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"; ?>
diff --git a/Neutron-trunk/cms-special/admin/flags/index.php b/Neutron-trunk/cms-special/admin/flags/index.php
new file mode 100644
index 0000000..c243a49
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/flags/index.php
@@ -0,0 +1,75 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/galery/addcategory/index.php b/Neutron-trunk/cms-special/admin/galery/addcategory/index.php
new file mode 100644
index 0000000..f2438e1
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/galery/addcategory/index.php
@@ -0,0 +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
diff --git a/Neutron-trunk/cms-special/admin/galery/index.php b/Neutron-trunk/cms-special/admin/galery/index.php
new file mode 100644
index 0000000..82ad59c
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/galery/index.php
@@ -0,0 +1,2 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/galery/publish/index.php b/Neutron-trunk/cms-special/admin/galery/publish/index.php
new file mode 100644
index 0000000..ac5f616
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/galery/publish/index.php
@@ -0,0 +1,2 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php b/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php
new file mode 100644
index 0000000..68451fc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php
@@ -0,0 +1,39 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/gallery/index.php b/Neutron-trunk/cms-special/admin/gallery/index.php
new file mode 100644
index 0000000..7623820
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/gallery/index.php
@@ -0,0 +1,218 @@
+<?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>
diff --git a/Neutron-trunk/cms-special/admin/gallery/publish/index.php b/Neutron-trunk/cms-special/admin/gallery/publish/index.php
new file mode 100644
index 0000000..e2768ac
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/gallery/publish/index.php
@@ -0,0 +1,57 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/home/all/db.json b/Neutron-trunk/cms-special/admin/home/all/db.json
new file mode 100644
index 0000000..8a6ad37
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/home/all/db.json
@@ -0,0 +1,178 @@
+[
+ {
+ "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
new file mode 100644
index 0000000..f844070
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/home/all/index.php
@@ -0,0 +1,4 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/home/appearance/index.php b/Neutron-trunk/cms-special/admin/home/appearance/index.php
new file mode 100644
index 0000000..318611a
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/home/appearance/index.php
@@ -0,0 +1,45 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/home/data/index.php b/Neutron-trunk/cms-special/admin/home/data/index.php
new file mode 100644
index 0000000..29205dc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/home/data/index.php
@@ -0,0 +1,27 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/home/housekeeping/index.php b/Neutron-trunk/cms-special/admin/home/housekeeping/index.php
new file mode 100644
index 0000000..8c0deae
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/home/housekeeping/index.php
@@ -0,0 +1,27 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/home/index.php b/Neutron-trunk/cms-special/admin/home/index.php
new file mode 100644
index 0000000..327ab36
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/home/index.php
@@ -0,0 +1,58 @@
+<?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>
+ &nbsp;
+ <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>
+ &nbsp;
+ <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"; ?>
diff --git a/Neutron-trunk/cms-special/admin/housekeeping/index.php b/Neutron-trunk/cms-special/admin/housekeeping/index.php
new file mode 100644
index 0000000..a5d0bbc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/housekeeping/index.php
@@ -0,0 +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
diff --git a/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php b/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php
new file mode 100644
index 0000000..35b36d1
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/housekeeping/reset/index.php
@@ -0,0 +1,2 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/index.php b/Neutron-trunk/cms-special/admin/index.php
new file mode 100644
index 0000000..8e388b6
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/index.php
@@ -0,0 +1,135 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/language/index.php b/Neutron-trunk/cms-special/admin/language/index.php
new file mode 100644
index 0000000..4c16e04
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/language/index.php
@@ -0,0 +1,57 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/login-old/index.php b/Neutron-trunk/cms-special/admin/login-old/index.php
new file mode 100644
index 0000000..d4428d7
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/login-old/index.php
@@ -0,0 +1,122 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/login/index.php b/Neutron-trunk/cms-special/admin/login/index.php
new file mode 100644
index 0000000..57a1b6a
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/login/index.php
@@ -0,0 +1,219 @@
+<?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>
+ &nbsp;
+ <a onclick="window.open('<?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . '/api/bugs') ?>');" target="_blank" class="sblink">
+ <?= $lang["admin-login"]["report"] ?></a>
+ &nbsp;
+ <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
diff --git a/Neutron-trunk/cms-special/admin/logout/index.php b/Neutron-trunk/cms-special/admin/logout/index.php
new file mode 100644
index 0000000..5c51269
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/logout/index.php
@@ -0,0 +1,15 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/logs/index.php b/Neutron-trunk/cms-special/admin/logs/index.php
new file mode 100644
index 0000000..b653ad0
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/logs/index.php
@@ -0,0 +1,17 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/pages/add/index.php b/Neutron-trunk/cms-special/admin/pages/add/index.php
new file mode 100644
index 0000000..54dacdb
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/pages/add/index.php
@@ -0,0 +1,145 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/pages/delete/index.php b/Neutron-trunk/cms-special/admin/pages/delete/index.php
new file mode 100644
index 0000000..4cbcb49
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/pages/delete/index.php
@@ -0,0 +1,88 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/pages/edit/index.php b/Neutron-trunk/cms-special/admin/pages/edit/index.php
new file mode 100644
index 0000000..b198566
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/pages/edit/index.php
@@ -0,0 +1,194 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/pages/index.php b/Neutron-trunk/cms-special/admin/pages/index.php
new file mode 100644
index 0000000..d8e1e3d
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/pages/index.php
@@ -0,0 +1,66 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/pages/rename/index.php b/Neutron-trunk/cms-special/admin/pages/rename/index.php
new file mode 100644
index 0000000..d7118ba
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/pages/rename/index.php
@@ -0,0 +1,89 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/plugins/index.php b/Neutron-trunk/cms-special/admin/plugins/index.php
new file mode 100644
index 0000000..58be08f
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/plugins/index.php
@@ -0,0 +1,79 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/reset/index.php b/Neutron-trunk/cms-special/admin/reset/index.php
new file mode 100644
index 0000000..efa215c
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/reset/index.php
@@ -0,0 +1,118 @@
+<?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>
diff --git a/Neutron-trunk/cms-special/admin/resetted/index.php b/Neutron-trunk/cms-special/admin/resetted/index.php
new file mode 100644
index 0000000..21fe104
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/resetted/index.php
@@ -0,0 +1,21 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/stats/index.php b/Neutron-trunk/cms-special/admin/stats/index.php
new file mode 100644
index 0000000..81b4b69
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/stats/index.php
@@ -0,0 +1,280 @@
+<?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
diff --git a/Neutron-trunk/cms-special/admin/widgets/index.php b/Neutron-trunk/cms-special/admin/widgets/index.php
new file mode 100644
index 0000000..ed6d9db
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/widgets/index.php
@@ -0,0 +1,5 @@
+<?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
diff --git a/Neutron-trunk/cms-special/calendar/index.php b/Neutron-trunk/cms-special/calendar/index.php
new file mode 100644
index 0000000..8843961
--- /dev/null
+++ b/Neutron-trunk/cms-special/calendar/index.php
@@ -0,0 +1,159 @@
+<?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php
+
+function dbtest($string) {
+ json_decode($string);
+ return (json_last_error() == JSON_ERROR_NONE);
+}
+
+include_once $_SERVER['DOCUMENT_ROOT'] . "/api/engine-cyclic/render.php";
+include_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php";
+$buffer = ""; // Initialiser un nouveau tampon vide
+
+function buffer(string $value) {
+ global $buffer;
+ $buffer = $buffer . $value;
+}
+
+ $jsonraw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json");
+ if (dbtest($jsonraw)) {
+ $json = json_decode($jsonraw);
+ $eventlist = [];
+ $eventlistpassed = [];
+ foreach ($json->events as $event) {
+ if (isset($event->timestamp)) {
+ (int)$currentDate = date("Ymd");
+ if ($currentDate < $event->timestamp || $currentDate == $event->timestamp) {
+ array_push($eventlist, $event->timestamp);
+ } else {
+ array_push($eventlistpassed, $event->timestamp);
+ }
+ }
+ }
+ sort($eventlist);
+ sort($eventlistpassed);
+ $pos = 1;
+ $shown = 0;
+ buffer("<h2>" . $lang["calendar"]["futureh"] . "</h2>");
+ foreach ($eventlist as $event) {
+ if (1 == 2) {} else {
+ foreach ($json->events as $el) {
+ if (isset($el->timestamp)) {
+ if ($el->timestamp == $event) {
+ (int)$currentDate = date("Ymd");
+ if ($currentDate < $el->timestamp) {
+ $shown = $shown + 1;
+ buffer("<h3>" . $el->datestr . "</h3><ul><li>" . $el->name . "</li>");
+ if ($el->description != "") {
+ buffer("<li>" . $el->description . "</li>");
+ }
+ if (isset($el->link)) {
+ if ($el->link != "" && $el->link != "http://") {
+ buffer("<br><li><a target=\"_blank\" href=\"" . $el->link . "\" title=\"" . $lang["calendar"]["newtab"] . "\">" . $lang["calendar"]["more"] . "</a></li>");
+ }
+ }
+ buffer("</ul>");
+ $pos = $pos + 1;
+ }
+ if ($currentDate == $el->timestamp) {
+ $shown = $shown + 1;
+ buffer("<h3>" . $lang["calendar"]["today"] . "</h3><ul><li>" . $el->name . "</li>");
+ if ($el->description != "") {
+ buffer("<li>" . $el->description . "</li>");
+ }
+ if (isset($el->link)) {
+ if ($el->link != "" && $el->link != "http://") {
+ buffer("<br><li><a target=\"_blank\" href=\"" . $el->link . "\" title=\"" . $lang["calendar"]["newtab"] . "\">" . $lang["calendar"]["more"] . "</a></li>");
+ }
+ }
+ buffer("</ul>");
+ $pos = $pos + 1;
+ }
+ if ($currentDate > $el->timestamp) {
+ $shown = $shown + 1;
+ buffer("<h3>" . $lang["calendar"]["pasth"] . " (" . $el->datestr . ")</h3><ul><li>" . $el->name . "</li>");
+ if ($el->description != "") {
+ buffer("<li>" . $el->description . "</li>");
+ }
+ if (isset($el->link)) {
+ if ($el->link != "" && $el->link != "http://") {
+ buffer("<br><li><a target=\"_blank\" href=\"" . $el->link . "\" title=\"" . $lang["calendar"]["newtab"] . "\">" . $lang["calendar"]["more"] . "</a></li>");
+ }
+ }
+ buffer("</ul>");
+ $pos = $pos + 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ if ($shown == "0") {
+ buffer("</ul><div style=\"text-align: center;\"><i>" . $lang["calendar"]["future"] . "</i></div>");
+ }
+ buffer("<h2>" . $lang["calendar"]["pasth"] . "</h2>");
+ $pos = 1;
+ $shown = 0;
+ foreach ($eventlistpassed as $event) {
+ if (1 == 2) {} else {
+ foreach ($json->events as $el) {
+ if (isset($el->timestamp)) {
+ if ($el->timestamp == $event) {
+ (int)$currentDate = date("Ymd");
+ if ($currentDate < $el->timestamp) {
+ $shown = $shown + 1;
+ buffer("<h3>" . $el->datestr . "</h3><ul><li>" . $el->name . "</li>");
+ if ($el->description != "") {
+ buffer("<li>" . $el->description . "</li>");
+ }
+ if (isset($el->link)) {
+ if ($el->link != "" && $el->link != "http://") {
+ buffer("<br><li><a target=\"_blank\" href=\"" . $el->link . "\" title=\"" . $lang["calendar"]["newtab"] . "\">" . $lang["calendar"]["more"] . "</a></li>");
+ }
+ }
+ buffer("</ul>");
+ $pos = $pos + 1;
+ }
+ if ($currentDate == $el->timestamp) {
+ $shown = $shown + 1;
+ buffer("<h3>" . $lang["calendar"]["today"] . "</h3><ul><li>" . $el->name . "</li>");
+ if ($el->description != "") {
+ buffer("<li>" . $el->description . "</li>");
+ }
+ if (isset($el->link)) {
+ if ($el->link != "" && $el->link != "http://") {
+ buffer("<br><li><a target=\"_blank\" href=\"" . $el->link . "\" title=\"" . $lang["calendar"]["newtab"] . "\">" . $lang["calendar"]["more"] . "</a></li>");
+ }
+ }
+ buffer("</ul>");
+ $pos = $pos + 1;
+ }
+ if ($currentDate > $el->timestamp) {
+ $shown = $shown + 1;
+ buffer("<h3>" . $el->datestr . "</h3><ul><li>" . $el->name . "</li>");
+ if ($el->description != "") {
+ buffer("<li>" . $el->description . "</li>");
+ }
+ if (isset($el->link)) {
+ if ($el->link != "" && $el->link != "http://") {
+ buffer("<br><li><a target=\"_blank\" href=\"" . $el->link . "\" title=\"" . $lang["calendar"]["newtab"] . "\">" . $lang["calendar"]["more"] . "</a></li>");
+ }
+ }
+ buffer("</ul>");
+ $pos = $pos + 1;
+ }
+ }
+ }
+ }
+ }
+ }
+ if ($shown == "0") {
+ buffer("</ul><div style=\"text-align: center;\"><i>" . $lang["calendar"]["past"] . "</i></div>");
+ }
+ } else {
+ buffer("<b>" . $lang["calendar"]["corrupted"] . "</b>");
+ }
+
+renderSpecial($buffer, $lang["calendar"]["title"]);
+
+?> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/error/index.php b/Neutron-trunk/cms-special/error/index.php
new file mode 100644
index 0000000..3983bc7
--- /dev/null
+++ b/Neutron-trunk/cms-special/error/index.php
@@ -0,0 +1,71 @@
+<?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-->") ?>
+<?php
+
+function rlgps() {}
+
+if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent")) {
+ $ready = true;
+} else {
+ $ready = false;
+ header("Location: /cms-special/setup");
+ require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit();
+}
+
+if ($ready) {
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/lang/processor.php";
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log")) {
+ if (isset($_GET['id'])) {
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log") . date("d/m/Y H:i:s") . " - INTERFACE/HTTP-ERROR - " . $_GET['id'] . "\n\n");
+ } else {
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log") . date("d/m/Y H:i:s") . " - INTERFACE/HTTP-ERROR - Unknown \n\n");
+ }
+ } else {
+ if (isset($_GET['id'])) {
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log", date("d/m/Y H:i:s") . " - INTERFACE/HTTP-ERROR - " . $_GET['id'] . "\n\n");
+ } else {
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/system.log", date("d/m/Y H:i:s") . " - INTERFACE/HTTP-ERROR - Unknown \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="/resources/css/error.css">
+ <link rel="stylesheet" href="/resources/css/fonts-import.css">
+ <link rel="stylesheet" href="/resources/css/ui.css">
+ <title><?php
+
+ if ($ready) {
+ echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename"));
+ } else {
+ echo("Neutron");
+ }
+
+ ?></title>
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/header.php" ?>
+</head>
+<body neutron-error-body>
+ <div class="centered discover">
+ <h2><?= $lang["error"]["title"] ?></h2>
+ <p><?= $lang["error"]["message"][0] ?></p>
+ <p><?= $lang["error"]["message"][1] ?></p>
+ <p><b><?php
+
+ if (isset($_GET['id'])) {
+ echo($lang["error"]["code"] . " " . $_GET['id']);
+ } else {
+ echo($lang["error"]["other"]);
+ }
+
+ ?></b></p>
+ <a class="button" href="/"><?= $lang["error"]["direction"] ?></a>
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/galery/index.php b/Neutron-trunk/cms-special/galery/index.php
new file mode 100644
index 0000000..5a50af5
--- /dev/null
+++ b/Neutron-trunk/cms-special/galery/index.php
@@ -0,0 +1,5 @@
+<?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php
+
+header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/gallery");
+require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/galery/preview/index.php b/Neutron-trunk/cms-special/galery/preview/index.php
new file mode 100644
index 0000000..945adf8
--- /dev/null
+++ b/Neutron-trunk/cms-special/galery/preview/index.php
@@ -0,0 +1,5 @@
+<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php
+
+header("Location: {$GLOBALS["SYSTEM_ROOT"]}" . str_replace("/galery", "/gallery", $_SERVER['REQUEST_URI']));
+require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/gallery/index.php b/Neutron-trunk/cms-special/gallery/index.php
new file mode 100644
index 0000000..3fe2fad
--- /dev/null
+++ b/Neutron-trunk/cms-special/gallery/index.php
@@ -0,0 +1,61 @@
+<?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/api/renderer/render.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php";
+$buffer = ""; // Initialiser un nouveau tampon vide
+
+function buffer(string $value) {
+ global $buffer;
+ $buffer = $buffer . $value;
+}
+
+if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures") && count(scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures")) > 2) {
+ $categories = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories");
+ array_push($categories, "unclassed");
+ foreach ($categories as $category) {
+ if ($category != "." && $category != "..") {
+ $shown = false;
+ if ($category == "unclassed") {
+ buffer("<h2>" . $lang["gallery"]["unclassed"] . "</h2>");
+ } else {
+ buffer("<h2>" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories/" . $category) . "</h2>");
+ }
+ buffer("<div style=\"text-align: center;\">");
+ $photos = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures");
+ foreach ($photos as $photo) {
+ if ($photo == "." || $photo == "..") {} else {
+ $praw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $photo);
+ $pcat = explode("|", $praw)[1];
+ $ppath = explode("|", $praw)[0];
+ if ($pcat == $category) {
+ $shown = true;
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . $ppath)) {
+ buffer("<div class=\"photo\">");
+ buffer("<a href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/gallery/preview/?url={$GLOBALS["SYSTEM_ROOT"]}" . $ppath . "&return={$GLOBALS["SYSTEM_ROOT"]}/cms-special/gallery\"><img class=\"photo_image\" src=\"{$GLOBALS["SYSTEM_ROOT"]}" . $ppath . "\" /></a>");
+ if (isset(explode("|", $praw)[2])) {
+ buffer("<br><div class=\"photo_label\">" . explode("|", $praw)[2] . "</div>");
+ }
+ buffer("</div>");
+ } else {
+ buffer("<div class=\"photo\">");
+ buffer('<p><table class="message_error message_black"><tbody><tr><td><img src="' . $GLOBALS["SYSTEM_ROOT"] .'/resources/image/message_error.svg" class="message_img"></td><td style="width:100%;">' . $lang["gallery"]["error"] . '</td></tr></tbody></table></p>');
+ buffer("</div>");
+ }
+ }
+ }
+ }
+ if (!$shown) {
+ buffer("<p><div style=\"text-align: center;\"><i>" . $lang["gallery"]["nothing"] . "</i></div></p>");
+ }
+ buffer("</center></div></center>");
+ }
+ }
+} else {
+ buffer("<div style=\"text-align: center;\"><i>" . $lang["gallery"]["disabled"][0] . "<b>" . $lang["gallery"]["disabled"][1] . "</b>" . $lang["gallery"]["disabled"][2] . "</i></div>");
+}
+buffer("<script>window.onload = () => {setTimeout(() => {Array.from(document.getElementsByClassName('photo_image')).forEach((el) => {el.classList.add('loaded')});}, 1000)}</script>");
+
+renderSpecial($buffer, $lang["gallery"]["title"]);
+
+?> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/gallery/preview/index.php b/Neutron-trunk/cms-special/gallery/preview/index.php
new file mode 100644
index 0000000..e033cc0
--- /dev/null
+++ b/Neutron-trunk/cms-special/gallery/preview/index.php
@@ -0,0 +1,129 @@
+<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php";
+
+if (isset($_GET['return'])) {
+ $callback = $_GET['return'];
+}
+
+?>
+<!DOCTYPE html>
+<html lang="en" style="height:100%;overflow:hidden;">
+<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/preview.css">
+ <script src="<?= $GLOBALS['SYSTEM_ROOT'] ?>/resources/js/jquery.js"></script>
+ <title><?= $lang["gallery"]["preview"]['title'] ?></title>
+</head>
+<?php
+
+ if (isset($_GET['url'])) {
+ if (strpos($_GET['url'], '..') !== false) {
+ require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["gallery"]["preview"]['invalid']);
+ } else {
+ if (file_exists($GLOBALS['ORIGINAL_DOCUMENT_ROOT'] . "/" . $_GET['url'])) {
+ $ext1 = explode(".", $_GET['url']);
+ $ext2 = end($ext1);
+ $ext = strtoupper($ext2);
+ } else {
+ require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["gallery"]["preview"]['notfound']);
+ }
+ }
+ } else {
+ require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit($lang["gallery"]["preview"]['none']);
+ }
+
+?>
+<body style="background-size:contain;background-position:center;height: 100%;margin: 0;background-repeat: no-repeat;background-color: #222;">
+ <div class="container">
+ <img class="image" id="scroll" src="<?= $_GET['url'] ?>" draggable="false" onmouseup="clearTimeout(mdt);--mousedown;" onclick="return false;">
+ <script>
+ document.getElementsByClassName('image')[0].style.transform = "scale(1)";
+ </script>
+ </div>
+ <?php if (isset($callback)): ?><a class="close" title="<?= $lang["gallery"]["preview"]['close'] ?>"><img class="icon" src="<?= $GLOBALS['SYSTEM_ROOT'] ?>/resources/image/close.svg" onclick="location.href = &quot;<?= $callback ?>&quot;"></a><?php endif ?>
+ <a class="download" href="<?= $_GET['url'] ?>" title="<?= $lang["gallery"]["preview"]['placeholder'][0] ?> <?= $ext ?> <?= $lang["gallery"]["preview"]['placeholder'][1] ?>" download><?= $lang["gallery"]["preview"]['download'] ?> (<?= $ext ?>)</a>
+ <span class="zoom">
+ <a class="zoomin" onclick="zoomin();"></a>
+ <a class="zoomout" onclick="zoomout();"></a>
+ </span>
+</body>
+<script>
+
+function zoomin() {
+ tf = document.getElementsByClassName("image")[0].style.transform.split("(")[1].split(")")[0] - 1 + 1;
+ if (tf < 8) {
+ tf++;
+ document.getElementsByClassName('image')[0].style.transform = `scale(${tf})`;
+ document.getElementsByClassName('image')[0].style['margin-top'] = (((1055 / 6) * (window.innerHeight / 480)) * tf) + 'px';
+ document.getElementsByClassName('image')[0].style['margin-left'] = (((1055 / 6) * (window.innerWidth / 480)) * tf) + 'px';
+ }
+}
+
+function zoomout() {
+ tf = document.getElementsByClassName("image")[0].style.transform.split("(")[1].split(")")[0] - 1 + 1;
+ if (tf > 1) {
+ tf--;
+ if (tf > 1) {
+ document.getElementsByClassName('image')[0].style.transform = `scale(${tf})`;
+ document.getElementsByClassName('image')[0].style['margin-top'] = (((1055 / 6) * (window.innerHeight / 480)) * tf) + 'px';
+ document.getElementsByClassName('image')[0].style['margin-left'] = (((1055 / 6) * (window.innerWidth / 480)) * tf) + 'px';
+ } else {
+ document.getElementsByClassName('image')[0].style.transform = `scale(${tf})`;
+ document.getElementsByClassName('image')[0].style['margin-top'] = (((1055 / 6) / 422) * tf) + 'px';
+ document.getElementsByClassName('image')[0].style['margin-left'] = (((1055 / 6) / 422) * tf) + 'px';
+ }
+ }
+}
+
+window.onload = () => {setTimeout(() => {Array.from(document.getElementsByClassName('ppreview')).forEach((el) => {el.classList.add('loaded')});}, 1000)}
+
+(function($) {
+ $.dragScroll = function(options) {
+ var settings = $.extend({
+ scrollVertical: true,
+ scrollHorizontal: true,
+ cursor: null
+ }, options);
+
+ var clicked = false,
+ clickY, clickX;
+
+ var getCursor = function() {
+ if (settings.cursor) return settings.cursor;
+ if (settings.scrollVertical && settings.scrollHorizontal) return 'move';
+ if (settings.scrollVertical) return 'row-resize';
+ if (settings.scrollHorizontal) return 'col-resize';
+ }
+
+ var updateScrollPos = function(e, el) {
+ $('html').css('cursor', getCursor());
+ var $el = $(el);
+ settings.scrollVertical && $el.scrollTop($el.scrollTop() + (clickY - e.pageY));
+ settings.scrollHorizontal && $el.scrollLeft($el.scrollLeft() + (clickX - e.pageX));
+ }
+
+ $(document).on({
+ 'mousemove': function(e) {
+ clicked && updateScrollPos(e, this);
+ },
+ 'mousedown': function(e) {
+ clicked = true;
+ clickY = e.pageY;
+ clickX = e.pageX;
+ },
+ 'mouseup': function() {
+ clicked = false;
+ $('html').css('cursor', 'auto');
+ }
+ });
+ }
+}(jQuery))
+
+$.dragScroll();
+
+</script>
+</html> \ No newline at end of file
diff --git a/Neutron-trunk/cms-special/setup/index.php b/Neutron-trunk/cms-special/setup/index.php
new file mode 100644
index 0000000..d17d5a6
--- /dev/null
+++ b/Neutron-trunk/cms-special/setup/index.php
@@ -0,0 +1,156 @@
+<?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-->") ?>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/api/lang/setup.php"; ?>
+<?php
+
+if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent")) {
+ $ready = true;
+} else {
+ $ready = false;
+}
+
+?>
+
+<!DOCTYPE html>
+<html lang="<?= isset($langsel) ? $langsel : "en" ?>">
+<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/setup.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><?php
+
+ if ($ready) {
+ if (!isset($lang)) {
+ echo(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename"));
+ } else {
+ echo($lang["setup"]["ititle"] . " - " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/sitename"));
+ }
+ } else {
+ if (!isset($lang)) {
+ echo("Neutron");
+ } else {
+ echo($lang["setup"]["ititle"] . " - Neutron");
+ }
+ }
+
+ ?></title>
+</head>
+<body>
+ <?php
+
+ if ($ready) {
+ // If the website is ready, render the headers and stop here
+ require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<script>location.href = '" . $GLOBALS['SYSTEM_ROOT'] . "/index.php';</script></body></html>");
+ }
+
+ ?>
+ <?= $nolang ? "" : '<script>
+ window.onbeforeunload = function (e) {
+ e = e || window.event;
+
+ // For IE and Firefox prior to version 4
+ if (e) {
+ e.returnValue = "<!>";
+ }
+
+ // For Safari
+ return "<!>";
+ };
+ </script>' ?>
+ <script src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/js/jquery.js"></script>
+ <div class="centered box hide" id="00-error">
+ <h2 id="00-error-title"><?= $lang['setup']['defaulterr'][0] ?></h2>
+ <span id="00-error-message"><?= $lang['setup']['defaulterr'][1] ?></span><br><br>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_restart.svg" onclick="reloadPage()" class="icon_button"><br><small><?= $lang['setup']['defaulterr'][2] ?></small>
+ </div>
+ <div class="centered box<?= $nolang ? "" : " hide" ?>" id="00-language">
+ <h2>Neutron</h2>
+ <p>
+ <select id="00-language-select">
+ <?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 type="button" value="OK" onclick="location.href = '?lang=' + document.getElementById('00-language-select').value">
+ </div>
+ <div class="centered box<?= $nolang ? " hide" : "" ?>" id="01-loader">
+ <h2><?= $lang['setup']['sections'][0] ?></h2>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" class="loader">
+ </div>
+ <div class="centered box hide" id="02-check">
+ <h2><?= $lang['setup']['sections'][1] ?></h2>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" class="loader">
+ </div>
+ <div class="centered box hide" id="03-welcome">
+ <h2><?= $lang['setup']['sections'][2] ?></h2>
+ <p><?= $lang['setup']['welcome'][0] ?></p>
+ <p><?= $lang['setup']['welcome'][1] ?></p>
+ <p><?= $lang['setup']['welcome'][2] ?></p>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_next.svg" onclick="document.title = '<?= $lang["setup"]["steps"][7] . " - " . $lang["setup"]["ititle"] ?> - Neutron';switchPage('03-welcome', '04-name');" class="icon_button"><br><small><?= $lang['setup']['links'][4] ?></small>
+ </div>
+ <div class="centered box hide" id="04-name">
+ <h2><?= $lang['setup']['sections'][3] ?></h2>
+ <p><?= $lang['setup']['name'][0] ?></p>
+ <p><?= $lang['setup']['name'][1] ?></p>
+ <input id="04-name-field" type="text" onchange="validateName()" onkeyup="validateName()" onkeydown="validateName()" placeholder="Nom de votre site"><br><p id="04-name-tip" class="tip-red"><?= $lang['setup']['sitename'][0] ?></p>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_next.svg" onclick="Name_ChangeIfOk()" class="icon_button"><br><small><?= $lang['setup']['links'][3] ?></small>
+ </div>
+ <div class="centered box hide" id="05-icon">
+ <h2><?= $lang['setup']['sections'][4] ?></h2>
+ <p><?= $lang['setup']['logo'][0] ?></p>
+ <p><?= $lang['setup']['logo'][1] ?></p>
+ <input id="05-icon-file" type="file" onchange="Icon_Validate()" style="display:none;width:0;height:0;left:0;top:0;"><img id="05-icon-img" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_file_import.svg" onclick="Icon_UploadFile()" class="icon_button"><br><small><?= $lang['setup']['logo'][2] ?></small><br><br>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_next.svg" onclick="document.title = '<?= $lang["setup"]["steps"][8] . " - " . $lang["setup"]["ititle"] ?> - Neutron';switchPage('05-icon', '06-terms');" class="icon_button"><br><small><?= $lang['setup']['links'][3] ?></small>
+ </div>
+ <div class="centered box hide" id="06-terms">
+ <h2><?= $lang['setup']['sections'][5] ?></h2>
+ <p><?= $lang['setup']['license'] ?></p>
+ <iframe class="termsbox" src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/lib/license.html" style="width:100%;"></iframe><br><br>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_next.svg" onclick="document.title = '<?= $lang["setup"]["steps"][9] . " - " . $lang["setup"]["ititle"] ?> - Neutron';switchPage('06-terms', '07-finish');" class="icon_button"><br><small><?= $lang['setup']['links'][2] ?></small>
+ </div>
+ <div class="centered box hide" id="07-finish">
+ <h2><?= $lang['setup']['sections'][6] ?></h2>
+ <p><?= $lang['setup']['confirm'][0] ?></p>
+ <p><?= $lang['setup']['confirm'][1] ?></p>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_finish.svg" onclick="upload()" class="icon_button"><br><small><?= $lang['setup']['links'][1] ?></small>
+ </div>
+ <div class="centered box hide" id="08-checking">
+ <h2><?= $lang['setup']['upload'][0] ?></h2>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" class="finisher loadblink"><br><br><small><?= $lang['setup']['warning'][0] ?><br><?= $lang['setup']['warning'][1] ?></small>
+ </div>
+ <div class="centered box hide" id="09-uploading">
+ <h2><?= $lang['setup']['upload'][1] ?></h2>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" class="finisher loadblink"><br><br><small><?= $lang['setup']['warning'][0] ?><br><?= $lang['setup']['warning'][1] ?></small>
+ </div>
+ <div class="centered box hide" id="10-summing">
+ <h2><?= $lang['setup']['upload'][2] ?></h2>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" class="finisher loadblink"><br><br><small><?= $lang['setup']['warning'][0] ?><br><?= $lang['setup']['warning'][1] ?></small>
+ </div>
+ <div class="centered box hide" id="11-performance">
+ <h2><?= $lang['setup']['upload'][3] ?></h2>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/storeloader.svg" class="finisher loadblink"><br><br><small><?= $lang['setup']['warning'][0] ?><br><?= $lang['setup']['warning'][1] ?></small>
+ </div>
+ <div class="centered box hide" id="12-done">
+ <h2><?= $lang['setup']['done'][0] ?></h2>
+ <p><?= $lang['setup']['done'][1] ?></p>
+ <p><?= $lang['setup']['done'][2] ?> <b>MPCMS-usr-motdepasse</b><?= $lang['setup']['done'][3] ?></p>
+ <img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/config_explore.svg" onclick="location.href = '<?= $GLOBALS["SYSTEM_ROOT"] ?>/'" class="icon_button"><br><small><?= $lang['setup']['links'][0] ?></small>
+ </div>
+ <?= $nolang ? "" : '<script src="' . $GLOBALS["SYSTEM_ROOT"] . '/resources/js/setup-ui.js.php?lang=' . $langsel . '"></script>' ?>
+</body>
+</html>
diff --git a/Neutron-trunk/cms-special/version/index.php b/Neutron-trunk/cms-special/version/index.php
new file mode 100644
index 0000000..840de2d
--- /dev/null
+++ b/Neutron-trunk/cms-special/version/index.php
@@ -0,0 +1,36 @@
+<?php require_once "../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php
+
+require $_SERVER['DOCUMENT_ROOT'] . "/api/lang/processor.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/api/renderer/main.php";
+$buffer = ""; // Initialiser un nouveau tampon vide
+
+function buffer(string $value) {
+ global $buffer;
+ $buffer = $buffer . $value;
+}
+
+buffer("<p>" . $lang["version"]["workswith"] . "<b><a href=\"" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/public") . "\" target=\"_blank\">Neutron</a> " . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/version") . " \"" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/codename") . "\"</b> (");
+if (isset($__electrode) && isset($__electrode_version) && isset($__electrode_node_version)) {
+ buffer("Electrode " . $__electrode_version . ", NodeJS " . $__electrode_node_version . ", ");
+}
+if (file_exists($GLOBALS["ORIGINAL_DOCUMENT_ROOT"] . "/NeutronCloud") && is_file($GLOBALS["ORIGINAL_DOCUMENT_ROOT"] . "/NeutronCloud")) {
+ if (isset($__electrode) && isset($__electrode_version) && isset($__electrode_node_version)) {
+ buffer("Electrode " . $__electrode_version . ", NodeJS " . $__electrode_node_version . ", Neutron Cloud)");
+ } else {
+ buffer("Neutron Cloud)");
+ }
+} else {
+ buffer("PHP " . PHP_VERSION . ", " . php_uname('s') . " " . php_uname('m') . " " . php_uname('r') . ")");
+}
+buffer($lang["version"]["renderer"][0] . "<b>" . $_RENDERER . $lang["version"]["renderer"][1] . $_VERSION . "</b>" . $lang["version"]["providedby"] . "<a href=\"https://minteck.ro.lt\" target=\"_blank\">Minteck</a>" . $lang["version"]["description"] . "</p>");
+buffer("<p>" . $lang["version"]["freesoftware"][0] . "<a href=\"https://www.gnu.org/licenses/gpl-3.0.html\" target=\"_blank\">" . $lang["version"]["freesoftware"][1] . "</a>" . $lang["version"]["freesoftware"][2] . "<a href=\"https://www.gnu.org/licenses/gpl-3.0.html\" target=\"_blank\">" . $lang["version"]["freesoftware"][3] . "</a>" . $lang["version"]["freesoftware"][4] . "</p>");
+buffer("<p>" . $lang["version"]["warranty"][0] . "<a href=\"https://www.gnu.org/licenses/gpl-3.0.html\" target=\"_blank\">" . $lang["version"]["warranty"][1] . "</a>" . $lang["version"]["warranty"][2] . "</p>");
+
+buffer("<h2>" . $lang["version"]["resources"] . "</h2>");
+buffer("<ul><li><a href=\"" . file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/api/bugs") . "/set_project.php?project_id=1\" target=\"_blank\">" . $lang["version"]["support"] . "</a></li>");
+buffer("<li><a href=\"https://minteck.ro.lt/creations/dev/neutron\" target=\"_blank\">" . $lang["version"]["minteck"] . "</a></li>");
+
+renderSpecial($buffer, $lang["version"]["title"]);
+
+?>