From e72d0adbcd7e69928a1ef380c7a841c160284c68 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 2 Jan 2023 20:29:01 +0100 Subject: Update --- pages/rules.inc | 251 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 175 insertions(+), 76 deletions(-) (limited to 'pages/rules.inc') diff --git a/pages/rules.inc b/pages/rules.inc index cf88eb1..2268e75 100644 --- a/pages/rules.inc +++ b/pages/rules.inc @@ -1,6 +1,40 @@ $rule) { + if (!isset($rule["name"]) || !isset($rule["content"]) && !is_numeric($index)) { + header("Location: /-/rules"); + die(); + } + + if (trim($rule["name"]) === "") { + unset($_POST["payload"][$index]); + continue; + } + + if (!isset($rule["approved"])) $rule["approved"] = []; + if (isset($rule["approved"][0])) $rule["approved"][0] = true; else $rule["approved"][0] = false; + if (isset($rule["approved"][1])) $rule["approved"][1] = true; else $rule["approved"][1] = false; + + $_POST["payload"][$index] = $rule; + } + + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json", utf8_encode(json_encode($_POST["payload"]))); + + header("Location: /-/rules"); + die(); +} + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc'; ?> @@ -8,95 +42,159 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
-

General rules

-

Click on a rule in the list to view the history of that rule, including all amendments. Note that older versions of a rule cannot be enforced anymore and are provided only for informational purposes.

+

Rules

+

Edit rules

- - + $rules = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/rules/rules.json"), true); -
    -
  • -
    - - 0): ?>-: : - + $protectorCloudburst = array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "ynmuc" && $i["_metadata"]["protector"]; + }))[0]; + $protectorRaindrops = array_values(array_filter(scoreOrderGlobal(), function ($i) { + return $i["_system"] === "gdapd" && $i["_metadata"]["protector"]; + }))[0]; -
      - 0): ?> - + $pcName = getMiniName($protectorCloudburst["display_name"] ?? $protectorCloudburst["name"]); + $prName = getMiniName($protectorRaindrops["display_name"] ?? $protectorRaindrops["name"]); - -
    • Curent version:
    • - -
    • Amendment Preamble-:
    • - + ?> - -
    • Original rule:
    • - -
    • - This rule was never amended. -
    • - -
    -
    -
  • -
- - - -

Articles .1 to .:

- -
    - -
  • -
    - - Article . 0): ?>-: : - - -
      - 0): ?> - - - -
    • Curent version:
    • - -
    • Amendment Preamble-:
    • - - - -
    • Original rule:
    • - -
    • - This rule was never amended. -
    • + +

      + Rule : + + Unapproved -

    -
    + + +
    + This rule has not yet been approved. All rules need to be approved by the leaders from both systems. This rule is still missing approval from . +
    + +
    +

    text(strip_tags($rule["content"])) ?>

    +
  • - -
- - + +
+
- + + +