foreach ($unpublishedUserUploadedImages as $image) { $notifications[] = 'Image <a href = "viewGalleryImage.php?filename=' . $image['filename'] . '&gallery=' . $image['gallery'] . '">' . $image['filename'] . '</a> in gallery ' . $image['galleryTitle'] . ', uploaded by a user, is unpublished. Please publish or delete.'; } } checkNotificationNotGuarenteedSeats($notifications); $tpl->assign('notifications', $notifications); $tpl->assign('emailFlagged', Session::getUser()->getData('emailFlagged')); $tpl->assign('username', Session::getUser()->getUsername()); $standardLinks = new HtmlLinksCollection(); $standardLinks->addIf(Session::hasPriv('CHANGE_AVATAR'), 'updateAvatar.php', 'Avatar', 'avatar'); $standardLinks->addIf(Session::hasPriv('VIEW_ATTENDANCE'), 'viewAttendance.php', 'Attendance'); $standardLinks->addIfPriv('UPLOAD_GALLERY_IMAGE', 'formUploadImage.php', 'Upload gallery image'); $standardLinks->addIfPriv('VIEW_SURVEYS', 'listSurveys.php', 'Survey', 'survey'); $tpl->assign('standardLinks', $standardLinks); $privilegedLinks = new HtmlLinksCollection(); $privilegedLinks->addIfPriv('ADMIN_USERS', 'users.php', 'Users', 'users'); $privilegedLinks->addIfPriv('ADMIN_GROUPS', 'listGroups.php', 'Groups'); $privilegedLinks->addIfPriv('ADMIN_USERS', 'formFlagEmail.php', 'Flag bad emails', 'users'); $privilegedLinks->addIfPriv('VIEW_PRIVS', 'listPermissions.php', 'Permissions'); $privilegedLinks->addIfPriv('VIEW_VENUES', 'listVenues.php', 'Venues'); $privilegedLinks->addIfPriv('EDIT_CONTENT', 'listContent.php', 'Content blocks', 'contentBlocks'); $privilegedLinks->addIfPriv('VIEW_LOG', 'listLogs.php', 'Log'); $privilegedLinks->addIfPriv('MAILING_LIST', 'viewMailingList.php', 'Mailing list'); $privilegedLinks->addIfPriv('SITE_SETTINGS', 'siteSettings.php', 'Site settings', 'siteSettings'); $privilegedLinks->addIfPriv('ADMIN_PLUGINS', 'plugins.php', 'Plugins'); $privilegedLinks->addIfPriv('ADDITIONAL_MENU_ITEMS', 'form.php?form=FormAdditionalMenuItems', 'Additional menu items'); $privilegedLinks->addIfPriv('FINANCES', 'listFinanceAccounts.php', 'Finances'); $privilegedLinks->addIfPriv('SUDO', 'formSudo.php', 'SUDO'); $privilegedLinks->addIfPriv('VIEW_SYSTEM_STATISTICS', 'viewSystemStatus.php', 'System Status'); $privilegedLinks->addIfPriv('MACHINE_AUTHENTICATIONS', 'listMachineAuthentications.php', 'Machine Authentications'); $privilegedLinks->addIfPriv('LIST_SEATINGPLANS', 'listSeatingPlans.php', 'Seating plans');
<?php use libAllure\HtmlLinksCollection; use libAllure\Session; if (!Session::isLoggedIn()) { return; } $isMe = Session::getUser()->getId() == $user->getId() && Session::hasPriv('CHANGE_AVATAR'); $linksCollection = new HtmlLinksCollection('User admin'); $linksCollection->addIf(Session::hasPriv('DELETE_USER'), 'users.php?action=delete&id=' . $user->getId(), 'Delete', null, 'delete'); $linksCollection->addIf(Session::hasPriv('VIEW_ATTENDANCE'), 'viewAttendance.php?user='******'Attendance'); $linksCollection->addIf(Session::hasPriv('EDIT_USER') || $isMe, 'users.php?action=edit&user='******'Update my profile' : 'Edit user', null, 'update'); $linksCollection->addIf(Session::hasPriv('SEND_EMAIL'), 'sendEmail.php?userId=' . $user->getId(), 'Send email'); $linksCollection->addIf(Session::hasPriv('EDIT_OTHERS_AVATAR') || $isMe, 'updateAvatar.php?user='******'Avatar', null, 'avatar'); $linksCollection->addIfPriv('SUDO', 'formSudo.php?username='******'SUDO'); if ($linksCollection->hasLinks()) { $tpl->assign('links', $linksCollection); $tpl->display('sidebarLinks.tpl'); }
<?php use libAllure\HtmlLinksCollection; $menu = new HtmlLinksCollection('Gallery admin'); $menu->addIfPriv('GALLERY_EDIT', 'updateGallery.php?id=' . $_REQUEST['id'], 'Update gallery'); if ($menu->hasLinks()) { $tpl->assign('links', $menu); $tpl->display('sidebarLinks.tpl'); }
<?php use libAllure\HtmlLinksCollection; use libAllure\Session; $menu = new HtmlLinksCollection('Gallery image'); if ($image['inDatabase']) { $menu->addIf(Session::hasPriv('GALLERY_UPDATE_IMAGE'), 'gallery.php?mode=editImage&gallery=' . $gallery['id'] . '&filename=' . $image['filename'], 'Edit database entry'); $menu->addIf(Session::hasPriv('GALLERY_SET_COVER_IMAGE'), 'gallery.php?mode=makeCoverImage&filename=' . $image['filename'] . '&gallery=' . $gallery['id'], 'Make this the gallery cover image</a>'); } else { $menu->addIf(Session::hasPriv('GALLERY_CREATE_IMAGE'), 'gallery.php?mode=addImage&gallery=' . $gallery['id'] . '&filename=' . $image['filename'], 'Add database entry for image</a>'); } $menu->addIfPriv('GALLERY_DELETE_IMAGE', 'deleteGalleryImage.php?filename=' . $image['filename'] . '&gallery=' . $gallery['id'], 'Delete'); if ($menu->hasLinks()) { $tpl->assign('links', $menu); $tpl->display('sidebarLinks.tpl'); }