"; $part2 = null; $part3 = null; if (isset($pages[$name])) { if (($name === "docs" || $name === "toys" || $name === "actions" || $name === "computers") && isset($parts[2])) { $part3 = "Dashboard"; $part2 = "" . $pages[$name]['name'][$lang["_name"]] . ""; if ($name === "docs") { $actionsProfile = "docs-item"; $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/docs/" . $parts[2] . ".json"), true)["name"]; } elseif ($name === "computers") { $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $parts[2] . ".json"), true)["host"]; } else { $actionsProfile = "$name-item"; $list = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($name === "toys" ? "toys/toys" : "actions/actions") . ".json"), true); $part1 = array_values(array_filter($list, function ($i) use ($parts) { return $i["id"] === $parts[2]; }))[0]["name"]; } } else { if ($pages[$name]["admin"]) { $part1 = $pages[$name]['name'][$lang["_name"]]; $part2 = "Dashboard"; } else { $part1 = $pages[$name]['name'][$lang["_name"]]; } } } elseif ($name === "cloudburst") { if (isset($parts[2])) { $part2 = "Cloudburst System"; if ($parts[2] === "subsystem") { $actionsProfile = "subsystem"; $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/ynmuc-$parts[3].json"), true)["name"]; } else { $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2]; } } else { $actionsProfile = "system"; $part1 = "Cloudburst System"; } } elseif ($name === "raindrops") { if (isset($parts[2])) { $part2 = "Raindrops System"; if ($parts[2] === "subsystem") { $actionsProfile = "subsystem"; $part1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/gdapd-$parts[3].json"), true)["name"]; } else { $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2]; } } else { $actionsProfile = "system"; $part1 = "Raindrops System"; } } else { $member = getMemberFromName($name); $actionsProfile = "member"; if (isset($member)) { $memberName = $member["display_name"] ?? $member["name"]; $part1 = "$memberName"; if ($member["_system"] === "gdapd") { $part2 = "Raindrops System"; } else { $part2 = "Cloudburst System"; } } else { $part1 = "$name"; } } if ($actionsProfile === "default") { switch ($name) { case "home": $actionsProfile = "home"; break; case "emergency": case "wakeup": case "pleasure": $actionsProfile = "alert"; break; case "fronting": $actionsProfile = "planner"; break; case "actions": case "toys": $actionsProfile = "actions-or-toys"; break; case "docs": $actionsProfile = "docs"; break; case "edit": case "edit-private": if (count($parts) === 3) $actionsProfile = "editor-system"; if (count($parts) > 3 && in_array($parts[3], $membersNames)) $actionsProfile = "editor-member"; if (count($parts) > 3 && !in_array($parts[3], $membersNames)) $actionsProfile = "editor-subsystem"; break; case "debug": $actionsProfile = "debug"; break; case "bitset": $actionsProfile = "bitset"; break; case "computers": if (count($parts) === 3) $actionsProfile = "computers"; if (count($parts) === 4) $actionsProfile = "computers-remote"; break; } } echo(""); if (isset($part3)) { echo "$part3 > $part2 > $part1"; } elseif (isset($part2)) { echo "$part2 > $part1"; } else { echo "$part1"; } echo(""); echo(""); $links = [ "default" => [ [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "computers" => [ [ "name" => "Remote control", "link" => [ "type" => "url", "text" => "/-/computers/" . ($parts[2] ?? null) . "/control" ], "icon" => "/assets/icons/computers-remote.svg", "invert" => true ], [ "name" => "Screens", "link" => [ "type" => "url", "text" => "#screens" ], "icon" => "/assets/icons/computers-screens.svg", "invert" => true ], [ "name" => "Windows", "link" => [ "type" => "url", "text" => "#windows" ], "icon" => "/assets/icons/computers-windows.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "computers-remote" => [ [ "name" => "Enable controlling", "link" => [ "type" => "js", "text" => "enableControl();" ], "icon" => "/assets/icons/computers-on.svg", "invert" => true ], [ "name" => "Disable controlling", "link" => [ "type" => "js", "text" => "disableControl();" ], "icon" => "/assets/icons/computers-off.svg", "invert" => true ], [ "name" => "Back to computer info", "link" => [ "type" => "url", "text" => "/-/computers/" . ($parts[2] ?? null) ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "editor-member" => [ [ "name" => "View page", "link" => [ "type" => "url", "text" => "/" . ($parts[3] ?? null) ], "icon" => "/assets/icons/view.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "editor-system" => [ [ "name" => "View page", "link" => [ "type" => "url", "text" => "/" . ($parts[2] ?? null) ], "icon" => "/assets/icons/view.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "editor-subsystem" => [ [ "name" => "View page", "link" => [ "type" => "url", "text" => "/" . ($parts[2] ?? null) . "/-/subsystem" . ($parts[3] ?? null) ], "icon" => "/assets/icons/view.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "member" => [ [ "name" => $lang["titlebar"]["member"], "link" => [ "type" => "url", "text" => "/$system" ], "icon" => "/assets/icons/parent.svg", "invert" => true ], [ "name" => $pages["edit-private"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/-/edit-private/$system/$name" ], "icon" => "/assets/icons/edit-private.svg", "invert" => true, "show" => $isLoggedIn ], [ "name" => $pages["edit"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/-/edit/$system/$name" ], "icon" => "/assets/icons/edit.svg", "invert" => true, "show" => $isLoggedIn ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "subsystem" => [ [ "name" => $lang["titlebar"]["subsystem"], "link" => [ "type" => "url", "text" => "/$parts[0]" ], "icon" => "/assets/icons/parent.svg", "invert" => true ], [ "name" => $pages["edit"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/-/edit/$system/" . ($parts[3] ?? null) ], "icon" => "/assets/icons/edit.svg", "invert" => true, "show" => $isLoggedIn ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "home" => [ [ "name" => "Raindrops System", "link" => [ "type" => "url", "text" => "/raindrops" ], "icon" => "/assets/avatars/7d9f543ef74240f69d0786c3f2983124.webp", "invert" => false ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "planner" => [ [ "name" => "Add in the Cloudburst System", "link" => [ "type" => "js", "text" => "document.getElementById('planner-add-link-cloudburst-0').click()" ], "icon" => "/assets/icons/add-cloudburst.svg", "invert" => false ], [ "name" => "Add in the Raindrops System", "link" => [ "type" => "js", "text" => "document.getElementById('planner-add-link-raindrops-0').click()" ], "icon" => "/assets/icons/add-raindrops.svg", "invert" => false ] ], "actions-or-toys" => [ [ "name" => "Search", "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0; document.getElementById('search').focus();" ], "icon" => "/assets/icons/search.svg", "invert" => true ], [ "name" => "Add", "link" => [ "type" => "js", "text" => "(new bootstrap.Modal(document.getElementById('creator'))).show(); setInterval(() => { document.getElementById('creator-title').focus(); }, 500);" ], "icon" => "/assets/icons/add.svg", "invert" => true ] ], "docs" => [ [ "name" => "Marked for deletion", "link" => [ "type" => "url", "text" => "#deletable" ], "icon" => "/assets/icons/delete.svg", "invert" => true ], [ "name" => "Create new", "link" => [ "type" => "url", "text" => "/-/docs/add" ], "icon" => "/assets/icons/add.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "docs-item" => [ [ "name" => "Save", "link" => [ "type" => "js", "text" => "save();" ], "icon" => "/assets/icons/save.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "debug" => [ [ "name" => $lang["titlebar"]["debug"][0], "link" => [ "type" => "url", "text" => "#failures" ], "icon" => "/assets/icons/failures.svg", "invert" => true ], [ "name" => $lang["titlebar"]["debug"][1], "link" => [ "type" => "url", "text" => "#times" ], "icon" => "/assets/icons/time.svg", "invert" => true ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ], "bitset" => [ [ "name" => "Copy bitset", "link" => [ "type" => "js", "text" => "navigator.clipboard.writeText(document.getElementById('input').value);" ], "icon" => "/assets/icons/copy.svg", "invert" => true ], [ "name" => "Reset", "link" => [ "type" => "js", "text" => "document.getElementById('input').value = '2048'; calculateInput();" ], "icon" => "/assets/icons/reset.svg", "invert" => true ] ], "alert" => [ [ "name" => "Turn alert on", "link" => [ "type" => "js", "text" => "if (document.getElementById('btn-on').style.display === 'block') (new bootstrap.Modal(document.getElementById('turn-on'))).show();" ], "icon" => "/assets/icons/alert-on.svg", "invert" => true ], [ "name" => "Turn alert off", "link" => [ "type" => "js", "text" => "if (document.getElementById('btn-off').style.display === 'block') (new bootstrap.Modal(document.getElementById('turn-off'))).show();" ], "icon" => "/assets/icons/alert-off.svg", "invert" => true ] ], "system" => [ [ "name" => $pages["s:history"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/$name/-/history" ], "icon" => "/assets/icons/history.svg", "invert" => true ], [ "name" => $pages["s:compare"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/$name/-/compare" ], "icon" => "/assets/icons/compare.svg", "invert" => true ], [ "name" => $pages["s:tree"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/$name/-/tree" ], "icon" => "/assets/icons/tree.svg", "invert" => true ], [ "name" => $pages["s:species"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/$name/-/species" ], "icon" => "/assets/icons/species.svg", "invert" => true ], [ "name" => $pages["edit"]["name"][$lang["_name"]], "link" => [ "type" => "url", "text" => "/-/edit/$name" ], "icon" => "/assets/icons/edit.svg", "invert" => true, "show" => $isLoggedIn ], [ "name" => $lang["titlebar"]["top"], "link" => [ "type" => "js", "text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;" ], "icon" => "/assets/icons/up.svg", "invert" => true ] ] ]; if ($_SERVER['HTTP_HOST'] !== "fr.equestria.horse") { array_unshift($links["home"], [ "name" => "Cloudburst System", "link" => [ "type" => "url", "text" => "/cloudburst" ], "icon" => "/assets/avatars/ade46823206b4b0cad3ccaae934a5f3b.webp", "invert" => false ]); } $linksList = $links[isset($links[$actionsProfile]) ? $actionsProfile : "default"]; ?> $link): if (!(isset($link["show"]) && !$link["show"])): ?>hrefonclick="" title="" data-bs-toggle="tooltip" class="title-bar-action tooltip-nohelp">" class="dropdown-icon" alt="" style="width:24px;vertical-align: middle;">