Commit fddd34ef authored by Michael Ochmann's avatar Michael Ochmann
Browse files

added loggedin header menu

parent 3afffb93
......@@ -13,12 +13,16 @@ class MainMenu {
}
public static function secondary() {
return MainMenu::buildMenu("secondary");
if (is_user_logged_in())
return MainMenu::buildMenu("loggedin");
else
return MainMenu::buildMenu("secondary");
}
public function register() {
register_nav_menu("primary", "Untere Menüleiste");
register_nav_menu("secondary", "Obere Menüleiste");
register_nav_menu("loggedin", "Eingeloggt");
}
private static function buildMenu($menuName) {
......@@ -32,6 +36,10 @@ class MainMenu {
array_push($out, "<a href=\"$elm->url\" class=\"$class\">$elm->title</a>");
$i++;
}
if ($menuName == "loggedin" && is_user_logged_in()) {
$user = wp_get_current_user()->display_name;
array_push($out, "<span class=\"user col-md-2\">eingeloggt als <span>$user</span></span>");
}
$out = array_chunk($out, count($out) * .5);
$first = implode("\n", $out[0]);
......
This diff is collapsed.
/**
/*!
* FSI CSS
*
* © 2016, Michael Ochmann
* CSS für die Homepage der Fachschaft Informatik an der Hochschule Trier.
*
*/
@import "bootstrap.min.css";
......@@ -315,9 +316,8 @@ header nav.second {
background: #eee;
transition: all 0.2s ease-in-out;
}
header nav a {
header nav a, header nav span.user {
display: block;
width: 100%;
color: #222;
max-height: 50px;
text-align: center;
......@@ -326,6 +326,14 @@ header nav a {
padding: 12px;
transition: all 0.2s ease-in-out;
}
header nav span.user {
font-size: small;
font-family: sans-serif;
}
header nav span > span {
color: $fsi;
font-weight: bold;
}
header nav a:after {
content: " ";
display: block;
......@@ -836,4 +844,4 @@ a img.aligncenter {
top: 5px;
width: auto;
z-index: 100000; /* Above WP toolbar. */
}
\ No newline at end of file
}
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment