<?php

use libAllure\HtmlLinksCollection;
use libAllure\Session;
$linksCollection = new HtmlLinksCollection('Event admin');
//$linksCollection->addIf(Session::hasPriv('EVENT_DELETE'), 'deleteEvent.php?id=' . $_REQUEST['id'], 'Delete event', null, 'delete');
$linksCollection->addIf(Session::hasPriv('EVENT_UPDATE'), 'updateEvent.php?id=' . $event['id'], 'Update');
$linksCollection->addIf(Session::hasPriv('ADMIN_SEATING'), 'seatingplan.php?event=' . $event['id'], 'Seating plan');
if ($linksCollection->hasLinks()) {
    $tpl->assign('links', $linksCollection);
    $tpl->display('sidebarLinks.tpl');
}
<?php

use libAllure\HtmlLinksCollection;
use libAllure\Session;
$menu = new HtmlLinksCollection('Gallery admin');
$menu->addIf(Session::hasPriv('GALLERY_SCAN'), 'doScanImageGallery.php', 'Scan gallery for problems');
$menu->addIf(Session::hasPriv('GALLERY_CREATE'), 'createGallery.php', 'Create');
if ($menu->hasLinks()) {
    $tpl->assign('links', $menu);
    $tpl->display('sidebarLinks.tpl');
}
<?php

use libAllure\HtmlLinksCollection;
use libAllure\Session;
$eventAdminLinks = new HtmlLinksCollection('Events admin');
$eventAdminLinks->addIf(Session::hasPriv('EVENT_CREATE'), 'createEvent.php', 'Create event', null, 'create');
$eventAdminLinks->addIf(Session::hasPriv('EVENT_VIEW_SIGNUP_STATS'), 'viewSignupStatus.php', 'Signup status');
if ($eventAdminLinks->hasLinks()) {
    $tpl->assign('linksCollection', $eventAdminLinks);
    $tpl->display('sidebarWidgetLinks.tpl');
}