summaryrefslogtreecommitdiff
path: root/includes/system/tree.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
committerMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
commit3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch)
tree75be5fba4368472fb11c8015aee026b2b9a71888 /includes/system/tree.inc
parent8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff)
downloadpluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'includes/system/tree.inc')
-rw-r--r--includes/system/tree.inc114
1 files changed, 0 insertions, 114 deletions
diff --git a/includes/system/tree.inc b/includes/system/tree.inc
deleted file mode 100644
index 6a2d1cc..0000000
--- a/includes/system/tree.inc
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php global $system; global $systemCommonName; global $lang; global $pages; global $systemID; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); $title = $pages["s:tree"]["name"][$lang["_name"]] . " ยท " . $systemCommonName; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/header.inc';
-
-$members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$systemID/members.json"), true);
-$members = scoreOrder($members, $systemID);
-
-$subsystems = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID.json"), true) ?? [];
-
-function getMember(string $id) {
- global $systemID;
- global $members;
-
- $member = null;
-
- foreach ($members as $m) {
- if ($m["id"] === $id) $member = $m;
- }
-
- return $member;
-}
-
-function memberHasSubsystem(array $member) {
- global $subsystems;
- $has = false;
-
- foreach ($subsystems as $subsystem) {
- if ($subsystem["source_type"] === "member" && $subsystem["source"] === $member["id"]) {
- $has = true;
- }
- }
-
- return $has;
-}
-
-function memberPartOfSubsystem(array $member) {
- global $subsystems;
- $is = false;
-
- foreach ($subsystems as $subsystem) {
- if (in_array($member["id"], $subsystem["members"])) {
- $is = true;
- }
- }
-
- return $is;
-}
-
-function getMemberSubsystem(array $member) {
- global $subsystems;
- $subsystem = null;
-
- foreach ($subsystems as $ss) {
- if ($ss["source_type"] === "member" && $ss["source"] === $member["id"]) {
- $subsystem = $ss;
- }
- }
-
- return $subsystem;
-}
-
-?>
-
- <br>
- <div class="container" id="page-content">
- <h2><?= $lang["tree"]["title"] ?> <?= $systemCommonName ?></h2>
- <a class="tree-root member-link" href="/<?= $system ?>">
- <img src="/assets/uploads/<?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/" . $system . ".png") ? $system : "" ?>.png" style="height:24px;"> <span style="vertical-align: middle;"><?= $systemCommonName ?></span></a>
- <?php $first = true; ?>
- <?php foreach ($subsystems as $subsystem): if ($subsystem["source_type"] === "trait"): ?>
- <div class="tree-l0">
- <div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>">&nbsp;</div>
- <div class="tree-inner">
- <a class="member-link" href="/<?= $systemID === "gdapd" ? "raindrops" : "cloudburst" ?>/-/subsystem/<?= $subsystem["source"] ?>">
- <img src="/assets/uploads/ss-<?= $subsystem["source"] ?>.png" style="height:24px;border-radius:5px;"> <span style="vertical-align: middle;"><?= file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json") ? json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/$systemID-$subsystem[source].json"), true)["name"] : $subsystem["source"] ?></span>
- </a>
- </div>
- <?php $ssfirst = true; foreach ($subsystem["members"] as $ssm): $ssmember = getMember($ssm); ?>
- <div class="tree-l1">
- <div class="tree-l0-separator">&nbsp;</div>
- <div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>">&nbsp;</div>
- <div class="tree-inner">
- <a class="member-link" href="/<?= $ssmember["name"] ?>">
- <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
- </a>
- </div>
- </div>
- <?php $ssfirst = false; endforeach; ?>
- </div>
- <?php $first = false; endif; endforeach; ?>
- <?php foreach ($members as $member): if (!memberPartOfSubsystem($member)): ?>
- <div class="tree-l0">
- <div class="tree-l0-separator<?= $first ? " tree-first-separator" : "" ?>">&nbsp;</div>
- <div class="tree-inner">
- <a class="member-link" href="/<?= $member["name"] ?>">
- <img src="<?= getAsset($systemID, $member["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $member["display_name"] ?? $member["name"] ?></span>
- </a>
- </div>
- <?php if (memberHasSubsystem($member)): ?>
- <?php $ssfirst = true; foreach (getMemberSubsystem($member)["members"] as $ssm): $ssmember = getMember($ssm); ?>
- <div class="tree-l1">
- <div class="tree-l0-separator">&nbsp;</div>
- <div class="tree-l1-separator<?= $ssfirst ? " tree-first-separator" : "" ?>">&nbsp;</div>
- <div class="tree-inner">
- <a class="member-link" href="/<?= $ssmember["name"] ?>">
- <img src="<?= getAsset($systemID, $ssmember["id"], "heads") ?>" style="height:24px;"> <span style="vertical-align: middle;"><?= $ssmember["display_name"] ?? $ssmember["name"] ?></span>
- </a>
- </div>
- </div>
- <?php $ssfirst = false;endforeach; ?>
- <?php endif; ?>
- </div>
- <?php $first = false; endif; endforeach; ?>
- </div>
-
-<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.inc'; ?> \ No newline at end of file