diff --git a/src/main/java/org/olat/core/commons/chiefcontrollers/BaseChiefController.java b/src/main/java/org/olat/core/commons/chiefcontrollers/BaseChiefController.java index 8d3d20e392c2ae6734e223edd535128cda03731d..9c1ad8355a5720ecc5e51b67fcc9a0ca18d09f81 100644 --- a/src/main/java/org/olat/core/commons/chiefcontrollers/BaseChiefController.java +++ b/src/main/java/org/olat/core/commons/chiefcontrollers/BaseChiefController.java @@ -33,6 +33,7 @@ import org.olat.core.dispatcher.mapper.GlobalMapperRegistry; import org.olat.core.dispatcher.mapper.Mapper; import org.olat.core.gui.UserRequest; import org.olat.core.gui.WindowManager; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.Windows; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.Window; @@ -61,6 +62,7 @@ import org.olat.core.util.Util; import org.olat.core.util.i18n.I18nManager; import org.olat.core.util.i18n.I18nModule; import org.olat.core.util.prefs.Preferences; +import org.olat.dispatcher.AuthenticatedDispatcher; /** * Description: <br> @@ -143,7 +145,9 @@ public class BaseChiefController extends DefaultChiefController implements Conte mainPanel.setContent(mainvc); WindowManager winman = Windows.getWindows(ureq).getWindowManager(); - wbo = winman.createWindowBackOffice("basechiefwindow", this); + String wSettings = (String)ureq.getUserSession().removeEntryFromNonClearedStore(AuthenticatedDispatcher.AUTHDISPATCHER_OPTIONS); + WindowSettings settings = WindowSettings.parse(wSettings); + wbo = winman.createWindowBackOffice("basechiefwindow", this, settings); Window w = wbo.getWindow(); // part that builds the css and javascript lib includes (<script diff --git a/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java b/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java index 321bf903072b61232de03cf64ac435b4b919ad2b..c060fbb29072badd53d5ed1ff693c68bcc258a38 100644 --- a/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java +++ b/src/main/java/org/olat/core/commons/fullWebApp/BaseFullWebappController.java @@ -41,6 +41,7 @@ import org.olat.core.gui.GUIInterna; import org.olat.core.gui.GUIMessage; import org.olat.core.gui.UserRequest; import org.olat.core.gui.WindowManager; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.Window; import org.olat.core.gui.components.htmlheader.jscss.CustomCSS; @@ -363,44 +364,48 @@ public class BaseFullWebappController extends BasicController implements Generic navLinkCounter++; } } + + WindowSettings wSettings = getWindowControl().getWindowBackOffice().getWindowSettings(); navVc.contextPut("sites", sites); navVc.contextPut("dtabs", dtabs); navVc.contextPut("dtabsLinkNames", dtabsLinkNames); navVc.contextPut("tabhelper", this); + navVc.setVisible(!wSettings.isHideNavigation()); - // ----------- header, optional (e.g. for logo, advertising ) + // header, optional (e.g. for logo, advertising ) headerCtr = baseFullWebappControllerParts.createHeaderController(ureq, getWindowControl()); if (headerCtr != null) { listenTo(headerCtr); // cleanup on dispose - mainVc.put("headerComponent", headerCtr.getInitialComponent()); + Component headerCmp = headerCtr.getInitialComponent(); + mainVc.put("headerComponent", headerCmp); + headerCmp.setVisible(!wSettings.isHideHeader()); } - // ----------- topnav, optional (e.g. for imprint, logout) + // topnav, optional (e.g. for imprint, logout) topnavCtr = baseFullWebappControllerParts.createTopNavController(ureq, getWindowControl()); if (topnavCtr != null) { listenTo(topnavCtr); // cleanup on dispose - mainVc.put("topnavComponent", topnavCtr.getInitialComponent()); + Component topNavCmp = topnavCtr.getInitialComponent(); + mainVc.put("topnavComponent", topNavCmp); + topNavCmp.setVisible(!wSettings.isHideHeader()); } - // ----------- nav, optional (e.g. site navigation with tabs) - // TODO fg: refactor to its own component // REVIEW:(pb) should then go also - // into ..Parts?! - // panel for modal overlays, placed right after the olat-header-div modalPanel = new Panel("ccmodalpanel"); mainVc.put("modalpanel", modalPanel); - // ----------- main, mandatory (e.g. a LayoutMain3ColsController) - // ------------------ + // main, mandatory (e.g. a LayoutMain3ColsController) main = new Panel("main"); mainVc.put("main", main); - // ----------- footer, optional (e.g. for copyright, powered by) + // footer, optional (e.g. for copyright, powered by) footerCtr = baseFullWebappControllerParts.createFooterController(ureq, getWindowControl()); if (footerCtr != null) { listenTo(footerCtr); // cleanup on dispose - mainVc.put("footerComponent", footerCtr.getInitialComponent()); + Component footerCmp = footerCtr.getInitialComponent(); + mainVc.put("footerComponent", footerCmp); + footerCmp.setVisible(!wSettings.isHideFooter()); } diff --git a/src/main/java/org/olat/core/commons/fullWebApp/LayoutMain3ColsController.java b/src/main/java/org/olat/core/commons/fullWebApp/LayoutMain3ColsController.java index be275af7cdb8d9389a27989f247475bf55719a09..2775c7565a9b01d5dabde5e09ce6c6460d064ed3 100644 --- a/src/main/java/org/olat/core/commons/fullWebApp/LayoutMain3ColsController.java +++ b/src/main/java/org/olat/core/commons/fullWebApp/LayoutMain3ColsController.java @@ -26,10 +26,9 @@ import java.util.Set; import org.olat.core.commons.chiefcontrollers.BaseChiefController; import org.olat.core.gui.UserRequest; +import org.olat.core.gui.WindowSettings; 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.panel.Panel; import org.olat.core.gui.components.velocity.VelocityContainer; import org.olat.core.gui.control.ChiefController; @@ -137,16 +136,22 @@ public class LayoutMain3ColsController extends MainLayoutBasicController impleme localLayoutConfig = getGuiPrefs(ureq, defaultConfiguration); - Link back = LinkFactory.createLink("back", layoutMainVC, this); - back.setCustomDisplayText("My course"); - layoutMainVC.put("back", back); + WindowSettings wSettings = wControl.getWindowBackOffice().getWindowSettings(); - // Push colums to velocity + // Push columns to velocity panel1 = new Panel("panel1"); + panel1.setVisible(!wSettings.isHideColumn1()); + if(col1 != null) { + col1.setVisible(!wSettings.isHideColumn1()); + } layoutMainVC.put("col1", panel1); setCol1(col1); panel2 = new Panel("panel2"); + panel2.setVisible(!wSettings.isHideColumn2()); + if(col2 != null) { + col2.setVisible(!wSettings.isHideColumn2()); + } layoutMainVC.put("col2", panel2); setCol2(col2); @@ -394,8 +399,12 @@ public class LayoutMain3ColsController extends MainLayoutBasicController impleme setCol(col1Component, 1); panel1.setContent(col1Component); // init col width - layoutMainVC.contextPut("col1CustomCSSStyles", "width: " + localLayoutConfig.getCol1WidthEM() + "em;"); - layoutMainVC.contextPut("col3CustomCSSStyles1", "margin-left: " + localLayoutConfig.getCol1WidthEM() + "em;"); + if(col1Component != null && col1Component.isVisible()) { + layoutMainVC.contextPut("col1CustomCSSStyles", "width: " + localLayoutConfig.getCol1WidthEM() + "em;"); + layoutMainVC.contextPut("col3CustomCSSStyles1", "margin-left: " + localLayoutConfig.getCol1WidthEM() + "em;"); + } else { + layoutMainVC.contextPut("col3CustomCSSStyles1", "margin-left:0;"); + } } /** @@ -404,8 +413,12 @@ public class LayoutMain3ColsController extends MainLayoutBasicController impleme public void setCol2(Component col2Component) { setCol(col2Component, 2); panel2.setContent(col2Component); - layoutMainVC.contextPut("col2CustomCSSStyles", "width: " + localLayoutConfig.getCol2WidthEM() + "em;"); - layoutMainVC.contextPut("col3CustomCSSStyles2", "margin-right: " + localLayoutConfig.getCol2WidthEM() + "em;"); + if(col2Component != null && col2Component.isVisible()) { + layoutMainVC.contextPut("col2CustomCSSStyles", "width: " + localLayoutConfig.getCol2WidthEM() + "em;"); + layoutMainVC.contextPut("col3CustomCSSStyles2", "margin-right: " + localLayoutConfig.getCol2WidthEM() + "em;"); + } else { + layoutMainVC.contextPut("col3CustomCSSStyles2", "margin-right: 0;"); + } } /** diff --git a/src/main/java/org/olat/core/commons/fullWebApp/_content/main_3cols.html b/src/main/java/org/olat/core/commons/fullWebApp/_content/main_3cols.html index 644541138552f6c952bb010be515d17739bd372d..015d3eb6cc392e9c12581edeec2e400dbea22bc7 100644 --- a/src/main/java/org/olat/core/commons/fullWebApp/_content/main_3cols.html +++ b/src/main/java/org/olat/core/commons/fullWebApp/_content/main_3cols.html @@ -1,6 +1,6 @@ <div id="b_main" class="$mainCssClasses"> ## begin: #col1 - first float column - #if($existsCol1) + #if($existsCol1 && $r.visible("col1")) <div id="b_col1" style="$!col1CustomCSSStyles"> <div id="b_col1_content" class="b_clearfix"> <a name="b_col1"></a> @@ -12,7 +12,7 @@ #end ## end: #col1 ## begin: #col2 second float column - #if($existsCol2) + #if($existsCol2 && $r.visible("col2")) <div id="b_col2" style="$!col2CustomCSSStyles"> <div id="b_col2_content" class="b_clearfix"> <a name="b_col2"></a> @@ -24,7 +24,7 @@ #end ## end: #col2 ## begin: #col3 static column - #if($existsCol3) + #if($existsCol3 && $r.visible("col3")) <div id="b_col3" style="$!col3CustomCSSStyles1 $!col3CustomCSSStyles2"> <div id="b_col3_content" class="b_clearfix"> ## skip anchor: content @@ -40,7 +40,7 @@ #end ## end: #col3 </div> - +#if(($existsCol1 && $r.visible("col1")) || ($existsCol2 && $r.visible("col2"))) <script type="text/javascript"> /* <![CDATA[ */ ## remove event handlers and alike from existing resizers first and clean them up @@ -59,7 +59,7 @@ ## init method to initialize the column resizer objects init : function(){ - #if($existsCol1) + #if($existsCol1 && $r.visible("col1")) if (B_AjaxLogger.isDebugEnabled()) B_AjaxLogger.logDebug('B_ResizableColumns.init called', "main_3cols.html"); var col1Elem = Ext.get('b_col1'); var col1WidthStyle = col1Elem.getStyle('width'); @@ -75,7 +75,7 @@ col1Elem.clip(); col1Elem = null; #end - #if($existsCol2) + #if($existsCol2 && $r.visible("col2")) var col2Elem = Ext.get('b_col2'); var col2WidthStyle = col2Elem.getStyle('width'); this._res_col2 = new Ext.Resizable(col2Elem, { @@ -102,12 +102,12 @@ if (B_AjaxLogger.isDebugEnabled()) B_AjaxLogger.logDebug('B_ResizableColumns.adjustHeight called', "main_3cols.html"); try { ## Reset col height first - #if($existsCol1) + #if($existsCol1 && $r.visible("col1")) var col1Elem = Ext.get('b_col1_content'); col1Elem.setHeight('auto'); col1Elem = null; #end - #if($existsCol2) + #if($existsCol2 && $r.visible("col2")) var col2Elem = Ext.get('b_col2_content'); col2Elem.setHeight('auto'); col2Elem = null @@ -115,12 +115,12 @@ ## Calculate new col height var contentHeight = OPOL.getMainColumnsMaxHeight(); ## Set new col height - #if($existsCol1) + #if($existsCol1 && $r.visible("col1")) var col1Elem = Ext.get('b_col1_content'); col1Elem.setHeight(contentHeight); col1Elem = null; #end - #if($existsCol2) + #if($existsCol2 && $r.visible("col2")) var col2Elem = Ext.get('b_col2_content'); col2Elem.setHeight(contentHeight); col2Elem = null; @@ -191,4 +191,5 @@ ## initialize everything now Ext.onReady(B_ResizableColumns.init, B_ResizableColumns, true); /* ]]> */ -</script> \ No newline at end of file +</script> +#end \ No newline at end of file diff --git a/src/main/java/org/olat/core/gui/WindowManager.java b/src/main/java/org/olat/core/gui/WindowManager.java index e9d22489f481ecbe363e0adf6991d734463c2ce0..e16891f3eb5b10ee0fe271471a85f24ffd8de05a 100644 --- a/src/main/java/org/olat/core/gui/WindowManager.java +++ b/src/main/java/org/olat/core/gui/WindowManager.java @@ -80,7 +80,7 @@ public interface WindowManager extends Disposable { * @param owner * @return */ - public WindowBackOffice createWindowBackOffice(String windowName, ChiefController owner); + public WindowBackOffice createWindowBackOffice(String windowName, ChiefController owner, WindowSettings settings); public void setAjaxEnabled(boolean enabled); diff --git a/src/main/java/org/olat/core/gui/WindowSettings.java b/src/main/java/org/olat/core/gui/WindowSettings.java new file mode 100644 index 0000000000000000000000000000000000000000..288518a2ead7122882b2dd35d7e44cf82e8ba0b8 --- /dev/null +++ b/src/main/java/org/olat/core/gui/WindowSettings.java @@ -0,0 +1,104 @@ +/** + * <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.gui; + +import org.olat.core.util.StringHelper; + +/** + * + * Initial date: 07.05.2013<br> + * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com + * + */ +public class WindowSettings { + + private boolean hideHeader = false; + private boolean hideNavigation = false; + private boolean hideFooter = false; + private boolean hideColumn1 = false; + private boolean hideColumn2 = false; + + public WindowSettings() { + // + } + + public static WindowSettings parse(String settings) { + WindowSettings wSettings = new WindowSettings(); + if(StringHelper.containsNonWhitespace(settings)) { + wSettings.hideHeader = settings.indexOf('h') >= 0; + wSettings.hideNavigation = settings.indexOf('n') >= 0; + wSettings.hideFooter = settings.indexOf('f') >= 0; + wSettings.hideColumn1 = settings.indexOf('1') >= 0; + wSettings.hideColumn2 = settings.indexOf('2') >= 0; + } + return wSettings; + } + + public boolean isHideHeader() { + return hideHeader; + } + + public void setHideHeader(boolean hideHeader) { + this.hideHeader = hideHeader; + } + + public boolean isHideNavigation() { + return hideNavigation; + } + + public void setHideNavigation(boolean hideNavigation) { + this.hideNavigation = hideNavigation; + } + + public boolean isHideFooter() { + return hideFooter; + } + + public void setHideFooter(boolean hideFooter) { + this.hideFooter = hideFooter; + } + + public boolean isHideColumn1() { + return hideColumn1; + } + + public void setHideColumn1(boolean hideColumn1) { + this.hideColumn1 = hideColumn1; + } + + public boolean isHideColumn2() { + return hideColumn2; + } + + public void setHideColumn2(boolean hideColumn2) { + this.hideColumn2 = hideColumn2; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + if(hideHeader) sb.append('h'); + if(hideNavigation) sb.append('n'); + if(hideFooter) sb.append('f'); + if(hideColumn1) sb.append('1'); + if(hideColumn2) sb.append('2'); + return sb.toString(); + } +} diff --git a/src/main/java/org/olat/core/gui/control/WindowBackOffice.java b/src/main/java/org/olat/core/gui/control/WindowBackOffice.java index 630a32936011b5ec4da209c18101e02cd68ac42f..b120217fb9497578ef9f6b47337f94d28978f39d 100644 --- a/src/main/java/org/olat/core/gui/control/WindowBackOffice.java +++ b/src/main/java/org/olat/core/gui/control/WindowBackOffice.java @@ -30,6 +30,7 @@ import java.util.List; import org.olat.core.gui.GlobalSettings; import org.olat.core.gui.UserRequest; import org.olat.core.gui.WindowManager; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.Window; import org.olat.core.gui.control.guistack.GuiStack; @@ -67,6 +68,12 @@ public interface WindowBackOffice extends Disposable{ * @return */ GlobalSettings getGlobalSettings(); + + /** + * Some settings for the current window + * @return + */ + WindowSettings getWindowSettings(); /** * @param ureq diff --git a/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java b/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java index 27b7d8de3966cadfc45b78ab70801e5bfd237e1f..445a2f417d2dad9bf31be8e961c834c1291a7311 100644 --- a/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java +++ b/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java @@ -35,6 +35,7 @@ import org.apache.commons.io.IOUtils; import org.olat.core.gui.GlobalSettings; import org.olat.core.gui.UserRequest; import org.olat.core.gui.WindowManager; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.ComponentRenderer; import org.olat.core.gui.components.Window; @@ -77,6 +78,7 @@ public class WindowBackOfficeImpl implements WindowBackOffice { private final WindowManagerImpl winmgrImpl; private Window window; + private WindowSettings settings; private ChiefController windowOwner; private InterceptHandler linkedInterceptHandler; @@ -96,13 +98,13 @@ public class WindowBackOfficeImpl implements WindowBackOffice { /** * */ - WindowBackOfficeImpl(final WindowManagerImpl winmgrImpl, String windowName, ChiefController windowOwner, int wboId) { + WindowBackOfficeImpl(final WindowManagerImpl winmgrImpl, String windowName, ChiefController windowOwner, int wboId, WindowSettings settings) { this.winmgrImpl = winmgrImpl; this.windowOwner = windowOwner; this.iframeName = "oaa"+wboId; window = new Window(windowName, this); - - + this.settings = settings; + // TODO make simpler, we do only need to support one intercept handler at a time! linkedInterceptHandler = new InterceptHandler() { public InterceptHandlerInstance createInterceptHandlerInstance() { @@ -157,6 +159,14 @@ public class WindowBackOfficeImpl implements WindowBackOffice { return winmgrImpl.getGlobalSettings(); } + @Override + public WindowSettings getWindowSettings() { + if(settings == null) { + settings = new WindowSettings(); + } + return settings; + } + /** * @return */ diff --git a/src/main/java/org/olat/core/gui/control/winmgr/WindowManagerImpl.java b/src/main/java/org/olat/core/gui/control/winmgr/WindowManagerImpl.java index b64aa4c15b0318a3ebc57d009daec1fed8dfe3a0..ee88113ef0a7efd475056836ed7eeeca4886637f 100644 --- a/src/main/java/org/olat/core/gui/control/winmgr/WindowManagerImpl.java +++ b/src/main/java/org/olat/core/gui/control/winmgr/WindowManagerImpl.java @@ -37,6 +37,7 @@ import org.olat.core.defaults.dispatcher.ClassPathStaticDispatcher; import org.olat.core.gui.GlobalSettings; import org.olat.core.gui.UserRequest; import org.olat.core.gui.WindowManager; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.ComponentRenderer; import org.olat.core.gui.components.velocity.VelocityContainer; @@ -249,8 +250,8 @@ public class WindowManagerImpl extends BasicManager implements WindowManager { /* (non-Javadoc) * @see org.olat.core.gui.WindowManager#createWindowBackOffice(java.lang.String, org.olat.core.gui.control.ChiefController) */ - public WindowBackOffice createWindowBackOffice(String windowName, ChiefController owner) { - WindowBackOfficeImpl wbo = new WindowBackOfficeImpl(this, windowName, owner, wboId++); + public WindowBackOffice createWindowBackOffice(String windowName, ChiefController owner, WindowSettings settings) { + WindowBackOfficeImpl wbo = new WindowBackOfficeImpl(this, windowName, owner, wboId++, settings); wbos.add(wbo); return wbo; } diff --git a/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java b/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java index 213696a2ac56afdec9f054b4544f072d3c905baf..a2f8d900a1c6100018775f3b6a1986e969c4184b 100644 --- a/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java +++ b/src/main/java/org/olat/core/gui/exception/ExceptionWindowController.java @@ -30,8 +30,8 @@ package org.olat.core.gui.exception; import java.util.Date; import java.util.List; -import org.apache.velocity.context.Context; import org.olat.core.gui.UserRequest; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.Windows; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.Window; @@ -57,7 +57,6 @@ import org.olat.core.util.UserSession; import org.olat.core.util.Util; import org.olat.core.util.WebappHelper; import org.olat.core.util.i18n.I18nManager; -import org.olat.core.util.mail.manager.MailManager; /** * Description: <br> @@ -192,7 +191,7 @@ public class ExceptionWindowController extends DefaultChiefController { msg.contextPut("supportaddress", WebappHelper.getMailConfig("mailError")); msg.contextPut("time", formatter.formatDateAndTime(new Date())); - WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("errormessagewindow", this); + WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("errormessagewindow", this, new WindowSettings()); Window w = wbo.getWindow(); msg.put("jsCssRawHtmlHeader", w.getJsCssRawHtmlHeader()); diff --git a/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java b/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java index a8fa0721ab4b3f6726baa3bb50215d74f0c4cea5..0887f4fe24803a5c5fb8a6c46c1ce2f70cdb438f 100644 --- a/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java +++ b/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java @@ -66,6 +66,7 @@ public class AuthenticatedDispatcher implements Dispatcher { protected static final String AUTHDISPATCHER_ENTRYURL = "AuthDispatcher:entryUrl"; protected static final String AUTHDISPATCHER_BUSINESSPATH = "AuthDispatcher:businessPath"; + public static final String AUTHDISPATCHER_OPTIONS = "AuthDispatcher:options"; protected static final String QUESTIONMARK = "?"; protected static final String GUEST = "guest"; diff --git a/src/main/java/org/olat/dispatcher/DMZDispatcher.java b/src/main/java/org/olat/dispatcher/DMZDispatcher.java index e2cdd411d82bff327b8ef23f18cd0610245834e4..25338e70820c134751a6e5b26ce965d5d96fc179 100644 --- a/src/main/java/org/olat/dispatcher/DMZDispatcher.java +++ b/src/main/java/org/olat/dispatcher/DMZDispatcher.java @@ -294,6 +294,7 @@ public class DMZDispatcher implements Dispatcher { if (window == null) { // no window found, -> start a new WorkFlow/Controller and obtain the window // main controller which also implements the windowcontroller for pagestatus and modal dialogs + Object wSettings = usess.getEntry(AuthenticatedDispatcher.AUTHDISPATCHER_OPTIONS); ChiefController occ = chiefControllerCreator.createChiefController(ureq); window = occ.getWindow(); @@ -306,6 +307,8 @@ public class DMZDispatcher implements Dispatcher { DTabs dts = window.getDTabs(); dts.activate(ureq, null, ces); } + //apply the settings forward + usess.putEntryInNonClearedStore(AuthenticatedDispatcher.AUTHDISPATCHER_OPTIONS, wSettings); } window.dispatchRequest(ureq); } diff --git a/src/main/java/org/olat/dispatcher/RESTDispatcher.java b/src/main/java/org/olat/dispatcher/RESTDispatcher.java index 8d3c0087d7bb2d8feb9bc16b32f05c25cd28a7f4..97583c7580c6e33af04c63ab9f852a98c2a46b44 100644 --- a/src/main/java/org/olat/dispatcher/RESTDispatcher.java +++ b/src/main/java/org/olat/dispatcher/RESTDispatcher.java @@ -205,7 +205,7 @@ public class RESTDispatcher implements Dispatcher { boolean auth = usess.isAuthenticated(); if (auth) { //fxdiff FXOLAT-113: business path in DMZ - setBusinessPathInUserSession(usess, businessPath); + setBusinessPathInUserSession(usess, businessPath, ureq.getParameter("wsettings")); //fxdiff if (Windows.getWindows(usess).getAttribute("AUTHCHIEFCONTROLLER") == null) { @@ -221,7 +221,7 @@ public class RESTDispatcher implements Dispatcher { } else { //prepare for redirect //fxdiff FXOLAT-113: business path in DMZ - setBusinessPathInUserSession(usess, businessPath); + setBusinessPathInUserSession(usess, businessPath, ureq.getParameter("wsettings")); String invitationAccess = ureq.getParameter(AuthenticatedDispatcher.INVITATION); if (invitationAccess != null && LoginModule.isInvitationEnabled()) { // try to log in as anonymous @@ -272,7 +272,7 @@ public class RESTDispatcher implements Dispatcher { * @param businessPath */ //fxdiff FXOLAT-113: business path in DMZ - private void setBusinessPathInUserSession(UserSession usess, String businessPath) { + private void setBusinessPathInUserSession(UserSession usess, String businessPath, String options) { if(StringHelper.containsNonWhitespace(businessPath) && usess != null) { if(businessPath.startsWith("[changepw:0]") || "[registration:0]".equals(businessPath) || "[guest:0]".equals(businessPath) || "[browsercheck:0]".equals(businessPath) || "[accessibility:0]".equals(businessPath) || "[about:0]".equals(businessPath)) { @@ -281,6 +281,9 @@ public class RESTDispatcher implements Dispatcher { usess.putEntryInNonClearedStore(AuthenticatedDispatcher.AUTHDISPATCHER_BUSINESSPATH, businessPath); } } + if(StringHelper.containsNonWhitespace(options) && usess != null) { + usess.putEntryInNonClearedStore(AuthenticatedDispatcher.AUTHDISPATCHER_OPTIONS, options); + } } private Locale getLang(UserRequest ureq) { diff --git a/src/main/java/org/olat/shibboleth/MessageWindowController.java b/src/main/java/org/olat/shibboleth/MessageWindowController.java index bffcc0fc58b870c4fa477e42bff5d74229b91d4a..4fa734f56860786d8716fb4cfaa46dd72ff4cf16 100644 --- a/src/main/java/org/olat/shibboleth/MessageWindowController.java +++ b/src/main/java/org/olat/shibboleth/MessageWindowController.java @@ -27,6 +27,7 @@ package org.olat.shibboleth; import org.olat.core.gui.UserRequest; +import org.olat.core.gui.WindowSettings; import org.olat.core.gui.Windows; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.Window; @@ -79,7 +80,7 @@ public class MessageWindowController extends DefaultChiefController { //Window w = new Window("messagewindow", this, jsadder); Windows ws = Windows.getWindows(ureq); - WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("messagewindow", this); + WindowBackOffice wbo = ws.getWindowManager().createWindowBackOffice("messagewindow", this, new WindowSettings()); Window w = wbo.getWindow(); msg.put("jsAndCssC", w.getJsCssRawHtmlHeader());