From 23f2015850bbcfcc442b9232023f210814a7fa78 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Mon, 12 Dec 2011 12:49:08 +0100
Subject: [PATCH] FXOLAT-358: backport impressum

---
 .../impressum/ContactController.java          | 124 ++++++++++++++++
 .../impressum/ImpressumController.java        |  92 ++++++++++++
 .../impressum/ImpressumDmzMainController.java |  57 ++++++++
 .../impressum/ImpressumMainController.java    |  57 ++++++++
 .../impressum/TermsOfUseController.java       |  87 ++++++++++++
 .../impressum/_content/contact.html           |   3 +
 .../impressum/_content/impressum.html         |   1 +
 .../impressum/_content/terms_of_use.html      |   1 +
 .../_i18n/LocalStrings_de.properties          |  11 ++
 .../_i18n/LocalStrings_en.properties          |  12 ++
 .../_i18n/LocalStrings_fr.properties          |  12 ++
 .../impressum/_spring/impressumContext.xml    |  51 +++++++
 .../java/org/olat/gui/_content/guimsg.html    |  25 ----
 .../olat/gui/control/DmzTopNavCreator.java    |  51 +++++++
 .../olat/gui/control/GuestTopNavCreator.java  |  51 +++++++
 .../gui/control/OlatDmzTopNavController.java  |  38 +++--
 .../control/OlatGuestTopNavController.java    |  25 +++-
 .../gui/control/OlatTopNavController.java     |  78 ++++------
 .../org/olat/gui/control/TopNavCreator.java   |  63 +++++++++
 .../olat/gui/control/_content/dmztopnav.html  |   5 +
 .../gui/control/_content/guesttopnav.html     |   7 +-
 .../olat/gui/control/_content/permsharp.html  |   3 -
 .../org/olat/gui/control/_content/topnav.html |   5 +
 .../control/_i18n/LocalStrings_de.properties  |   2 +
 .../control/_i18n/LocalStrings_en.properties  |   2 +
 .../control/_i18n/LocalStrings_fr.properties  |   2 +
 .../java/org/olat/login/GuestBFWCParts.java   |  13 +-
 .../resources/serviceconfig/olat.properties   |   7 +
 .../org/olat/_spring/olatextconfig.xml        | 133 +-----------------
 .../org/olat/core/_spring/mainCorecontext.xml | 109 ++++++--------
 30 files changed, 840 insertions(+), 287 deletions(-)
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/ContactController.java
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/ImpressumController.java
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/ImpressumDmzMainController.java
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/ImpressumMainController.java
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/TermsOfUseController.java
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_content/contact.html
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_content/impressum.html
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_content/terms_of_use.html
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_de.properties
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_en.properties
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_fr.properties
 create mode 100644 src/main/java/org/olat/core/commons/controllers/impressum/_spring/impressumContext.xml
 delete mode 100644 src/main/java/org/olat/gui/_content/guimsg.html
 create mode 100644 src/main/java/org/olat/gui/control/DmzTopNavCreator.java
 create mode 100644 src/main/java/org/olat/gui/control/GuestTopNavCreator.java
 create mode 100644 src/main/java/org/olat/gui/control/TopNavCreator.java
 delete mode 100644 src/main/java/org/olat/gui/control/_content/permsharp.html

diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/ContactController.java b/src/main/java/org/olat/core/commons/controllers/impressum/ContactController.java
new file mode 100644
index 00000000000..b3261639902
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/ContactController.java
@@ -0,0 +1,124 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.core.commons.controllers.impressum;
+
+import org.olat.core.configuration.PersistedProperties;
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.components.Component;
+import org.olat.core.gui.components.velocity.VelocityContainer;
+import org.olat.core.gui.control.Event;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.controller.BasicController;
+import org.olat.core.logging.OLATRuntimeException;
+import org.olat.core.util.StringHelper;
+import org.olat.core.util.WebappHelper;
+import org.olat.core.util.event.GenericEventListener;
+import org.olat.core.util.mail.ContactList;
+import org.olat.core.util.mail.ContactMessage;
+import org.olat.modules.co.ContactFormController;
+
+/**
+ * <h3>Description:</h3> This controller shows a contact form and has a
+ * user-configurable destination e-mail address which it reads from the file
+ * <code>olatdata/system/configuration/contact.properties</code> 
+ * 
+ * Initial Date: Aug 10, 2009 <br>
+ * 
+ * @author twuersch, frentix GmbH, http://www.frentix.com
+ */
+public class ContactController extends BasicController implements GenericEventListener {
+
+	private final VelocityContainer content;
+	private ContactFormController contactForm;
+	private static String contactEmail = null;
+
+	/**
+	 * Creates this controller.
+	 * 
+	 * @param ureq The user request.
+	 * @param control The window control.
+	 */
+	public ContactController(UserRequest ureq, WindowControl control) {
+		super(ureq, control);
+		this.content = createVelocityContainer("contact");
+
+		// load configuration only once
+		if (contactEmail == null) {
+			// Read the destination e-mail address from the configuration file.
+			PersistedProperties contactConfiguration = new PersistedProperties(this);
+			contactConfiguration.init();
+			contactEmail = contactConfiguration.getStringPropertyValue("contact.to.address", true);
+			if (!StringHelper.containsNonWhitespace(contactEmail)) {
+				// fallback to standard email
+				contactEmail = WebappHelper.getMailConfig("mailSupport");
+				if (!StringHelper.containsNonWhitespace(contactEmail)) {
+					throw new OLATRuntimeException(
+							"could not find valid contact email address, configure property 'contact.to.address' in olatdata/system/configuration/"
+									+ this.getClass().getName() + ".properties", null);
+				} else {
+					logInfo("Initialize impressum email with standard support address::" + contactEmail
+							+ " You can configure a specific impressum email in the property 'contact.to.address' in olatdata/system/configuration/"
+							+ this.getClass().getName() + ".properties", null);
+				}
+			} else {
+				logInfo("Initialize impressum email with address::" + contactEmail, null);
+			}
+		}
+
+		// Initialize a few contact list management objects.
+		ContactMessage contactMessage = new ContactMessage(ureq.getIdentity());
+		ContactList contactList = new ContactList(translate("contact.to"));
+
+		contactList.add(contactEmail);
+		contactMessage.addEmailTo(contactList);
+
+		// Show GUI
+		this.contactForm = new ContactFormController(ureq, getWindowControl(), false, false, false, false, contactMessage);
+		listenTo(this.contactForm);
+		this.content.put("contactForm", this.contactForm.getInitialComponent());
+		putInitialPanel(content);
+	}
+
+	/**
+	 * @see org.olat.core.gui.control.DefaultController#doDispose()
+	 */
+	@Override
+	protected void doDispose() {
+	// autodispose by basic controller
+	}
+
+	/**
+	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
+	 *      org.olat.core.gui.components.Component,
+	 *      org.olat.core.gui.control.Event)
+	 */
+	@Override
+	protected void event(UserRequest ureq, Component source, Event event) {
+	// Do nothing.
+	}
+
+	/**
+	 * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
+	 */
+	public void event(Event event) {
+	// nothing to do, the persisted properties used in this controller are
+	// read-only, no GUI to modify the properties yet
+	}
+}
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumController.java b/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumController.java
new file mode 100644
index 00000000000..dfeb2b03f31
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumController.java
@@ -0,0 +1,92 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.core.commons.controllers.impressum;
+
+import java.io.File;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.components.Component;
+import org.olat.core.gui.components.velocity.VelocityContainer;
+import org.olat.core.gui.control.Event;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.controller.BasicController;
+import org.olat.core.gui.control.generic.iframe.IFrameDisplayController;
+import org.olat.core.util.WebappHelper;
+
+/**
+ * <h3>Description:</h3> This controller displays an impressum which it reads
+ * from an external HTML file in the <code>olatdata</code> directory.
+ * 
+ * 
+ * Initial Date: Aug 10, 2009 <br>
+ * 
+ * @author twuersch, frentix GmbH, http://www.frentix.com
+ */
+public class ImpressumController extends BasicController {
+
+	public static final String IMPRESSUM_HTML_FOLDER = "/customizing/impressum/";
+	private VelocityContainer content;
+	private IFrameDisplayController impressumIframe;
+
+	/**
+	 * @param ureq
+	 * @param control
+	 */
+	public ImpressumController(UserRequest ureq, WindowControl control) {
+		super(ureq, control);
+		this.content = createVelocityContainer("impressum");
+		File baseFolder = new File(WebappHelper.getUserDataRoot(), IMPRESSUM_HTML_FOLDER);		
+		this.impressumIframe = new IFrameDisplayController(ureq, getWindowControl(), baseFolder);
+		String langCode = ureq.getLocale().getLanguage();
+		String fileName = "index_" + langCode + ".html";
+		File termsFileInLang = new File (baseFolder, fileName);
+		if (termsFileInLang.exists()){
+			this.impressumIframe.setCurrentURI(fileName);
+		} else {
+			//default is german
+			this.impressumIframe.setCurrentURI("index_de.html");
+		}
+		this.content.put("impressumIFrame", this.impressumIframe.getInitialComponent());
+		putInitialPanel(content);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.olat.core.gui.control.DefaultController#doDispose()
+	 */
+	@Override
+	protected void doDispose() {
+		this.impressumIframe.dispose();
+		this.impressumIframe = null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.olat.core.gui.control.DefaultController#event(org.olat.core.gui.
+	 * UserRequest, org.olat.core.gui.components.Component,
+	 * org.olat.core.gui.control.Event)
+	 */
+	@Override
+	protected void event(UserRequest ureq, Component source, Event event) {
+		// Do nothing.
+	}
+}
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumDmzMainController.java b/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumDmzMainController.java
new file mode 100644
index 00000000000..b0507b81b21
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumDmzMainController.java
@@ -0,0 +1,57 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.core.commons.controllers.impressum;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.control.Controller;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.generic.layout.GenericMainController;
+
+/**
+ * <h3>Description:</h3>
+ * 
+ * This controller displays the impressum and related controllers in a 3-column
+ * layout. Since this uses a {@link GenericMainController}, it is configured
+ * automatically, so see the file webapp/WEB-INF/olat_extensions.xml to
+ * configure this.
+ * 
+ * Initial Date: Aug 7, 2009 <br>
+ * 
+ * @author twuersch, frentix GmbH, http://www.frentix.com
+ */
+public class ImpressumDmzMainController extends GenericMainController {
+
+	public ImpressumDmzMainController(UserRequest ureq, WindowControl wControl) {
+		super(ureq, wControl);
+		init(ureq);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.olat.core.gui.control.generic.layout.GenericMainController#
+	 * handleOwnMenuTreeEvent(java.lang.Object, org.olat.core.gui.UserRequest)
+	 */
+	@Override
+	protected Controller handleOwnMenuTreeEvent(Object uobject, UserRequest ureq) {
+		// No own menu tree events defined, so don't do anything here.
+		return null;
+	}
+}
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumMainController.java b/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumMainController.java
new file mode 100644
index 00000000000..929cf0cc69f
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/ImpressumMainController.java
@@ -0,0 +1,57 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.core.commons.controllers.impressum;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.control.Controller;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.generic.layout.GenericMainController;
+
+/**
+ * <h3>Description:</h3>
+ * 
+ * This controller displays the impressum and related controllers in a 3-column
+ * layout. Since this uses a {@link GenericMainController}, it is configured
+ * automatically, so see the file webapp/WEB-INF/olat_extensions.xml to
+ * configure this.
+ * 
+ * Initial Date: Aug 7, 2009 <br>
+ * 
+ * @author twuersch, frentix GmbH, http://www.frentix.com
+ */
+public class ImpressumMainController extends GenericMainController {
+
+	public ImpressumMainController(UserRequest ureq, WindowControl wControl) {
+		super(ureq, wControl);
+		init(ureq);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.olat.core.gui.control.generic.layout.GenericMainController#
+	 * handleOwnMenuTreeEvent(java.lang.Object, org.olat.core.gui.UserRequest)
+	 */
+	@Override
+	protected Controller handleOwnMenuTreeEvent(Object uobject, UserRequest ureq) {
+		// No own menu tree events defined, so don't do anything here.
+		return null;
+	}
+}
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/TermsOfUseController.java b/src/main/java/org/olat/core/commons/controllers/impressum/TermsOfUseController.java
new file mode 100644
index 00000000000..8cf7f997310
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/TermsOfUseController.java
@@ -0,0 +1,87 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.core.commons.controllers.impressum;
+
+import java.io.File;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.components.Component;
+import org.olat.core.gui.components.velocity.VelocityContainer;
+import org.olat.core.gui.control.Event;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.controller.BasicController;
+import org.olat.core.gui.control.generic.iframe.IFrameDisplayController;
+import org.olat.core.util.WebappHelper;
+
+/**
+ * <h3>Description:</h3> This controller displays terms of use which it reads
+ * from an external HTML file in the <code>olatdata</code> directory.
+ * 
+ * 
+ * Initial Date: Aug 10, 2009 <br>
+ * 
+ * @author twuersch, frentix GmbH, http://www.frentix.com
+ */
+public class TermsOfUseController extends BasicController {
+
+	public static final String TERMS_OF_USE_HTML_FOLDER = "/customizing/terms_of_use/";
+	private VelocityContainer content;
+	private IFrameDisplayController termsOfUseIframe;
+
+	/**
+	 * @param ureq
+	 * @param control
+	 */
+	public TermsOfUseController(UserRequest ureq, WindowControl control) {
+		super(ureq, control);
+		this.content = createVelocityContainer("terms_of_use");
+		File baseFolder = new File(WebappHelper.getUserDataRoot(), TERMS_OF_USE_HTML_FOLDER);		
+		this.termsOfUseIframe = new IFrameDisplayController(ureq, getWindowControl(), baseFolder);
+		String langCode = ureq.getLocale().getLanguage();
+		String fileName = "index_" + langCode + ".html";
+		File termsFileInLang = new File (baseFolder, fileName);
+		if (termsFileInLang.exists()){
+			this.termsOfUseIframe.setCurrentURI(fileName);
+		} else {
+			//default is german
+			this.termsOfUseIframe.setCurrentURI("index_de.html");
+		}
+		
+		this.content.put("termsOfUseIFrame", this.termsOfUseIframe.getInitialComponent());
+		putInitialPanel(content);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.olat.core.gui.control.DefaultController#doDispose()
+	 */
+	@Override
+	protected void doDispose() {
+		this.termsOfUseIframe.dispose();
+		this.termsOfUseIframe = null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
+	 */
+	@Override
+	protected void event(UserRequest ureq, Component source, Event event) {
+		// Do nothing.
+	}
+}
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_content/contact.html b/src/main/java/org/olat/core/commons/controllers/impressum/_content/contact.html
new file mode 100644
index 00000000000..3caa349137b
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_content/contact.html
@@ -0,0 +1,3 @@
+<h3>$r.translate("contactform.title")</h3>
+<p class="b_info">$r.translate("contactform.intro")</p>
+$r.render("contactForm")
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_content/impressum.html b/src/main/java/org/olat/core/commons/controllers/impressum/_content/impressum.html
new file mode 100644
index 00000000000..0d2091a9ff6
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_content/impressum.html
@@ -0,0 +1 @@
+$r.render("impressumIFrame")
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_content/terms_of_use.html b/src/main/java/org/olat/core/commons/controllers/impressum/_content/terms_of_use.html
new file mode 100644
index 00000000000..f8c7d2436a4
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_content/terms_of_use.html
@@ -0,0 +1 @@
+$r.render("termsOfUseIFrame")
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_de.properties
new file mode 100644
index 00000000000..6b3b5d17b6b
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_de.properties
@@ -0,0 +1,11 @@
+contactform.title=Kontakt
+contactform.intro=Kontaktformular für allgemeine Anfragen.
+main.menu.title=Impressum
+main.menu.title.alt=Impressum
+ImpressumController.menu.title=Impressum
+ImpressumController.menu.title.alt=Impressum
+contact.to=Sekretariat
+ContactController.menu.title=Kontakt
+ContactController.menu.title.alt=Kontakt
+TermsOfUseController.menu.title=Nutzungsbedingungen
+TermsOfUseController.menu.title.alt=Nutzungsbedingungen
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_en.properties
new file mode 100644
index 00000000000..ec089f3f83a
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_en.properties
@@ -0,0 +1,12 @@
+#Thu May 26 14:17:17 CEST 2011
+ContactController.menu.title=Contact
+ContactController.menu.title.alt=Contact
+ImpressumController.menu.title=Mentions légales
+ImpressumController.menu.title.alt=Mentions légales
+TermsOfUseController.menu.title=Usage terms
+TermsOfUseController.menu.title.alt=Terms of use
+contact.to=Secrétariat
+contactform.intro=Contact form for general requests.
+contactform.title=Contact
+main.menu.title=Mentions légales
+main.menu.title.alt=Mentions légales
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_fr.properties
new file mode 100644
index 00000000000..0e6ed38139b
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_i18n/LocalStrings_fr.properties
@@ -0,0 +1,12 @@
+#Thu May 26 14:17:17 CEST 2011
+ContactController.menu.title=Contact
+ContactController.menu.title.alt=Contact
+ImpressumController.menu.title=Imprint
+ImpressumController.menu.title.alt=Imprint
+TermsOfUseController.menu.title=Usage terms
+TermsOfUseController.menu.title.alt=Terms of use
+contact.to=Secretary
+contactform.intro=Contact form for general requests.
+contactform.title=Contact
+main.menu.title=Imprint
+main.menu.title.alt=Imprint
diff --git a/src/main/java/org/olat/core/commons/controllers/impressum/_spring/impressumContext.xml b/src/main/java/org/olat/core/commons/controllers/impressum/_spring/impressumContext.xml
new file mode 100644
index 00000000000..4665f820c1d
--- /dev/null
+++ b/src/main/java/org/olat/core/commons/controllers/impressum/_spring/impressumContext.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans 
+                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd ">
+
+	<bean class="org.olat.core.extensions.action.GenericActionExtension" init-method="initExtensionPoints">
+		<property name="actionController">	
+			<bean class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype">
+				<property name="className" value="org.olat.core.commons.controllers.impressum.ImpressumController"/>
+			</bean>
+		</property>
+		<property name="extensionPoints">
+			<list>	
+				<value>org.olat.core.commons.controllers.impressum.ImpressumMainController</value>
+				<value>org.olat.core.commons.controllers.impressum.ImpressumDmzMainController</value>
+			</list>
+		</property>
+		<property name="order" value="701"/>
+	</bean>
+	
+	<bean class="org.olat.core.extensions.action.GenericActionExtension" init-method="initExtensionPoints">
+		<property name="actionController">	
+			<bean class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype">
+				<property name="className" value="org.olat.core.commons.controllers.impressum.TermsOfUseController"/>
+			</bean>
+		</property>
+		<property name="extensionPoints">
+			<list>	
+				<value>org.olat.core.commons.controllers.impressum.ImpressumMainController</value>
+				<value>org.olat.core.commons.controllers.impressum.ImpressumDmzMainController</value>
+			</list>
+		</property>
+		<property name="order" value="702"/>
+	</bean>
+	
+	<bean class="org.olat.core.extensions.action.GenericActionExtension" init-method="initExtensionPoints">
+		<property name="actionController">	
+			<bean class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype">
+				<property name="className" value="org.olat.core.commons.controllers.impressum.ContactController"/>
+			</bean>
+		</property>
+		<property name="extensionPoints">
+			<list>	
+				<value>org.olat.core.commons.controllers.impressum.ImpressumMainController</value>		
+			</list>
+		</property>
+		<property name="order" value="703"/>
+	</bean>
+
+</beans>
\ No newline at end of file
diff --git a/src/main/java/org/olat/gui/_content/guimsg.html b/src/main/java/org/olat/gui/_content/guimsg.html
deleted file mode 100644
index 76df1a6e1b7..00000000000
--- a/src/main/java/org/olat/gui/_content/guimsg.html
+++ /dev/null
@@ -1,25 +0,0 @@
-#if($guiMessage.hasInfo())
-<script type="text/javascript">
-	//needs to be delayed otherwise IE6 will crash in non ajax mode
-	setTimeout(function(){ showMessageBox('info', '$r.translate("info.header")', '$r.get("guiMessage").renderInfo()'); }, 100);
-</script>
-#end
-
-#if($guiMessage.hasWarn())
-<script type="text/javascript">
-	//needs to be delayed otherwise IE6 will crash in non ajax mode
-	setTimeout(function(){ showMessageBox('warn', '$r.translate("warn.header")',  '$r.get("guiMessage").renderWarn()'); }, 100);
-	##auto hide box
-	setTimeout(function(){ Ext.MessageBox.hide(); }, 8000);
-</script>
-#end
-
-#if($guiMessage.hasError())
-<script type="text/javascript">
-	//needs to be delayed otherwise IE6 will crash in non ajax mode
-	setTimeout(function(){ showMessageBox('error', '$r.translate("error.header")',  '$r.get("guiMessage").renderError()');  }, 100);
-</script>
-#end
-
-
-
diff --git a/src/main/java/org/olat/gui/control/DmzTopNavCreator.java b/src/main/java/org/olat/gui/control/DmzTopNavCreator.java
new file mode 100644
index 00000000000..7006f122b12
--- /dev/null
+++ b/src/main/java/org/olat/gui/control/DmzTopNavCreator.java
@@ -0,0 +1,51 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.gui.control;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.control.Controller;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.creator.AutoCreator;
+
+/**
+ * 
+ * <h3>Description:</h3>
+ * <p>
+ * Initial Date:  30 nov. 2010 <br>
+ * @author srosse, srosse@frentix.com, www.frentix.com
+ */
+public class DmzTopNavCreator extends AutoCreator {
+
+	private boolean impressum;
+	
+	@Override
+	public Controller createController(UserRequest ureq, WindowControl wControl) {
+		return new OlatDmzTopNavController(ureq, wControl, impressum);
+	}
+
+
+	public boolean isImpressum() {
+		return impressum;
+	}
+
+	public void setImpressum(boolean impressum) {
+		this.impressum = impressum;
+	}
+}
diff --git a/src/main/java/org/olat/gui/control/GuestTopNavCreator.java b/src/main/java/org/olat/gui/control/GuestTopNavCreator.java
new file mode 100644
index 00000000000..1eddf777490
--- /dev/null
+++ b/src/main/java/org/olat/gui/control/GuestTopNavCreator.java
@@ -0,0 +1,51 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.gui.control;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.control.Controller;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.creator.AutoCreator;
+
+/**
+ * 
+ * <h3>Description:</h3>
+ * <p>
+ * Initial Date:  30 nov. 2010 <br>
+ * @author srosse, srosse@frentix.com, www.frentix.com
+ */
+public class GuestTopNavCreator extends AutoCreator {
+
+	private boolean impressum;
+	
+	@Override
+	public Controller createController(UserRequest ureq, WindowControl wControl) {
+		return new OlatGuestTopNavController(ureq, wControl, impressum);
+	}
+
+
+	public boolean isImpressum() {
+		return impressum;
+	}
+
+	public void setImpressum(boolean impressum) {
+		this.impressum = impressum;
+	}
+}
diff --git a/src/main/java/org/olat/gui/control/OlatDmzTopNavController.java b/src/main/java/org/olat/gui/control/OlatDmzTopNavController.java
index f7d39065711..1227a34b3bf 100644
--- a/src/main/java/org/olat/gui/control/OlatDmzTopNavController.java
+++ b/src/main/java/org/olat/gui/control/OlatDmzTopNavController.java
@@ -25,23 +25,42 @@
 package org.olat.gui.control;
 
 import org.olat.core.commons.chiefcontrollers.LanguageChooserController;
+import org.olat.core.commons.controllers.impressum.ImpressumDmzMainController;
 import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.Windows;
 import org.olat.core.gui.components.Component;
+import org.olat.core.gui.components.link.Link;
+import org.olat.core.gui.components.link.LinkFactory;
 import org.olat.core.gui.components.velocity.VelocityContainer;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
+import org.olat.core.gui.control.creator.ControllerCreator;
+import org.olat.core.gui.control.generic.popup.PopupBrowserWindow;
 
 public class OlatDmzTopNavController extends BasicController{
-
+	
+	private Link impressumLink;
 	private VelocityContainer topNavVC;
 	private LanguageChooserController languageChooserC;
-
+	
 	public OlatDmzTopNavController(UserRequest ureq, WindowControl wControl) {
+		this(ureq, wControl, false);
+	}
+
+	public OlatDmzTopNavController(UserRequest ureq, WindowControl wControl, boolean impressum) {
 		super(ureq, wControl);
 
 		topNavVC = createVelocityContainer("dmztopnav");
+		
+		// impressum
+		if(impressum) {
+			impressumLink = LinkFactory.createLink("topnav.impressum", topNavVC, this);
+			impressumLink.setTooltip("topnav.impressum.alt", false);
+			impressumLink.setAjaxEnabled(false);
+			impressumLink.setTarget("_blank");
+		}
 
 		//choosing language 
 		languageChooserC = new LanguageChooserController(getWindowControl(), ureq);
@@ -54,14 +73,17 @@ public class OlatDmzTopNavController extends BasicController{
 
 		putInitialPanel(topNavVC);		
 	}
-
-	@Override
-	protected void event(UserRequest ureq, Controller source, Event event) {
-		//
-	}
 	
 	public void event(UserRequest ureq, Component source, Event event) {
-		//no events yet
+		if (source == impressumLink) {
+			ControllerCreator impressumControllerCreator = new ControllerCreator() {
+				public Controller createController(UserRequest lureq, WindowControl lwControl) {
+					return new ImpressumDmzMainController(lureq, lwControl);
+				}
+			};
+			PopupBrowserWindow popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewUnauthenticatedPopupWindowFor(ureq, impressumControllerCreator);
+			popupBrowserWindow.open(ureq);
+		}
 	}
 
 	protected void doDispose() {
diff --git a/src/main/java/org/olat/gui/control/OlatGuestTopNavController.java b/src/main/java/org/olat/gui/control/OlatGuestTopNavController.java
index b228b2c0ce9..7dcf8b149e7 100644
--- a/src/main/java/org/olat/gui/control/OlatGuestTopNavController.java
+++ b/src/main/java/org/olat/gui/control/OlatGuestTopNavController.java
@@ -26,8 +26,10 @@
 package org.olat.gui.control;
 
 import org.olat.basesecurity.AuthHelper;
+import org.olat.core.commons.controllers.impressum.ImpressumMainController;
 import org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayoutFactory;
 import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.Windows;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.components.link.LinkFactory;
@@ -52,12 +54,25 @@ public class OlatGuestTopNavController extends BasicController {
 	private VelocityContainer topNavVC;
 	private Link helpLink;
 	private Link loginLink;
+	private Link impressumLink;
 	
 
 	public OlatGuestTopNavController(UserRequest ureq, WindowControl wControl) {
+		this(ureq, wControl, false);
+	}
+
+	public OlatGuestTopNavController(UserRequest ureq, WindowControl wControl, boolean impressum) {
 		super(ureq, wControl);
 		topNavVC = createVelocityContainer("guesttopnav");
 		
+		// impressum
+		if(impressum) {
+			impressumLink = LinkFactory.createLink("topnav.impressum", topNavVC, this);
+			impressumLink.setTooltip("topnav.impressum.alt", false);
+			impressumLink.setAjaxEnabled(false);
+			impressumLink.setTarget("_blank");
+		}
+		
 		// the help link
 		helpLink = LinkFactory.createLink("topnav.help", topNavVC, this);
 		helpLink.setTooltip("topnav.help.alt", false);
@@ -77,7 +92,7 @@ public class OlatGuestTopNavController extends BasicController {
 	public void event(UserRequest ureq, Component source, Event event) {
 		if (source == loginLink) {
 			AuthHelper.doLogout(ureq);
-		}else if (source == helpLink) {
+		} else if (source == helpLink) {
 			ControllerCreator ctrlCreator = new ControllerCreator() {
 				public Controller createController(UserRequest lureq, WindowControl lwControl) {
 					return CourseFactory.createHelpCourseLaunchController(lureq, lwControl);
@@ -89,6 +104,14 @@ public class OlatGuestTopNavController extends BasicController {
 			PopupBrowserWindow pbw = getWindowControl().getWindowBackOffice().getWindowManager().createNewPopupBrowserWindowFor(ureq, layoutCtrlr);
 			pbw.open(ureq);
 			//
+		}	else if (source == impressumLink) {
+			ControllerCreator impressumControllerCreator = new ControllerCreator() {
+				public Controller createController(UserRequest lureq, WindowControl lwControl) {
+					return new ImpressumMainController(lureq, lwControl);
+				}
+			};
+			PopupBrowserWindow popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, impressumControllerCreator);
+			popupBrowserWindow.open(ureq);
 		}
 	}
 
diff --git a/src/main/java/org/olat/gui/control/OlatTopNavController.java b/src/main/java/org/olat/gui/control/OlatTopNavController.java
index 7aa9ffd3f33..88da2a2da3b 100644
--- a/src/main/java/org/olat/gui/control/OlatTopNavController.java
+++ b/src/main/java/org/olat/gui/control/OlatTopNavController.java
@@ -27,12 +27,14 @@ package org.olat.gui.control;
 
 import org.olat.basesecurity.AuthHelper;
 import org.olat.core.CoreSpringFactory;
+import org.olat.core.commons.controllers.impressum.ImpressumMainController;
 import org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayoutFactory;
 import org.olat.core.commons.services.search.ui.SearchController;
 import org.olat.core.commons.services.search.ui.SearchServiceUIFactory;
 import org.olat.core.commons.services.search.ui.SearchServiceUIFactory.DisplayOption;
 import org.olat.core.dispatcher.DispatcherAction;
 import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.Windows;
 import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.link.Link;
 import org.olat.core.gui.components.link.LinkFactory;
@@ -42,6 +44,7 @@ import org.olat.core.gui.control.Event;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.gui.control.controller.BasicController;
 import org.olat.core.gui.control.creator.ControllerCreator;
+import org.olat.core.gui.control.generic.popup.PopupBrowserWindow;
 import org.olat.core.id.OLATResourceable;
 import org.olat.core.util.event.EventBus;
 import org.olat.core.util.event.GenericEventListener;
@@ -60,20 +63,24 @@ import org.olat.instantMessaging.groupchat.GroupChatManagerController;
  * 
  * @author patrickb
  */
-public class OlatTopNavController extends BasicController /*TODO:PB:OLAT-4047 implements GenericEventListener*/ implements GenericEventListener{
+public class OlatTopNavController extends BasicController implements GenericEventListener {
+	
 	private static final String ACTION_LOGOUT = "logout";
 	private VelocityContainer topNavVC;
 	private Controller imController;
 	private GroupChatManagerController groupChatController;
 	private SearchController searchC;
-	private Link helpLink, loginLink;
-	//TODO:PB:OLAT-4047 private Link permLink;
-	//TODO:PB:OLAT-4047 private VelocityContainer permsharp;
+	private Link helpLink, loginLink, impressumLink;
+
 	
 	private EventBus singleUserEventCenter;
 	private OLATResourceable ass;
 	
 	public OlatTopNavController(UserRequest ureq, WindowControl wControl) {
+		this(ureq, wControl, false, true);
+	}
+	
+	public OlatTopNavController(UserRequest ureq, WindowControl wControl, boolean impressum,	boolean search) {
 		super(ureq, wControl);
 		
 		topNavVC = createVelocityContainer("topnav");
@@ -97,21 +104,20 @@ public class OlatTopNavController extends BasicController /*TODO:PB:OLAT-4047 im
 			topNavVC.contextPut("isGuest", Boolean.TRUE);
 			loginLink = LinkFactory.createLink("topnav.login", topNavVC, this);
 			loginLink.setTooltip("topnav.login.alt", false);
-		} 
+		}
+		
+		if(impressum) {
+			impressumLink = LinkFactory.createLink("topnav.impressum", topNavVC, this);
+			impressumLink.setTooltip("topnav.impressum.alt", false);
+			impressumLink.setAjaxEnabled(false);
+			impressumLink.setTarget("_blank");
+		}
 		
 		SearchServiceUIFactory searchUIFactory = (SearchServiceUIFactory)CoreSpringFactory.getBean(SearchServiceUIFactory.class);
 		searchC = searchUIFactory.createInputController(ureq, wControl, DisplayOption.STANDARD, null);
 		searchC.setResourceContextEnable(false);
 		topNavVC.put("search_input", searchC.getInitialComponent());
 		
-		//TODO:PB:OLAT-4047 permLink = LinkFactory.createLink("topnav.permlink", topNavVC, this);
-		//TODO:PB:OLAT-4047 permLink.setTarget("_permlink");
-		//TODO:PB:OLAT-4047 permsharp = createVelocityContainer("permsharp");
-		//TODO:PB:OLAT-4047 Panel p = new Panel("refreshpermlink");
-		//TODO:PB:OLAT-4047 p.setContent(permsharp);
-		//TODO:PB:OLAT-4047 topNavVC.put("refreshpermlink",p);
-		
-	  //TODO:PB:OLAT-4047 getWindowControl().getWindowBackOffice().addCycleListener(this);//receive events to adjust URL
 
 		if (ureq.getIdentity() != null) {
 			ass = OresHelper.createOLATResourceableType(AssessmentEvent.class);
@@ -122,17 +128,6 @@ public class OlatTopNavController extends BasicController /*TODO:PB:OLAT-4047 im
 		putInitialPanel(topNavVC);
 	}
 	
-	/**
-	 * 
-	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
-	 */
-	@Override
-	protected void event(UserRequest ureq, Controller source, Event event) {
-		if (source == topNavVC) {
-			//System.out.println(event.getCommand());
-		}
-	}
-	
 	/**
 	 * 
 	 * @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
@@ -153,20 +148,18 @@ public class OlatTopNavController extends BasicController /*TODO:PB:OLAT-4047 im
 				//
 			} else if (source == loginLink) {
 				DispatcherAction.redirectToDefaultDispatcher(ureq.getHttpResp());
-			} /* //TODO:PB:OLAT-4047  else if (source == permLink){
-
-				WindowControl current = (WindowControl)getWindowControl().getWindowBackOffice().getWindow().getAttribute("BUSPATH");
-				String buspath = current != null ? JumpInManager.getRestJumpInUri(current.getBusinessControl()) : "NONE";
-				String postUrl = Settings.getServerContextPathURI()+"/url/"+buspath;
-				String deliciousPost = "http://del.icio.us/post?url="+postUrl;
-				ControllerCreator ctrl = BaseFullWebappPopupLayoutFactory.createRedirectingPopup(ureq, deliciousPost);
-				openInNewBrowserWindow(ureq, ctrl);
-				return;
-			}*/
-		if (source == topNavVC) {
+			} else if (source == topNavVC) {
 			if (command.equals(ACTION_LOGOUT)) {
 				AuthHelper.doLogout(ureq);
 			}
+		}	else if (source == impressumLink) {
+			ControllerCreator impressumControllerCreator = new ControllerCreator() {
+				public Controller createController(UserRequest lureq, WindowControl lwControl) {
+					return new ImpressumMainController(lureq, lwControl);
+				}
+			};
+			PopupBrowserWindow popupBrowserWindow = Windows.getWindows(ureq).getWindowManager().createNewPopupBrowserWindowFor(ureq, impressumControllerCreator);
+			popupBrowserWindow.open(ureq);
 		}
 	}
 
@@ -199,19 +192,4 @@ public class OlatTopNavController extends BasicController /*TODO:PB:OLAT-4047 im
 			} 
 		}
 	}
-
-  /* TODO:PB:OLAT-4047 
-	public void event(Event event) {
-			if (event == Window.BEFORE_INLINE_RENDERING) {
-				// create jump in path from the active main content WindowControl
-				WindowControl tmp = (WindowControl)getWindowControl().getWindowBackOffice().getWindow().getAttribute("BUSPATH");
-				String buspath = tmp != null ? JumpInManager.getRestJumpInUri(tmp.getBusinessControl()) : "NONE";
-				buspath = "/url/"+buspath; 
-				String postUrl = Settings.getServerContextPathURI()+buspath;//TODO:PB:2009-06-02: move /url/ String to Spring config
-				//udpate URL for the addthis javascript box in the topnav velocity
-				permsharp.contextPut("myURL", postUrl);
-				permsharp.contextPut("buspath", buspath);
-			}
-		
-	}*/
 }
diff --git a/src/main/java/org/olat/gui/control/TopNavCreator.java b/src/main/java/org/olat/gui/control/TopNavCreator.java
new file mode 100644
index 00000000000..973babde471
--- /dev/null
+++ b/src/main/java/org/olat/gui/control/TopNavCreator.java
@@ -0,0 +1,63 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.gui.control;
+
+import org.olat.core.gui.UserRequest;
+import org.olat.core.gui.control.Controller;
+import org.olat.core.gui.control.WindowControl;
+import org.olat.core.gui.control.creator.AutoCreator;
+
+/**
+ * 
+ * <h3>Description:</h3>
+ * AutoCreator for the FrentixTopNavController which allow to configure
+ * an impressum or not, annd the search or not
+ * 
+ * <p>
+ * Initial Date:  25 nov. 2010 <br>
+ * @author srosse, srosse@frentix.com, www.frentix.com
+ */
+public class TopNavCreator extends AutoCreator {
+	
+	private boolean impressum;
+	private boolean search;
+	
+	
+	@Override
+	public Controller createController(UserRequest ureq, WindowControl wControl) {
+		return new OlatTopNavController(ureq, wControl, impressum, search);
+	}
+	
+	public boolean isImpressum() {
+		return impressum;
+	}
+
+	public void setImpressum(boolean impressum) {
+		this.impressum = impressum;
+	}
+
+	public boolean isSearch() {
+		return search;
+	}
+
+	public void setSearch(boolean search) {
+		this.search = search;
+	}
+}
diff --git a/src/main/java/org/olat/gui/control/_content/dmztopnav.html b/src/main/java/org/olat/gui/control/_content/dmztopnav.html
index 1a0237f8c66..e1e2896ebd8 100644
--- a/src/main/java/org/olat/gui/control/_content/dmztopnav.html
+++ b/src/main/java/org/olat/gui/control/_content/dmztopnav.html
@@ -1,4 +1,9 @@
 <ul>
+#if($r.available("topnav.impressum"))
+	<li>
+		$r.render("topnav.impressum")
+	</li>
+#end
 	<li id="o_topnav_langchooser">
 		$r.render("languageChooser")
 	</li>
diff --git a/src/main/java/org/olat/gui/control/_content/guesttopnav.html b/src/main/java/org/olat/gui/control/_content/guesttopnav.html
index b52b3afe72f..e390ead44c4 100644
--- a/src/main/java/org/olat/gui/control/_content/guesttopnav.html
+++ b/src/main/java/org/olat/gui/control/_content/guesttopnav.html
@@ -1,4 +1,9 @@
-<ul>	
+<ul>
+#if($r.available("topnav.impressum"))
+	<li>
+		$r.render("topnav.impressum")
+	</li>
+#end
 	<li id="o_topnav_help">
 		$r.render("topnav.help")
 	</li>
diff --git a/src/main/java/org/olat/gui/control/_content/permsharp.html b/src/main/java/org/olat/gui/control/_content/permsharp.html
deleted file mode 100644
index 0ab9ece9afa..00000000000
--- a/src/main/java/org/olat/gui/control/_content/permsharp.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<script>
-window.location.hash='${buspath}';
-</script>
\ No newline at end of file
diff --git a/src/main/java/org/olat/gui/control/_content/topnav.html b/src/main/java/org/olat/gui/control/_content/topnav.html
index 66aab390fde..c6cc178782a 100644
--- a/src/main/java/org/olat/gui/control/_content/topnav.html
+++ b/src/main/java/org/olat/gui/control/_content/topnav.html
@@ -1,4 +1,9 @@
 <ul>
+#if($r.available("topnav.impressum"))
+	<li>
+		$r.render("topnav.impressum")
+	</li>
+#end
 #if ($r.available("groupchatcontroller"))
 	<li id="o_topnav_imgroupclient">
 		$r.render("groupchatcontroller")
diff --git a/src/main/java/org/olat/gui/control/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/gui/control/_i18n/LocalStrings_de.properties
index 87166d069ac..3481289b498 100644
--- a/src/main/java/org/olat/gui/control/_i18n/LocalStrings_de.properties
+++ b/src/main/java/org/olat/gui/control/_i18n/LocalStrings_de.properties
@@ -8,6 +8,8 @@ topnav.close=Fenster schliessen
 topnav.close.alt=Schliessen Sie dieses Fenster
 topnav.help=Hilfe
 topnav.help.alt=Starten Sie die OLAT-Hilfe
+topnav.impressum=Impressum
+topnav.impressum.alt=Impressum
 topnav.permlink=Eindeutiger Link (Permalink)
 topnav.permlink.info=hierher verlinken mittels {0}
 topnav.login=Login
diff --git a/src/main/java/org/olat/gui/control/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/gui/control/_i18n/LocalStrings_en.properties
index 94ad6f2667a..0aee31ac52c 100644
--- a/src/main/java/org/olat/gui/control/_i18n/LocalStrings_en.properties
+++ b/src/main/java/org/olat/gui/control/_i18n/LocalStrings_en.properties
@@ -8,6 +8,8 @@ topnav.close=Close window
 topnav.close.alt=Close this window
 topnav.help=Help
 topnav.help.alt=Start OLAT Help
+topnav.impressum=Imprint
+topnav.impressum.alt=Imprint
 topnav.login=Log in
 topnav.login.alt=Log in to OLAT
 topnav.logout=Log out
diff --git a/src/main/java/org/olat/gui/control/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/gui/control/_i18n/LocalStrings_fr.properties
index 5bc956ca543..54ff9cc5448 100644
--- a/src/main/java/org/olat/gui/control/_i18n/LocalStrings_fr.properties
+++ b/src/main/java/org/olat/gui/control/_i18n/LocalStrings_fr.properties
@@ -8,6 +8,8 @@ topnav.close=Fermer fen\u00EAtre
 topnav.close.alt=Fermez cette fen\u00EAtre
 topnav.help=Aide
 topnav.help.alt=D\u00E9marrer l'aide de OLAT
+topnav.impressum=Mentions l\u00E9gales
+topnav.impressum.alt=Mentions l\u00E9gales
 topnav.login=Login
 topnav.login.alt=Connectez vous \u00E0 OLAT
 topnav.logout=Se d\u00E9connecter
diff --git a/src/main/java/org/olat/login/GuestBFWCParts.java b/src/main/java/org/olat/login/GuestBFWCParts.java
index d1fa7359029..0bf744340a6 100644
--- a/src/main/java/org/olat/login/GuestBFWCParts.java
+++ b/src/main/java/org/olat/login/GuestBFWCParts.java
@@ -53,6 +53,8 @@ import org.olat.gui.control.OlatGuestTopNavController;
  * @author patrickb
  */
 public class GuestBFWCParts implements BaseFullWebappControllerParts {
+	
+	private boolean showTopNav = true;
 
 	/**
 	 * @see org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts#createFooterController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
@@ -86,7 +88,16 @@ public class GuestBFWCParts implements BaseFullWebappControllerParts {
 	 * @see org.olat.core.commons.fullWebApp.BaseFullWebappControllerParts#createTopNavController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
 	 */
 	public Controller createTopNavController(UserRequest ureq, WindowControl wControl) {
-		return new OlatGuestTopNavController(ureq, wControl);
+		if (showTopNav) {
+			Controller topNavCtr = null;
+			if (CoreSpringFactory.containsBean("fullWebApp.GuestTopNavControllerCreator")) {
+				ControllerCreator headerControllerCreator = (ControllerCreator)  CoreSpringFactory.getBean("fullWebApp.GuestTopNavControllerCreator");
+				topNavCtr = headerControllerCreator.createController(ureq, wControl);
+			}
+			return topNavCtr;
+		} else {
+			return null;
+		}
 	}
 
 
diff --git a/src/main/resources/serviceconfig/olat.properties b/src/main/resources/serviceconfig/olat.properties
index ef42f087ed2..145606dd354 100644
--- a/src/main/resources/serviceconfig/olat.properties
+++ b/src/main/resources/serviceconfig/olat.properties
@@ -283,6 +283,13 @@ minimalhome.ext.notifications=true
 minimalhome.ext.calendar=true
 minimalhome.ext.mysettings=true
 minimalhome.ext.portal=true
+
+########################################################################
+#Top navigation configuration
+########################################################################
+topnav.impressum=false
+topnav.search=true
+
 #webdav manager (show or don't webdav links in GIU)
 webdav.links.enabled=true
 
diff --git a/src/main/resources/serviceconfig/org/olat/_spring/olatextconfig.xml b/src/main/resources/serviceconfig/org/olat/_spring/olatextconfig.xml
index 7412c60792c..12a31c78f61 100644
--- a/src/main/resources/serviceconfig/org/olat/_spring/olatextconfig.xml
+++ b/src/main/resources/serviceconfig/org/olat/_spring/olatextconfig.xml
@@ -40,136 +40,7 @@
 	<bean id ="subshandlerbean" class = "org.olat.notifications.SubscriptionJumpInHandlerFactory" />
 	<bean id ="catahandlerbean" class = "org.olat.catalog.CatalogJumpInHandlerFactory" />
 	<bean id ="userhandlerbean" class = "org.olat.user.notification.UserJumpInHandlerFactory" />
-	
-
-	<!-- OLAT specific popup windows default layout, which is also applied to 
-	popupwindows opened within core controllers, e.g. html editor or thelike -->
-	<bean id="org.olat.core.gui.control.generic.popup.PopupBrowserWindowControllerCreator" 
-		class="org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayoutCreator" >
-	</bean>
-
-
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** header part, e.g. for a logo       ***
-		******************************************
-	-->
-	<bean id="fullWebApp.HeaderControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.core.commons.fullWebApp.EmptyHeaderController"/>
-	</bean>
-	<!-- use the following header controller instead if you want a logo header header or configure you own
-	<bean id="fullWebApp.HeaderControllerCreator" class="org.olat.core.commons.fullWebApp.LogoWithLinkHeaderControllerCreator" scope="prototype">
-		<property name="linkURI" value="http://www.brasatoframework.org" />	
-		<property name="imgURI" value="http://www.brasatoframework.org/images/logo.png" />	
-		<property name="imgAltText" value="Brasato Open Source WebApp Framework" />					
-	</bean> 		
-	-->
-	<!-- in case a Guest uses OLAT, see GuestBFWCParts -->
-	<!-- <bean id="fullWebApp.GuestHeaderControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype">
-		<property name="className" value="org.olat.core.commons.fullWebApp.EmptyHeaderController"/>
-	</bean> -->
-	<!-- Header for DMZ, see DmzBFWCParts -->
-    <!-- <bean  id="fullWebApp.DMZHeaderControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.core.commons.fullWebApp.EmptyHeaderController"/>
-	</bean> --> 
 
-	
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** right upper corner.                ***
-		******************************************
-	-->
-	<bean id="fullWebApp.DMZTopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatDmzTopNavController"/>
-	</bean>
-	<bean id="fullWebApp.TopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatTopNavController"/>
-	</bean>
-	<!-- uncomment this and comment above line if automatic guest login should be enabled 
-	<bean id="fullWebApp.TopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatGuestTopNavController"/>
-	</bean>
-	 -->
-
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** right upper corner in pop ups      ***
-		******************************************
-	-->
-	<bean id="fullWebApp.MinimalTopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatMinimalTopNavController"/>
-	</bean>
-
-
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** Footer.                            ***
-		******************************************
-	-->
-	<bean  id="fullWebApp.FooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatFooterController"/>
-	</bean>
-    <!-- uncomment this and comment above line if automatic guest login should be enabled:  
-	<bean  id="fullWebApp.FooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatGuestFooterController"/>
-	</bean>
-    -->
-	<!-- in case a Guest uses OLAT, see GuestBFWCParts -->
-    <bean  id="fullWebApp.GuestFooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatGuestFooterController"/>
-	</bean>   	
-	<!-- Footer for DMZ, see DmzBFWCParts -->
-    <bean  id="fullWebApp.DMZFooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.gui.control.OlatGuestFooterController"/>
-	</bean>   		
-
-		
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** header part, in context help       ***
-		******************************************
-	-->
-	<bean id="fullWebApp.ContextHelpHeaderControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.core.commons.fullWebApp.EmptyHeaderController"/>
-	</bean>
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** right upper corner inin context help**
-		******************************************
-	-->
-	<bean id="fullWebApp.ContextHelpTopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.core.commons.contextHelp.ContextHelpTopNavController" />
-	</bean>
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** Footer in in context help.         ***
-		******************************************
-	-->
-	<bean id="fullWebApp.ContextHelpFooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.gui.control.OlatFooterController"/>
-	</bean>
-
-
-	<!--
-		**************************************************************************
-		*** Configure the controller-workflow which should be presented		   ***
-		*** right after a user logged in.                                      ***
-		*** See comment in AfterLoginInterceptorController                     ***
-		**************************************************************************
-	-->
-	<bean id="fullWebApp.AfterLoginInterceptionControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.login.AfterLoginInterceptionController"/>
-	</bean>
-
-		
-	
       
     <!--
 		*****************************************
@@ -179,9 +50,7 @@
 	<bean id="persistentLockManager" class="org.olat.util.locks.DBPersistentLockManager"  >
 		<constructor-arg index="0" ref="userDeletionManager" />
 	</bean>  
-	
-          
-      
+
     <!--
 		*****************************************
 		*** Define the Notifications Manager  ***
diff --git a/src/main/resources/serviceconfig/org/olat/core/_spring/mainCorecontext.xml b/src/main/resources/serviceconfig/org/olat/core/_spring/mainCorecontext.xml
index 0af5f18e1d6..f73164ef517 100644
--- a/src/main/resources/serviceconfig/org/olat/core/_spring/mainCorecontext.xml
+++ b/src/main/resources/serviceconfig/org/olat/core/_spring/mainCorecontext.xml
@@ -54,21 +54,23 @@
 	  			</map>
 	  		</property>
 	</bean>
-	<!-- TODO:<bean id ="defaultbean" class = "org.olat.core.default.Dispatcher" scope="prototype"/> -->
 	
+	<!--
+		**************************************************************************
+		*** Configure the controller-workflow which should be presented		   ***
+		*** right after a user logged in.                                      ***
+		*** See comment in AfterLoginInterceptorController                     ***
+		**************************************************************************
+	-->
+	<bean id="fullWebApp.AfterLoginInterceptionControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
+		<property name="className" value="org.olat.login.AfterLoginInterceptionController"/>
+	</bean>
 	
 	<!-- the specifed creator is responsible for the frameworks popup browser window layout.
-	     Special layouts must be implemented by wrapping the content into a content-layouting controller 
-	     TODO:pb: discuss a layoutconfig.xml?-->
-	<bean id="org.olat.core.gui.control.generic.popup.PopupBrowserWindowControllerCreator" 
-		class="org.olat.core.gui.control.generic.popup.BasePopupWindowControllerCreator" >
-	</bean> 
-	<!-- An alternate popup controller when the base full web app controller is used
+	     Special layouts must be implemented by wrapping the content into a content-layouting controller -->
 	<bean id="org.olat.core.gui.control.generic.popup.PopupBrowserWindowControllerCreator" 
 		class="org.olat.core.commons.fullWebApp.popup.BaseFullWebappPopupLayoutCreator" >
 	</bean>
-	 -->
-	
 
 	<!--
 		******************************************
@@ -76,25 +78,30 @@
 		*** header part, e.g. for a logo       ***
 		******************************************
 	-->
-	<bean id="fullWebApp.HeaderControllerCreator" class="org.olat.core.commons.fullWebApp.LogoWithLinkHeaderControllerCreator" scope="prototype">
-		<property name="linkURI" value="http://www.brasatoframework.org" />	
-		<property name="imgURI" value="http://www.brasatoframework.org/images/logo.png" />	
-		<property name="imgAltText" value="Brasato Open Source WebApp Framework" />					
-	</bean> 		
-	<!-- use the following header controller instead if you want an empty header or configure you own
 	<bean id="fullWebApp.HeaderControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
 		<property name="className" value="org.olat.core.commons.fullWebApp.EmptyHeaderController"/>
 	</bean>
-	 -->
-
+	 
 	<!--
 		******************************************
 		*** Configure the controller in the    ***
 		*** right upper corner.                ***
 		******************************************
 	-->
-	<bean id="fullWebApp.TopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.core.commons.fullWebApp.DefaultTopNavController"/>
+	<!-- DMZ -->
+	<bean id="fullWebApp.DMZTopNavControllerCreator" class="org.olat.gui.control.DmzTopNavCreator">
+		<property name="impressum" value="${topnav.impressum}"/>
+	</bean>
+	
+	<!-- Guest -->
+	<bean id="fullWebApp.GuestTopNavControllerCreator" class="org.olat.gui.control.GuestTopNavCreator">
+		<property name="impressum" value="${topnav.impressum}"/>
+	</bean>
+
+	<!-- Authenticated -->
+	<bean id="fullWebApp.TopNavControllerCreator" class="org.olat.gui.control.TopNavCreator" >
+		<property name="impressum" value="${topnav.impressum}"/>
+		<property name="search" value="${topnav.search}" />
 	</bean>
 
 	<!--
@@ -103,23 +110,21 @@
 		*** Footer.                            ***
 		******************************************
 	-->
-	<bean id="fullWebApp.FooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.core.commons.fullWebApp.DefaultFooterController"/>
+	<!-- DMZ -->
+  <bean  id="fullWebApp.DMZFooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
+		<property name="className" value="org.olat.gui.control.OlatGuestFooterController"/>
+	</bean>
+	
+	<!-- Guest -->
+  <bean  id="fullWebApp.GuestFooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
+		<property name="className" value="org.olat.gui.control.OlatGuestFooterController"/>
+	</bean>
+	
+	<!-- Authenticated -->
+	<bean  id="fullWebApp.FooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
+		<property name="className" value="org.olat.gui.control.OlatFooterController"/>
 	</bean>
 
-	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** header part, in popups             ***
-		******************************************
-	-->
-	<!-- 
-	<bean id="fullWebApp.MinimalHeaderControllerCreator" class="org.olat.core.commons.fullWebApp.LogoWithLinkHeaderControllerCreator" scope="prototype">
-		<property name="linkURI" value="http://www.brasatoframework.org" />	
-		<property name="imgURI" value="http://www.brasatoframework.org/images/logo.png" />	
-		<property name="imgAltText" value="Brasato Open Source WebApp Framework" />					
-	</bean> 		
-	 -->
 	<!--
 		******************************************
 		*** Configure the controller in the    ***
@@ -127,21 +132,12 @@
 		******************************************
 	-->
 	<bean id="fullWebApp.MinimalTopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
-		<property name="className" value="org.olat.core.commons.fullWebApp.DefaultMinimalTopNavController" />
+		<property name="className" value="org.olat.gui.control.OlatMinimalTopNavController"/>
 	</bean>
 	<!--
-		******************************************
-		*** Configure the controller in the    ***
-		*** Footer in popups.                  ***
-		******************************************
-	-->
-	<!-- 
-	<bean id="fullWebApp.MinimalFooterControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator" >
-		<property name="className" value="org.olat.core.commons.fullWebApp.DefaultFooterController"/>
-	</bean>
-	 -->
-
-
+	<bean id="fullWebApp.MinimalTopNavControllerCreator" class="org.olat.core.gui.control.creator.AutoCreator">
+		<property name="className" value="org.olat.core.commons.fullWebApp.DefaultMinimalTopNavController" />
+	</bean> -->
 	<!--
 		******************************************
 		*** Configure the controller in the    ***
@@ -170,23 +166,4 @@
 		<property name="className" value="org.olat.core.commons.fullWebApp.DefaultFooterController"/>
 	</bean>
 
-      
-    <!--
-		*****************************************
-		*** Define the persistent lock manager    ***
-		*****************************************
-	-->
-	<!-- TODO:pb: <bean id="PersistentLockManager" class="org.olat.core.default.PersistentLockManager" />  -->
-
-	
-    <!--
-		*****************************************
-		*** Define the Quota Manager          ***
-		*****************************************
-	-->
-	<!-- 
-	<bean 
-		id="org.olat.core.util.vfs.QuotaManager" class="org.olat.core.util.vfs.QuotaManager"  />  
-	-->
-
 </beans>
-- 
GitLab