diff options
author | RaindropsSys <contact@minteck.org> | 2023-05-07 13:51:35 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-05-07 13:51:35 +0200 |
commit | 21b1d34b71d32e2c2867d420b2c04b45dc4095c2 (patch) | |
tree | b983f9942e0e76f22c65ce25008088510abe8de6 /_edit | |
parent | af4145a2961308ca88dd287d7057fcb4e8a896b6 (diff) | |
download | delta-21b1d34b71d32e2c2867d420b2c04b45dc4095c2.tar.gz delta-21b1d34b71d32e2c2867d420b2c04b45dc4095c2.tar.bz2 delta-21b1d34b71d32e2c2867d420b2c04b45dc4095c2.zip |
Updated 22 files, added 9 files and deleted upload/index.php (automated)
Diffstat (limited to '_edit')
-rw-r--r-- | _edit/index.php | 14 | ||||
-rw-r--r-- | _edit/save/index.php | 18 |
2 files changed, 26 insertions, 6 deletions
diff --git a/_edit/index.php b/_edit/index.php index 53a9b46..c2b72ff 100644 --- a/_edit/index.php +++ b/_edit/index.php @@ -50,15 +50,13 @@ if (!isset($_PROFILE["requests"][$id])): <form method="post" action="/_edit/save/?id=<?= $id ?>" id="main-form"> <div class="container"> <br><br> - <h1> + <h1 id="btn-area-container" style="display: grid; grid-template-columns: 1fr max-content;"> <?php if ($id !== $_USER): ?> <span><?= getNameFromId($id) ?></span> - <span id="btn-area" style="float: right;"><input id="form-btn" type="button" value="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary" <?= $_PROFILE["blocked"] >= 2 ? "disabled" : "" ?>> <a href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : "articles" ?>/<?= $id ?>" class="btn btn-outline-dark"><?= l("lang_edit_cancel") ?></a></span> <?php else: ?> <span><?= $data["nick_name"] ?? $data["first_name"] . " " . $data["last_name"] ?><?php if (isset($data["nick_name"]) && trim($data["nick_name"]) !== ""): ?> <small><small><small>(<?= $data["first_name"] . " " . $data["last_name"] ?>)</small></small></small><?php endif; ?></span> - <span id="btn-area" style="float: right;"><input id="form-btn" type="button" value="<?= l($id === $_USER ? "lang_profile_save" : "lang_edit_save") ?>" class="btn btn-outline-primary" <?= $_PROFILE["blocked"] >= 1 ? "disabled" : "" ?>> <a href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/articles/" . $id . ".json") ? "articles" : (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gallery/" . $id . ".json") ? "gallery" : "profile")) ?>/<?= $id ?>" class="btn btn-outline-dark"><?= l("lang_edit_cancel") ?></a></span> <?php endif; ?> - </span> + <span id="btn-area" class="btn-group"><a style="height: 38px;" id="form-btn" title="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary btn-with-img <?= $_PROFILE["blocked"] >= 2 ? "disabled" : "" ?>" data-bs-toggle="tooltip"><img src="/icons/save.svg<?= $_PROFILE["blocked"] >= 2 ? "" : "?p" ?>" style="width: 24px;"></a><a style="height: 38px;" href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : "articles" ?>/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_edit_cancel") ?>" data-bs-toggle="tooltip"><img src="/icons/close.svg" style="width: 24px;"></a></span> </h1> <?php if ($self && $_PROFILE["blocked"] === 1): ?> @@ -125,9 +123,13 @@ if (!isset($_PROFILE["requests"][$id])): <?php else: ?> <div class="container"> <br><br> - <h1> + <h1 id="btn-area-container" style="display: grid; grid-template-columns: 1fr max-content;"> + <?php if ($id !== $_USER): ?> <span><?= getNameFromId($id) ?></span> - <span id="btn-area" style="float: right;"><input disabled id="form-btn" type="button" value="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary"> <a href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gallery/" . $id . ".json") ? "gallery" : "articles") ?>/<?= $id ?>" class="btn btn-outline-dark"><?= l("lang_edit_cancel") ?></a></span> + <?php else: ?> + <span><?= $data["nick_name"] ?? $data["first_name"] . " " . $data["last_name"] ?><?php if (isset($data["nick_name"]) && trim($data["nick_name"]) !== ""): ?> <small><small><small>(<?= $data["first_name"] . " " . $data["last_name"] ?>)</small></small></small><?php endif; ?></span> + <?php endif; ?> + <span id="btn-area" class="btn-group"><a style="height: 38px;" id="form-btn" title="<?= l("lang_edit_save") ?>" class="btn btn-outline-primary btn-with-img disabled" data-bs-toggle="tooltip"><img src="/icons/save.svg" style="width: 24px;"></a><a style="height: 38px;" href="/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") ? "people" : "articles" ?>/<?= $id ?>" class="btn btn-outline-dark btn-with-img" title="<?= l("lang_edit_cancel") ?>" data-bs-toggle="tooltip"><img src="/icons/close.svg" style="width: 24px;"></a></span> </h1> <div class="alert alert-warning"> diff --git a/_edit/save/index.php b/_edit/save/index.php index 6a777b3..3e16871 100644 --- a/_edit/save/index.php +++ b/_edit/save/index.php @@ -73,6 +73,24 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".j $_PROFILE["update"] = date('c'); } +$config = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/email.json"), true); + +if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/people/" . $id . ".json") || file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gallery/" . $id . ".json") || file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/articles/" . $id . ".json")) { + file_get_contents('https://notifications.equestria.dev/delta', false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: " . formatPonypush("New change request published") . "\r\n" . + "Priority: default\r\n" . + "Tags: requests\r\n" . + "Actions: view, Open change requests, https://delta.equestria.dev/admin/requests/, clear=true\r\n" . + "Authorization: Basic " . base64_encode($config["ntfyuser"] . ":" . $config["ntfypass"]), + 'content' => formatPonypush($_PROFILE['first_name'] . " " . $_PROFILE["last_name"] . " published a request to change " . getNameFromId($id) . (isset($_POST["summary"]) && trim($_POST["summary"]) !== "" ? ": " . $_POST["summary"] : "")) + ] + ])); +} + if ($id === $_USER) { saveProfile(); header("Location: /profile/" . $id); |