forked from Cavemanon/cavepaintings
Implemented a nav link generating system so that extension power what shows up in the menus rather than being hard-coded in the themes.
This commit is contained in:
@ -237,6 +237,17 @@ class UserPage extends Extension
|
||||
}
|
||||
}
|
||||
|
||||
public function onPageNavBuilding(PageNavBuildingEvent $event)
|
||||
{
|
||||
global $user;
|
||||
if ($user->is_anonymous()) {
|
||||
$event->add_nav_link("user", new Link('user_admin/login'), "Account", null, 10);
|
||||
} else {
|
||||
$event->add_nav_link("user", new Link('user'), "Account", null, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function display_stats(UserPageBuildingEvent $event)
|
||||
{
|
||||
global $user, $page, $config;
|
||||
@ -305,6 +316,16 @@ class UserPage extends Extension
|
||||
$event->panel->add_block($sb);
|
||||
}
|
||||
|
||||
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
|
||||
{
|
||||
global $user;
|
||||
if($event->parent==="system") {
|
||||
if ($user->can(Permissions::EDIT_USER_CLASS)) {
|
||||
$event->add_nav_link("user_admin", new Link('user_admin/list'), "User List", NavLink::is_active(["user_admin"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
|
||||
{
|
||||
global $user;
|
||||
|
Reference in New Issue
Block a user