diff options
author | Gitea <gitea@fake.local> | 2021-11-10 17:53:13 +0100 |
---|---|---|
committer | Gitea <gitea@fake.local> | 2021-11-10 17:53:13 +0100 |
commit | 7b4af63a90a726b98a59b83e53f040a7a566a11d (patch) | |
tree | b85747947816fe4375e85ab6b822ffabec548c7b /Neutron-trunk/cms-special/admin/pages | |
parent | 80f78c2925530e945503ab603e79d1acc53075f4 (diff) | |
download | electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.gz electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.bz2 electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.zip |
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin/pages')
-rw-r--r--[-rwxr-xr-x] | Neutron-trunk/cms-special/admin/pages/add/index.php | 145 | ||||
-rw-r--r--[-rwxr-xr-x] | Neutron-trunk/cms-special/admin/pages/delete/index.php | 88 | ||||
-rw-r--r--[-rwxr-xr-x] | Neutron-trunk/cms-special/admin/pages/edit/index.php | 194 | ||||
-rw-r--r--[-rwxr-xr-x] | Neutron-trunk/cms-special/admin/pages/index.php | 66 | ||||
-rw-r--r--[-rwxr-xr-x] | Neutron-trunk/cms-special/admin/pages/rename/index.php | 89 |
5 files changed, 5 insertions, 577 deletions
diff --git a/Neutron-trunk/cms-special/admin/pages/add/index.php b/Neutron-trunk/cms-special/admin/pages/add/index.php index 54dacdb..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/add/index.php +++ b/Neutron-trunk/cms-special/admin/pages/add/index.php @@ -1,145 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Nouvelle page - Pages", "headerName" => "Nouvelle page" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <p> - <form name="settings"> - <div class="nd_Field nd_Field_input nd_Field__centered" id="namebox"> - <input id="name" name="name" type="text" placeholder="<?= $lang["admin-pages"]["pagename"] ?>" spellcheck="false" autocomplete="off"> - <label for="name"><?= $lang["admin-pages"]["pagename"] ?></label> - </div><br> - <input style="display:none;" type="radio" id="type-visual" value="visual" onchange="switchEditor()" name="type" checked> - <input style="display:none;" type="radio" id="type-html" onchange="switchEditor()" value="html" name="type"> - <div style="text-align: center;"><div id="ptype-visual" class="mdc-card mdc-card--outlined mdc-card--selected" onclick="document.getElementsByName('type')[0].value = 'visual';switchEditor();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-pages"]["editors"][0] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-pages"]["editordescs"][0] ?></h3> - </div> - </div> - </div> - <div id="ptype-html" class="mdc-card mdc-card--outlined" onclick="document.getElementsByName('type')[0].value = 'html';switchEditor();" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card__primary-action" tabindex="0" style="padding:0;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-pages"]["editors"][1] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?= $lang["admin-pages"]["editordescs"][1] ?></h3> - </div> - </div> - </div></div> - </form> - </p> - <div id="editing"><div id="editor-visual"> - <?php - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/VisualEditor$2.php"; - ?></div> - <div id="editor-html" class="hide"> - <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/CodeEditor$2.php" ?> - </div> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - window.onbeforeunload = function (e) { - e = e || window.event; - - // For IE and Firefox prior to version 4 - if (e) { - e.returnValue = "<?= $lang["admin-pages"]["quitwarn"] ?>"; - } - - // For Safari - return "<?= $lang["admin-pages"]["quitwarn"] ?>"; - }; -</script> - -<script> - -function createPageVisual() { - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", document.getElementById('name').value); - formData.append("type", "0"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/create_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function createPageVisualNoBack() { - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = true}) - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", document.getElementById('name').value); - formData.append("type", "0"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/create_page.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-pages"]["saved"] ?>"); - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - Array.from(document.getElementsByTagName('input')).forEach((el) => {el.disabled = false}) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function switchEditor() { - if (document.forms['settings'].type.value == "visual") { - document.getElementById('editor-visual').classList.remove('hide') - document.getElementById('editor-html').classList.add('hide') - document.getElementById('ptype-html').classList.remove('mdc-card--selected'); - document.getElementById('ptype-visual').classList.add('mdc-card--selected'); - } else { - document.getElementById('editor-visual').classList.add('hide') - document.getElementById('editor-html').classList.remove('hide') - document.getElementById('ptype-visual').classList.remove('mdc-card--selected'); - document.getElementById('ptype-html').classList.add('mdc-card--selected'); - loadAce() - } - document.body.focus(); -} - -document.forms['settings'].type.value = "visual" - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/delete/index.php b/Neutron-trunk/cms-special/admin/pages/delete/index.php index 4cbcb49..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/delete/index.php +++ b/Neutron-trunk/cms-special/admin/pages/delete/index.php @@ -1,88 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['slug'])) { - $currentSlug = $_GET['slug']; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $currentSlug)) {} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php - -if ($currentSlug == "index") { - $currentName = "{$lang["admin-pages"]["home"]}"; - echo("<script>page = \"index\"</script>"); -} else { - $currentName = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $currentSlug . "/pagename"); - echo("<script>page = \"{$currentSlug}\"</script>"); -} - -?> - <div id="confirm"> - <div style="text-align:center;"> - <p><?= $lang["admin-pages"]["deletec"][0] . $currentName . $lang["admin-pages"]["deletec"][1] ?></p> - <?php - - if ($currentSlug == "index") { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<i>{$lang["admin-pages"]["deletec"][2]}</i></div></body></html>"); - } - - ?> - <!--<ul> - <li><a onclick="deletePage()" class="sblink" title="<?= $lang["admin-pages"]["deleteyl"] ?>"><?= $lang["admin-pages"]["deletey"] ?></a></li> - <li><a onclick="location.href='/cms-special/admin/pages/manage/?slug=<?= $currentSlug ?>'" class="sblink" title="<?= $lang["admin-pages"]["deletenl"] ?>"><?= $lang["admin-pages"]["deleten"] ?></a></li> - </ul>--> - <a title="<?= $lang["admin-pages"]["deletenl"] ?>" onclick="location.href='/cms-special/admin/pages';" class="mdc-button mdc-button--raised"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["deleten"] ?></span> - </a> - <a title="<?= $lang["admin-pages"]["deleteyl"] ?>" onclick="deletePage();" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["deletey"] ?></span> - </a> - </div> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function deletePage() { - document.getElementById('confirm').classList.add('hide') - document.getElementById('loader').classList.remove('hide') - var formData = new FormData(); - formData.append("page", "<?= $currentSlug ?>"); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/delete_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/edit/index.php b/Neutron-trunk/cms-special/admin/pages/edit/index.php index b198566..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/edit/index.php +++ b/Neutron-trunk/cms-special/admin/pages/edit/index.php @@ -1,194 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['slug'])) { - $currentSlug = $_GET['slug']; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $currentSlug)) {} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - <div id="editing"> - <?php - - if ($currentSlug == "index") { - $currentName = "{$lang["admin-pages"]["home"]}"; - echo("<script>page = \"index\"</script>"); - } else { - $currentName = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $currentSlug . "/pagename"); - echo("<script>page = \"{$currentSlug}\"</script>"); - } - - $type = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $currentSlug); - if (isset($_GET['forcehtml'])) { - $type = "1"; - } - if ($type == "0") { - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/VisualEditor.php"; - } - if ($type == "1"): - - ?> - <p><table class="message_warning"><tbody><tr><td><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/message_warning.svg" class="message_img"></td><td style="width:100%;"><p><?= $lang["admin-pages"]["htmlw"][0] ?></p><p><?= $lang["admin-pages"]["htmlw"][1] ?></p></td></tr></tbody></table></p> - <?php - - require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/CodeEditor.php"; - endif; - - ?> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="<?= $GLOBALS["SYSTEM_ROOT"] ?>/resources/image/loader.svg" class="loader"></div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - window.onbeforeunload = function (e) { - e = e || window.event; - - // For IE and Firefox prior to version 4 - if (e) { - e.returnValue = "<?= $lang["admin-pages"]["quitwarn"] ?>"; - } - - // For Safari - return "<?= $lang["admin-pages"]["quitwarn"] ?>"; - }; -</script> - -<script> - -function updatePage() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - window.onbeforeunload = null; - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updatePageNoBack() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", editor.getData()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-pages"]["saved"] ?>"); - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updatePageHTMLNoBack() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", ace.edit("editor").getValue()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - alert("<?= $lang["admin-pages"]["saved"] ?>"); - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -function updatePageHTML() { - document.getElementById('loader').classList.remove('hide') - document.getElementById('editing').classList.add('hide') - var formData = new FormData(); - formData.append("title", "<?= $currentSlug ?>"); - formData.append("content", ace.edit("editor").getValue()); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/edit_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('editing').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/index.php b/Neutron-trunk/cms-special/admin/pages/index.php index d8e1e3d..e977d90 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/index.php +++ b/Neutron-trunk/cms-special/admin/pages/index.php @@ -1,66 +1,2 @@ <?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Gestionnaire de pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> - - <div class="admin-pages-list"> - <?php - - $pages = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/"); - $sizetotal = 0; - foreach ($pages as $page) { - if ($page != "." && $page != "..") { - $type = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pagetypes/" . $page); - $size = filesize($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $page); - if ($size > 1024) { - if ($size > 1048576) { - $sizestr = round($size / 1048576, 2) . " " . $lang["sizes"]["mib"]; - } else { - $sizestr = round($size / 1024, 2) . " " . $lang["sizes"]["kib"]; - } - } else { - $sizestr = $size . " " . $lang["sizes"]["bytes"]; - } - $sizetotal = $sizetotal + $size; - $sizestr = str_replace(".", ",", $sizestr); - if ($page == "index"): ?> -<!-- echo("<li><a href='/cms-special/admin/pages/manage/?slug={$page}' class='sblink' title='{$lang['admin-pages']['lore']}'>{$lang['admin-pages']['home']}</a> ({$page}), {$typestr}, {$sizestr}</li>");--> - <div class="mdc-card mdc-card--outlined" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;" class="mdc-typography mdc-typography--headline6"><?= $lang["admin-pages"]["home"] ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?php $text = strip_tags(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $page));if (strlen($text)>100){echo(substr($text,0,100) . " …");}else{echo($text);} ?></h3> - </div><br><br> - <div class="mdc-card__actions mdc-card__actions-pages-list"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/edit/?slug=<?= $page ?>" title="<?= $lang["admin-pages"]["editl"] ?>" class="mdc-button mdc-card__action mdc-card__action--button"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["edit"] ?></span> - </a> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/edit/?slug=<?= $page ?>&forcehtml" class="material-icons mdc-icon-button mdc-card__action mdc-card__action--icon mdi-icbtn-card" title="<?= $lang["admin-pages"]["editcode"] ?>">code</a> - </div> - </div> - <?php else: ?> - <div class="mdc-card mdc-card--outlined" style="width:256px;margin:10px;display:inline-block;"> - <div class="mdc-card-wrapper__text-section" style="padding-left:5px;padding-right:5px;"> - <h2 style="margin-bottom:5px;white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;" class="mdc-typography mdc-typography--headline6"><?= file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $page . "/pagename") ?></h2> - <h3 style="margin-top:5px;" class="mdc-typography mdc-typography--subtitle2"><?php $text = strip_tags(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $page));if (strlen($text)>100){echo(substr($text,0,100) . " …");}else{echo($text);} ?></h3> - </div><br><br> - <div class="mdc-card__actions mdc-card__actions-pages-list"> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/edit/?slug=<?= $page ?>" title="<?= $lang["admin-pages"]["editl"] ?>" class="mdc-button mdc-card__action mdc-card__action--button"> - <div class="mdc-button__ripple"></div> - <span class="mdc-button__label"><?= $lang["admin-pages"]["edit"] ?></span> - </a> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/rename/?slug=<?= $page ?>" class="material-icons mdc-icon-button mdc-card__action mdc-card__action--icon mdi-icbtn-card" title="<?= $lang["admin-pages"]["renamel"] ?>">create</a> - <a href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/delete/?slug=<?= $page ?>" class="material-icons mdc-icon-button mdc-card__action mdc-card__action--icon mdi-icbtn-card" title="<?= $lang["admin-pages"]["deletel"] ?>">delete</a> - </div> - </div> - <?php endif; - } - } - ?> - </div> - <p><div style="text-align: center;"> - <a title="<?= $lang["admin-pages"]["alore"] ?>" href="<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages/add" class="mdc-button mdc-button--outlined"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">add</i> - <span class="mdc-button__label"><?= $lang["admin-pages"]["create"] ?></span> - </a> - </div></p> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file diff --git a/Neutron-trunk/cms-special/admin/pages/rename/index.php b/Neutron-trunk/cms-special/admin/pages/rename/index.php index d7118ba..3674402 100755..100644 --- a/Neutron-trunk/cms-special/admin/pages/rename/index.php +++ b/Neutron-trunk/cms-special/admin/pages/rename/index.php @@ -1,89 +1,2 @@ <?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -if (isset($_GET['slug'])) { - $currentSlug = $_GET['slug']; - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/pages/" . $currentSlug)) {} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); - } -} else { - header("Location: /cms-special/admin/pages"); - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit(); -} - -?> -<?php $pageConfig = [ "domName" => "Pages", "headerName" => "Pages" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?> -<?php - -if ($currentSlug == "index") { - $currentName = "{$lang["admin-pages"]["home"]}"; - echo("<script>page = \"index\"</script>"); -} else { - $currentName = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $currentSlug . "/pagename"); - echo("<script>page = \"{$currentSlug}\"</script>"); -} - -?> - <div id="confirm"> - <p><?= $lang["admin-pages"]["renamew"][0] . $currentName . $lang["admin-pages"]["renamew"][1] ?></p> - <?php - - if ($currentSlug == "index") { - require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("<i>{$lang["admin-pages"]["renamew"][2]}</i></div></body></html>"); - } - - ?> - <div class="nd_Field nd_Field_input nd_Field__centered nd_Field__disabled" id="onamebox"> - <input id="oldname" name="oldname" type="text" placeholder="<?= $lang["admin-pages"]["oname"] ?>" spellcheck="false" disabled autocomplete="off" value="<?= $currentName ?>"> - <label for="name"><?= $lang["admin-pages"]["oname"] ?></label> - </div><div class="nd_Field nd_Field_input nd_Field__centered" id="nnamebox"> - <input id="newname" name="newname" type="text" placeholder="<?= $lang["admin-pages"]["nname"] ?>" spellcheck="false" autocomplete="off" value="<?= $currentName ?>"> - <label for="name"><?= $lang["admin-pages"]["nname"] ?></label> - </div> - <p><div style="text-align: center;"> - <a title="<?= $lang["admin-pages"]["renamel2"] ?>" onclick="renamePage();" class="mdc-button mdc-button--raised"> - <div class="mdc-button__ripple"></div> - <i class="material-icons-outlined mdc-button__icon" aria-hidden="true">edit</i> - <span class="mdc-button__label"><?= $lang["admin-pages"]["rename2"] ?></span> - </a> - </div></p> - </div> - <div class="hide" id="loader" style="text-align: center;"><img src="/resources/image/loader.svg" class="loader"> - </div> -<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?> - -<script> - -function renamePage() { - document.getElementById('confirm').classList.add('hide') - document.getElementById('loader').classList.remove('hide') - var formData = new FormData(); - formData.append("page", "<?= $currentSlug ?>"); - formData.append("newname", document.getElementById('newname').value); - $.ajax({ - type: "POST", - dataType: 'html', - url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/rename_page.php", - success: function (data) { - if (data == "ok") { - location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/pages"; - } else { - alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data) - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - } - }, - error: function (error) { - alert("<?= $lang["admin-errors"]["connerror"] ?>") - document.getElementById('loader').classList.add('hide') - document.getElementById('confirm').classList.remove('hide') - }, - data: formData, - cache: false, - contentType: false, - processData: false - }); -} - -</script>
\ No newline at end of file +<?php header("Location: {$GLOBALS["SYSTEM_ROOT"]}/cms-special/admin-v2"); require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php"; quit(); ?>
\ No newline at end of file |