aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/cms-special/admin/calendar/index.php
diff options
context:
space:
mode:
authorGitea <gitea@fake.local>2021-11-10 17:53:13 +0100
committerGitea <gitea@fake.local>2021-11-10 17:53:13 +0100
commit7b4af63a90a726b98a59b83e53f040a7a566a11d (patch)
treeb85747947816fe4375e85ab6b822ffabec548c7b /Neutron-trunk/cms-special/admin/calendar/index.php
parent80f78c2925530e945503ab603e79d1acc53075f4 (diff)
downloadelectrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.gz
electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.bz2
electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.zip
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin/calendar/index.php')
-rw-r--r--[-rwxr-xr-x]Neutron-trunk/cms-special/admin/calendar/index.php87
1 files changed, 1 insertions, 86 deletions
diff --git a/Neutron-trunk/cms-special/admin/calendar/index.php b/Neutron-trunk/cms-special/admin/calendar/index.php
index e596551..7d45b3e 100755..100644
--- a/Neutron-trunk/cms-special/admin/calendar/index.php
+++ b/Neutron-trunk/cms-special/admin/calendar/index.php
@@ -1,86 +1 @@
-<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
-<?php $pageConfig = [ "domName" => "Calendrier", "headerName" => "Gestion des événements" ]; include_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?>
- <?php
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/calendar_events")) {
- $calevn = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/calendar_events");
- } else {
- $calevn = "3";
- }
-
- ?>
- <?= $lang["admin-calendar"]["show"][0] ?> <select onchange="updateNextEvents()" id="nextevents">
- <option value="1" <?php if ($calevn == "1") { echo("selected"); } ?>>1</option>
- <option value="2" <?php if ($calevn == "2") { echo("selected"); } ?>>2</option>
- <option value="3" <?php if ($calevn == "3") { echo("selected"); } ?>>3</option>
- <option value="4" <?php if ($calevn == "4") { echo("selected"); } ?>>4</option>
- <option value="5" <?php if ($calevn == "5") { echo("selected"); } ?>>5</option>
- <option value="6" <?php if ($calevn == "6") { echo("selected"); } ?>>6</option>
- <option value="7" <?php if ($calevn == "7") { echo("selected"); } ?>>7</option>
- <option value="8" <?php if ($calevn == "8") { echo("selected"); } ?>>8</option>
- <option value="9" <?php if ($calevn == "9") { echo("selected"); } ?>>9</option>
- <option value="10" <?php if ($calevn == "10") { echo("selected"); } ?>>10</option>
- </select> <?= $lang["admin-calendar"]["show"][1] ?>
- <h3><?= $lang["admin-calendar"]["events"] ?></h3>
- <ul>
- <?php
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json")) {
- $dbraw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/caldb.json");
- $corrupted = false;
- if (isJson($dbraw)) {
- $events = json_decode($dbraw);
- foreach ($events->events as $event) {
- if (isset($event->timestamp)) {
- echo("<li><span style=\"cursor:help;\" title=\"" . $event->description . "\">" . $event->name . "</span> (" . $event->datestr . ")" . " - <a class=\"sblink\" href=\"{$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin/calendar/manage/?id=" . $event->timestamp . "\" title=\"{$lang['admin-calendar']['manageph']}\">" . $lang["admin-calendar"]["manage"] . "</a></li>");
- }
- }
- } else {
- echo("<div style=\"color:red; text-align: center;\"><b><u>{$lang['admin-calendar']['corrupt'][0]}</u> {$lang['admin-calendar']['corrupt'][1]} <u>{$lang['admin-calendar']['corrupt'][2]}</u></b></div>");
- $corrupted = true;
- }
- } else {
- echo("<div style=\"text-align: center;\">{$lang['admin-calendar']['nothing']}</div>");
- }
-
- ?>
- <?php
-
- if (!$corrupted) {
- echo('<br><li><i><a href="' . $GLOBALS["SYSTEM_ROOT"] . '/cms-special/admin/calendar/add" title="' . $lang["admin-calendar"]["addph"] . '" class="sblink">' . $lang["admin-calendar"]["add"] . '</a></i></li>');
- }
-
- ?>
- </ul>
-<?php include_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
-<script>
-
-function updateNextEvents() {
- value = document.getElementById('nextevents').value;
- var formData = new FormData();
- formData.append("value", value);
- document.getElementById('nextevents').disabled = true;
- $.ajax({
- type: "POST",
- dataType: 'html',
- url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/calendar_nextevents.php",
- success: function (data) {
- if (data == "ok") {
- document.getElementById('nextevents').disabled = false;
- } else {
- alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data)
- document.getElementById('nextevents').disabled = false;
- }
- },
- error: function (error) {
- alert("<?= $lang["admin-errors"]["connerror"] ?>")
- document.getElementById('nextevents').disabled = false;
- },
- data: formData,
- cache: false,
- contentType: false,
- processData: false
- });
-}
-
-</script> \ No newline at end of file
+<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?><?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?> \ No newline at end of file