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/plugins/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/plugins/index.php')
-rw-r--r-- | Neutron-trunk/cms-special/admin-v2/plugins/index.php | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/Neutron-trunk/cms-special/admin-v2/plugins/index.php b/Neutron-trunk/cms-special/admin-v2/plugins/index.php deleted file mode 100644 index 2676076..0000000 --- a/Neutron-trunk/cms-special/admin-v2/plugins/index.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php require_once "../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?> -<?php - -$pageConfig = [ "domName" => "Extensions", "headerName" => "Extensions" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin-v2/\$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-v2/\$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 |