summaryrefslogtreecommitdiff
path: root/includes/titlebar.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/titlebar.inc')
-rw-r--r--includes/titlebar.inc81
1 files changed, 42 insertions, 39 deletions
diff --git a/includes/titlebar.inc b/includes/titlebar.inc
index 5166f08..b0c1e8b 100644
--- a/includes/titlebar.inc
+++ b/includes/titlebar.inc
@@ -1,4 +1,4 @@
-<?php global $toplevel; global $system; global $isLoggedIn; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); ?>
+<?php global $toplevel; global $system; global $isLoggedIn; global $lang; global $pages; $pages = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/pages.json"), true); global $lang; global $pages; ?>
<span>
<?php
@@ -16,7 +16,7 @@ $part3 = null;
if (isset($pages[$name])) {
if (($name === "docs" || $name === "toys" || $name === "actions" || $name === "computers") && isset($parts[2])) {
$part3 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
- $part2 = "<a class='title-bar-backlink' href='/-/$name'>" . $pages[$name]['name'] . "</a>";
+ $part2 = "<a class='title-bar-backlink' href='/-/$name'>" . $pages[$name]['name'][$lang["_name"]] . "</a>";
if ($name === "docs") {
$actionsProfile = "docs-item";
@@ -32,10 +32,10 @@ if (isset($pages[$name])) {
}
} else {
if ($pages[$name]["admin"]) {
- $part1 = $pages[$name]['name'];
+ $part1 = $pages[$name]['name'][$lang["_name"]];
$part2 = "<a class='title-bar-backlink' href='/-/dashboard'>Dashboard</a>";
} else {
- $part1 = $pages[$name]['name'];
+ $part1 = $pages[$name]['name'][$lang["_name"]];
}
}
} elseif ($name === "cloudburst") {
@@ -46,7 +46,7 @@ if (isset($pages[$name])) {
$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'] ?? $parts[2];
+ $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
}
} else {
$actionsProfile = "system";
@@ -60,7 +60,7 @@ if (isset($pages[$name])) {
$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'] ?? $parts[2];
+ $part1 = $pages["s:" . $parts[2]]['name'][$lang["_name"]] ?? $parts[2];
}
} else {
$actionsProfile = "system";
@@ -147,7 +147,7 @@ echo("</span>");
$links = [
"default" => [
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -185,7 +185,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -234,7 +234,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -254,7 +254,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -274,7 +274,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -285,7 +285,7 @@ $links = [
],
"member" => [
[
- "name" => "System",
+ "name" => $lang["titlebar"]["member"],
"link" => [
"type" => "url",
"text" => "/$system"
@@ -294,7 +294,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["edit-private"]["name"],
+ "name" => $pages["edit-private"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit-private/$system/$name"
@@ -304,7 +304,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => $pages["edit"]["name"],
+ "name" => $pages["edit"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit/$system/$name"
@@ -314,7 +314,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -325,7 +325,7 @@ $links = [
],
"subsystem" => [
[
- "name" => "Parent system",
+ "name" => $lang["titlebar"]["subsystem"],
"link" => [
"type" => "url",
"text" => "/$parts[0]"
@@ -334,7 +334,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["edit"]["name"],
+ "name" => $pages["edit"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit/$system/" . ($parts[3] ?? null)
@@ -344,7 +344,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -355,15 +355,6 @@ $links = [
],
"home" => [
[
- "name" => "Cloudburst System",
- "link" => [
- "type" => "url",
- "text" => "/cloudburst"
- ],
- "icon" => "/assets/avatars/ade46823206b4b0cad3ccaae934a5f3b.webp",
- "invert" => false
- ],
- [
"name" => "Raindrops System",
"link" => [
"type" => "url",
@@ -373,7 +364,7 @@ $links = [
"invert" => false
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -442,7 +433,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -462,7 +453,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -473,7 +464,7 @@ $links = [
],
"debug" => [
[
- "name" => "Reported failures",
+ "name" => $lang["titlebar"]["debug"][0],
"link" => [
"type" => "url",
"text" => "#failures"
@@ -482,7 +473,7 @@ $links = [
"invert" => true
],
[
- "name" => "Processing times",
+ "name" => $lang["titlebar"]["debug"][1],
"link" => [
"type" => "url",
"text" => "#times"
@@ -491,7 +482,7 @@ $links = [
"invert" => true
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -542,7 +533,7 @@ $links = [
],
"system" => [
[
- "name" => $pages["s:history"]["name"],
+ "name" => $pages["s:history"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/history"
@@ -551,7 +542,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["s:compare"]["name"],
+ "name" => $pages["s:compare"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/compare"
@@ -560,7 +551,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["s:tree"]["name"],
+ "name" => $pages["s:tree"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/tree"
@@ -569,7 +560,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["s:species"]["name"],
+ "name" => $pages["s:species"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/$name/-/species"
@@ -578,7 +569,7 @@ $links = [
"invert" => true
],
[
- "name" => $pages["edit"]["name"],
+ "name" => $pages["edit"]["name"][$lang["_name"]],
"link" => [
"type" => "url",
"text" => "/-/edit/$name"
@@ -588,7 +579,7 @@ $links = [
"show" => $isLoggedIn
],
[
- "name" => "Go back to top",
+ "name" => $lang["titlebar"]["top"],
"link" => [
"type" => "js",
"text" => "document.body.scrollTop = 0; document.documentElement.scrollTop = 0;"
@@ -599,6 +590,18 @@ $links = [
]
];
+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"];
?><!-- (<code><?= $actionsProfile ?></code>)--><!--<pre><?php var_dump($parts); ?></pre>-->