Skip to content
Snippets Groups Projects
Commit e1632de4 authored by gnaegi's avatar gnaegi
Browse files

OO-3365 hide language chooser on login screen when only one language is available

parent 49d40603
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,8 @@ 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.util.i18n.I18nManager;
import org.olat.core.util.i18n.I18nModule;
import org.olat.login.AboutController;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -57,6 +59,8 @@ public class OlatDmzTopNavController extends BasicController implements Lockable
private ImpressumModule impressumModule;
@Autowired
private HelpModule helpModule;
@Autowired
private I18nModule i18nModule;
public OlatDmzTopNavController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl);
......@@ -87,11 +91,13 @@ public class OlatDmzTopNavController extends BasicController implements Lockable
vc.put("topnav.about", aboutLink);
//choosing language
languageChooserC = new LanguageChooserController(getWindowControl(), ureq, "_top_nav_dmz_lang_chooser");
//DOKU:pb:2008-01 listenTo(languageChooserC); not necessary as LanguageChooser sends a MultiUserEvent
//which is catched by the BaseFullWebappController. This one is then
//responsible to recreate the GUI with the new Locale
vc.put("languageChooser", languageChooserC.getInitialComponent());
if (i18nModule.getEnabledLanguageKeys().size() > 1) {
languageChooserC = new LanguageChooserController(getWindowControl(), ureq, "_top_nav_dmz_lang_chooser");
//DOKU:pb:2008-01 listenTo(languageChooserC); not necessary as LanguageChooser sends a MultiUserEvent
//which is catched by the BaseFullWebappController. This one is then
//responsible to recreate the GUI with the new Locale
vc.put("languageChooser", languageChooserC.getInitialComponent());
}
putInitialPanel(vc);
}
......
......@@ -21,6 +21,8 @@
</li>
</ul>
</li>
#if($r.available("languageChooser"))
<li id="o_navbar_langchooser">$r.render("languageChooser")</li>
#end
</ul>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment