aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/cms-special/admin-v2/footer
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-v2/footer
parent80f78c2925530e945503ab603e79d1acc53075f4 (diff)
downloadelectrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.gz
electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.bz2
electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.zip
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin-v2/footer')
-rw-r--r--Neutron-trunk/cms-special/admin-v2/footer/index.php71
1 files changed, 71 insertions, 0 deletions
diff --git a/Neutron-trunk/cms-special/admin-v2/footer/index.php b/Neutron-trunk/cms-special/admin-v2/footer/index.php
new file mode 100644
index 0000000..bc37967
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin-v2/footer/index.php
@@ -0,0 +1,71 @@
+<?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-v2/\$resources/precontent.php"; ?>
+ <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>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/\$resources/postcontent.php"; ?>
+
+<script>
+
+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-v2/$panes/personalization.php";
+ } 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
+ });
+}
+
+</script> \ No newline at end of file