If the page can say whether it’s enabled in the menu, forward the request.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Oct 2010 11:48:52 +0000 (13:48 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Oct 2010 11:48:52 +0000 (13:48 +0200)
src/main/java/net/pterodactylus/sone/web/page/PageToadlet.java

index 57a3439..6d4b8a6 100644 (file)
@@ -173,6 +173,9 @@ public class PageToadlet extends Toadlet implements LinkEnabledCallback {
         */
        @Override
        public boolean isEnabled(ToadletContext toadletContext) {
+               if (page instanceof LinkEnabledCallback) {
+                       return ((LinkEnabledCallback) page).isEnabled(toadletContext);
+               }
                return true;
        }