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:
Matthew Barbour
2019-08-02 14:54:48 -05:00
committed by matthew
parent 972b68bdd3
commit 00464d2579
38 changed files with 583 additions and 344 deletions

View File

@@ -132,6 +132,20 @@ class ReportImage extends Extension
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
if($event->parent==="system") {
if ($user->can(Permissions::VIEW_IMAGE_REPORT)) {
$count = $this->count_reported_images();
$h_count = $count > 0 ? " ($count)" : "";
$event->add_nav_link("image_report", new Link('image_report/list'), "Reported Images$h_count");
}
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;