Mercurial > dive4elements > river
changeset 8503:9f3ffb218bc0
(issue1777) Hide logout button if it is configured.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 16 Dec 2014 12:47:46 +0100 |
parents | 7f63ad20d4f0 |
children | a3bc62722239 |
files | gwt-client/src/main/java/org/dive4elements/river/client/client/Config.java gwt-client/src/main/java/org/dive4elements/river/client/client/config.xml gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java |
diffstat | 3 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/Config.java Tue Dec 16 13:29:38 2014 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/Config.java Tue Dec 16 12:47:46 2014 +0100 @@ -103,6 +103,14 @@ return LocaleInfo.getCurrentLocale().getLocaleName(); } + public boolean getHideLogout() { + Node hide_logout = config.getElementsByTagName("hide-logout").item(0); + if (hide_logout == null) { + return false; + } + String value = hide_logout.getFirstChild().getNodeValue(); + return value.toLowerCase().equals("true"); + } /** * Returns the integer configured at
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/config.xml Tue Dec 16 13:29:38 2014 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/config.xml Tue Dec 16 12:47:46 2014 +0100 @@ -1,6 +1,7 @@ <config> <server>http://localhost:8181</server> - + <!-- set hide-logout to true to hide the logout button --> + <!--<hide-logout>true</hide-logout>--> <projectlist> <!-- The interval to update the user's projects (in ms) --> <update-interval>300000</update-interval>
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java Tue Dec 16 13:29:38 2014 +0100 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSHeader.java Tue Dec 16 12:47:46 2014 +0100 @@ -218,7 +218,9 @@ } right.addMember(userText); - right.addMember(logout); + if (!Config.getInstance().getHideLogout()) { + right.addMember(logout); + } right.addMember(language); right.addMember(info); right.addMember(bfg);