Merge pull request #717 from DanielOaks/add-logout-button

Add logout button to themes that use subnav bar
This commit is contained in:
Shish 2020-04-06 16:54:48 +01:00 committed by GitHub
commit b04b5af190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,6 +311,10 @@ class UserPage extends Extension
$event->add_nav_link("user_admin", new Link('user_admin/list'), "User List", NavLink::is_active(["user_admin"])); $event->add_nav_link("user_admin", new Link('user_admin/list'), "User List", NavLink::is_active(["user_admin"]));
} }
} }
if ($event->parent==="user" && !$user->is_anonymous()) {
$event->add_nav_link("logout", new Link('user_admin/logout'), "Log Out", false, 90);
}
} }
public function onUserBlockBuilding(UserBlockBuildingEvent $event) public function onUserBlockBuilding(UserBlockBuildingEvent $event)