aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php
diff options
context:
space:
mode:
authorMinteck <nekostarfan@gmail.com>2021-08-24 15:38:16 +0200
committerMinteck <nekostarfan@gmail.com>2021-08-24 15:38:16 +0200
commit529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105 (patch)
tree8a50c30271b9b328cde0d907b1441f2dabdc341b /Neutron-trunk/cms-special/admin/gallery/addcategory/index.php
parent15e4724761c50b30803df1811a525c85058f70bf (diff)
downloadelectrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.gz
electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.tar.bz2
electrode-529ffcbfa97ab51a64a97f6dff08aeb2bc0cc105.zip
Update
Diffstat (limited to 'Neutron-trunk/cms-special/admin/gallery/addcategory/index.php')
-rw-r--r--Neutron-trunk/cms-special/admin/gallery/addcategory/index.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php b/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php
new file mode 100644
index 0000000..68451fc
--- /dev/null
+++ b/Neutron-trunk/cms-special/admin/gallery/addcategory/index.php
@@ -0,0 +1,39 @@
+<?php require_once "../../../../resources/private/relative.php"; getRelativeDetails("cms-special"); ?>
+<?php $pageConfig = [ "domName" => "Nouvelle catégorie - Galerie de photos", "headerName" => "Nouvelle catégorie" ]; require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/precontent.php"; ?>
+ <div id="hidding">
+ <input type="text" id="catname" placeholder="<?= $lang["admin-gallery"]["addcat"]["placeholder"] ?>">
+ <p><i><?= $lang["admin-gallery"]["addcat"]["same"] ?></i></p>
+ <p><div style="text-align: center;"><a class="button" onclick="createCat()"><?= $lang["admin-gallery"]["addcat"]["confirm"] ?></a></div></p>
+ </div>
+<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/cms-special/admin/\$resources/postcontent.php"; ?>
+
+<script>
+
+function createCat() {
+ document.getElementById('hidding').classList.add('hide')
+ var formData = new FormData();
+ formData.append("category", document.getElementById('catname').value);
+ $.ajax({
+ type: "POST",
+ dataType: 'html',
+ url: "<?= $GLOBALS["SYSTEM_ROOT"] ?>/api/admin/galery_create_category.php",
+ success: function (data) {
+ if (data == "ok") {
+ location.href = "<?= $GLOBALS["SYSTEM_ROOT"] ?>/cms-special/admin/gallery";
+ } else {
+ alert("<?= $lang["admin-errors"]["errorprefix"] ?>" + data)
+ document.getElementById('hidding').classList.remove('hide')
+ }
+ },
+ error: function (error) {
+ alert("<?= $lang["admin-errors"]["connerror"] ?>")
+ document.getElementById('hidding').classList.remove('hide')
+ },
+ data: formData,
+ cache: false,
+ contentType: false,
+ processData: false
+ });
+}
+
+</script> \ No newline at end of file