Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java,v diff -u -r1.22 -r1.23 --- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 29 Nov 2006 03:59:17 -0000 1.22 +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 13 Dec 2006 04:52:41 -0000 1.23 @@ -188,6 +188,12 @@ } else { String serverUrl = Configuration.get(ConfigurationKeys.SERVER_URL); req.setAttribute("serverUrl", serverUrl); + + String requestSrc = req.getParameter("requestSrc"); + String notifyCloseURL = req.getParameter("notifyCloseURL"); + req.setAttribute("requestSrc", requestSrc); + req.setAttribute("notifyCloseURL", notifyCloseURL); + return mapping.findForward("author"); } Index: lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java,v diff -u -r1.3 -r1.4 --- lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java 26 Nov 2006 07:01:22 -0000 1.3 +++ lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java 13 Dec 2006 04:52:19 -0000 1.4 @@ -20,6 +20,9 @@ */ package org.lamsfoundation.lams.integration.util; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -55,6 +58,10 @@ public static final String PARAM_COUNTRY = "country"; public static final String PARAM_LANGUAGE = "lang"; + + public static final String PARAM_REQUEST_SRC ="requestSrc"; + + public static final String PARAM_NOTIFY_CLOSE_URL ="notifyCloseURL"; public static final String METHOD_AUTHOR = "author"; @@ -88,7 +95,7 @@ String method = request.getParameter(PARAM_METHOD); String lessonId = request.getParameter(PARAM_LESSON_ID); - + try { addUserToLessonClass(request, lessonId, method); } catch (UserInfoFetchException e) { @@ -97,7 +104,24 @@ /** AUTHOR * */ if (METHOD_AUTHOR.equals(method)) { - return request.getContextPath() + URL_AUTHOR; + + String requestSrc = request.getParameter(PARAM_REQUEST_SRC); + String notifyCloseURL = request.getParameter(PARAM_NOTIFY_CLOSE_URL); + + String parameters = ""; + + if (requestSrc != null && notifyCloseURL != null) { + try { + parameters = "&" + PARAM_REQUEST_SRC + "=" + URLEncoder.encode(requestSrc, "UTF8"); + parameters += "&" + PARAM_NOTIFY_CLOSE_URL + "=" + URLEncoder.encode(notifyCloseURL, "UTF8"); + } catch (UnsupportedEncodingException e) { + log.error(e); + } + } else { + log.error("Parameters 'requestSrc' and 'notifyCloseURL' are not present"); + } + + return request.getContextPath() + URL_AUTHOR + parameters; } /** MONITOR * */ else if (METHOD_MONITOR.equals(method) && lessonId != null) { Index: temp_moodle_dev/lamstwo.php =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/Attic/lamstwo.php,v diff -u -r1.2 -r1.3 --- temp_moodle_dev/lamstwo.php 29 Nov 2006 06:08:35 -0000 1.2 +++ temp_moodle_dev/lamstwo.php 13 Dec 2006 04:49:25 -0000 1.3 @@ -17,6 +17,7 @@ $string['serverid'] = 'Enter the server ID'; $string['serverkey'] = 'Enter the server key'; $string['serverurl'] = 'Enter the basic URL used to access the LAMS server. For example http://localhost:8080/lams'; +$string['requestsource'] = 'This will be used in the message \"Close and return to {request_source}\" in the authoring module in LAMS.'; $string['visibletostudents'] = 'Show activity to students'; $string['wikistartederror'] = 'Wiki already has entries - can\'t change.'; $string['wrongversionrange'] = '$a is not a correct range!'; Index: temp_moodle_dev/lamstwo/config.html =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/lamstwo/Attic/config.html,v diff -u -r1.2 -r1.3 --- temp_moodle_dev/lamstwo/config.html 29 Nov 2006 06:08:34 -0000 1.2 +++ temp_moodle_dev/lamstwo/config.html 13 Dec 2006 04:49:27 -0000 1.3 @@ -23,6 +23,13 @@ + + request_source: + + + + + Index: temp_moodle_dev/lamstwo/mod.html =================================================================== RCS file: /usr/local/cvsroot/temp_moodle_dev/lamstwo/Attic/mod.html,v diff -u -r1.2 -r1.3 --- temp_moodle_dev/lamstwo/mod.html 27 Nov 2006 02:15:53 -0000 1.2 +++ temp_moodle_dev/lamstwo/mod.html 13 Dec 2006 04:49:27 -0000 1.3 @@ -298,6 +298,8 @@ } function openAuthor(url,name,options,fullscreen) { + url = url + "&requestSrc=" + escape("lamstwo_requestsource; ?>"); + url = url + "¬ifyCloseURL=" + escape(window.location.href); if(authorWin && !authorWin.closed){ authorWin.focus(); }else{