From 8cc1f13c17fa2fb5a4410542d39e650e02945634 Mon Sep 17 00:00:00 2001 From: Minteck Date: Thu, 23 Feb 2023 14:20:13 +0100 Subject: Updated 27 files, added assets/uploads/pt-twilightsparkle.png and deleted 3 files (automated) --- includes/titlebar.inc | 106 +++++++++++++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 39 deletions(-) (limited to 'includes/titlebar.inc') diff --git a/includes/titlebar.inc b/includes/titlebar.inc index c49f7b2..e3e6c0c 100644 --- a/includes/titlebar.inc +++ b/includes/titlebar.inc @@ -1,4 +1,4 @@ - + " . $app["other"]["name"] . ""; + + $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2]; + } else { + $actionsProfile = "system"; + $part1 = $app["other"]["name"]; + } } else { $member = getMemberFromName($name); $actionsProfile = "member"; + if ($member["_system"] === $app["other"]["id"]) { + $actionsProfile = "member-other"; + } + if (isset($member)) { $memberName = $member["display_name"] ?? $member["name"]; $part1 = "$memberName"; if ($member["_system"] === "gdapd") { $part2 = "Raindrops System"; - } else { + } elseif ($member["_system"] === "ynmuc") { $part2 = "Cloudburst System"; + } else { + $part2 = "" . $app["other"]["name"] . ""; } } else { $part1 = "$name"; @@ -166,24 +181,6 @@ $links = [ "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" => [ @@ -323,6 +320,36 @@ $links = [ "invert" => true ] ], + "member-other" => [ + [ + "name" => $lang["titlebar"]["member"], + "link" => [ + "type" => "url", + "text" => "/$system" + ], + "icon" => "/assets/icons/parent.svg", + "invert" => true + ], + [ + "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"], @@ -550,24 +577,6 @@ $links = [ "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" => [ @@ -602,11 +611,30 @@ if ($_SERVER['HTTP_HOST'] !== "fr.equestria.horse") { ]); } +if ($isLowerLoggedIn || $isLoggedIn) { + $links["home"][] = [ + "name" => $app["other"]["name"], + "link" => [ + "type" => "url", + "text" => "/" . $app["other"]["slug"] + ], + "icon" => "/assets/avatars/" . str_replace("-", "", $app["other"]["uuid"]) . ".webp", + "invert" => false + ]; + + $links["home"] = [ + array_values(array_filter($links["home"], function ($i) { return $i["name"] === "Cloudburst System"; }))[0], + array_values(array_filter($links["home"], function ($i) { return $i["name"] === "Raindrops System"; }))[0], + array_values(array_filter($links["home"], function ($i) use ($app) { return $i["name"] === $app["other"]["name"]; }))[0], + array_values(array_filter($links["home"], function ($i) { return $i["link"]["type"] === "js"; }))[0] + ]; +} + $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;"> + $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;"> -- cgit