diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:50 +0100 |
commit | 8fabf77b2a7720a357c63817c07035a9908818a0 (patch) | |
tree | d689fcac1403e2473010fe80bc337599a78c21a4 /Neutron-trunk/cms-special/admin-v2/appearance/index.php | |
parent | 7b4af63a90a726b98a59b83e53f040a7a566a11d (diff) | |
download | electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.gz electrode-8fabf77b2a7720a357c63817c07035a9908818a0.tar.bz2 electrode-8fabf77b2a7720a357c63817c07035a9908818a0.zip |
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin-v2/appearance/index.php')
-rw-r--r-- | Neutron-trunk/cms-special/admin-v2/appearance/index.php | 145 |
1 files changed, 0 insertions, 145 deletions
diff --git a/Neutron-trunk/cms-special/admin-v2/appearance/index.php b/Neutron-trunk/cms-special/admin-v2/appearance/index.php deleted file mode 100644 index 4d15264..0000000 --- a/Neutron-trunk/cms-special/admin-v2/appearance/index.php +++ /dev/null @@ -1,145 +0,0 @@ -<?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"; ?> - <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> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/\$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('appearance-error').innerHTML = "<?= $lang["admin-errors"]["connerror"] ?>" - document.getElementById('appearance-error-box').classList.remove("hide") - document.getElementById('appearance-loader').classList.add('hide') - document.getElementById('appearance-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 |