Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java =================================================================== diff -u -r4a2728da7ea82a98b92d3a8b08feb6efa4023b7d -r413ef9db9a94b751e76d21c66a2300c79e95e24a --- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 4a2728da7ea82a98b92d3a8b08feb6efa4023b7d) +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 413ef9db9a94b751e76d21c66a2300c79e95e24a) @@ -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 =================================================================== diff -u -r2f232c2fe9781a2deca52b5782759e05fe25f6b9 -r413ef9db9a94b751e76d21c66a2300c79e95e24a --- lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java (.../LoginRequestDispatcher.java) (revision 2f232c2fe9781a2deca52b5782759e05fe25f6b9) +++ lams_common/src/java/org/lamsfoundation/lams/integration/util/LoginRequestDispatcher.java (.../LoginRequestDispatcher.java) (revision 413ef9db9a94b751e76d21c66a2300c79e95e24a) @@ -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 =================================================================== diff -u -rf287cf86745ffa8ab008bbb10ff6f84e63be26b6 -r413ef9db9a94b751e76d21c66a2300c79e95e24a --- temp_moodle_dev/lamstwo.php (.../lamstwo.php) (revision f287cf86745ffa8ab008bbb10ff6f84e63be26b6) +++ temp_moodle_dev/lamstwo.php (.../lamstwo.php) (revision 413ef9db9a94b751e76d21c66a2300c79e95e24a) @@ -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 =================================================================== diff -u -rf287cf86745ffa8ab008bbb10ff6f84e63be26b6 -r413ef9db9a94b751e76d21c66a2300c79e95e24a --- temp_moodle_dev/lamstwo/config.html (.../config.html) (revision f287cf86745ffa8ab008bbb10ff6f84e63be26b6) +++ temp_moodle_dev/lamstwo/config.html (.../config.html) (revision 413ef9db9a94b751e76d21c66a2300c79e95e24a) @@ -23,6 +23,13 @@ + + request_source: + + + + + Index: temp_moodle_dev/lamstwo/mod.html =================================================================== diff -u -r0d309b3808834ad38122b363e8cf08bbabcbc774 -r413ef9db9a94b751e76d21c66a2300c79e95e24a --- temp_moodle_dev/lamstwo/mod.html (.../mod.html) (revision 0d309b3808834ad38122b363e8cf08bbabcbc774) +++ temp_moodle_dev/lamstwo/mod.html (.../mod.html) (revision 413ef9db9a94b751e76d21c66a2300c79e95e24a) @@ -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{