"
+ "
"
+ renderCommonHeader(username, "MySQL Client", true, pmStats)
+ "
"
@@ -710,51 +710,113 @@ public final class Pages {
String sectionPart = sectionHtml.isBlank()
? ""
: ("New thread".equalsIgnoreCase(sectionHtml) && authenticated
- ? " -
" + sectionHtml + ""
- : " - " + sectionHtml);
+ ? ""
+ : "");
int unread = pmStats == null ? 0 : Math.max(0, pmStats.getUnread());
int total = pmStats == null ? 0 : Math.max(0, pmStats.getTotal());
boolean mysqlAdmin = authenticated && "kamma".equalsIgnoreCase(valueOrDefault(username, ""));
+ boolean onForum = sectionHtml.isBlank() || "New thread".equalsIgnoreCase(sectionHtml);
+ boolean onChat = "Chat".equalsIgnoreCase(sectionHtml);
+ boolean onPrivate = "Private messages".equalsIgnoreCase(sectionHtml);
String newPmBanner = unread > 0
- ? "
You have unread Private Message"
- : "
";
- String mysqlLink = mysqlAdmin ? " |
MySQL Client" : "";
- String rightBlock = authenticated
- ? "
"
- + " "
- + " | "
- + "
"
- + " "
- + ""
+ ? " "
+ + "You have " + unread + " unread private message(s)"
+ : "No unread private messages";
+ String navLinks = authenticated
+ ? navItem("/forum", "Forum", onForum)
+ + navItem("/chat", "Chat", onChat)
+ + navItem("/private", "Private", onPrivate)
+ + (mysqlAdmin ? navItem("/mysqlc", "MySQL Client", false) : "")
+ + "Logout"
+ : navItem("/login", "Login", false);
+ String accountBlock = authenticated
+ ? ""
+ + "  "
+ + " | "
- : "
"
- + " "
+ + ""
+ : " | ";
- return "
"
+ + "";
+ return ""
+ + ""
+ + ""
+ "";
}
+ private static String navItem(String href, String label, boolean active) {
+ String css = active ? "fc-nav-link fc-nav-link-active" : "fc-nav-link";
+ return "" + escapeHtml(label) + "";
+ }
+
private static String renderCommonFooter(int loggedUsersCount, List loggedUsers) {
String loggedUsersHtml = (loggedUsers == null || loggedUsers.isEmpty())
? "-"
@@ -771,7 +833,7 @@ public final class Pages {
+ loggedUsersHtml
+ "
"
+ "
"
- + "kAmMa's Forum System Version 2.43
Copyright ©2006-2021"
+ + "kAmMa's Forum System Version 3.0
Copyright ©2006-2026"
+ "
"
+ "