Set core and data manager in all templates.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Jul 2012 11:46:16 +0000 (13:46 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 30 Jul 2012 11:46:16 +0000 (13:46 +0200)
src/main/java/net/pterodactylus/demoscenemusic/page/BasePage.java

index 65505fa..f6f211e 100644 (file)
@@ -60,6 +60,8 @@ public class BasePage extends TemplatePage<ServletRequest> {
                super.processTemplate(templateContext, request);
                User currentUser = (User) request.getServletRequest().getSession().getAttribute("currentUser");
                templateContext.set("currentUser", currentUser);
+               templateContext.set("core", getCore());
+               templateContext.set("dataManager", getCore().getDataManager());
                int requiredUserLevel = getRequiredUserLevel();
                if (((currentUser == null) && (requiredUserLevel > 0)) || ((currentUser != null) && (requiredUserLevel > currentUser.getLevel()))) {
                        throw new RedirectException("login");