Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.76 -r1.77 --- lams_central/conf/language/lams/ApplicationResources.properties 27 Apr 2009 19:37:17 -0000 1.76 +++ lams_central/conf/language/lams/ApplicationResources.properties 19 Jun 2009 10:54:17 -0000 1.77 @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Wed Apr 22 17:46:43 CST 2009 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Mon May 11 01:00:44 CST 2009 #=================== labels for LAMS Central =================# @@ -210,6 +210,7 @@ error.user.not.found =Unable to find the username in LAMS. Please check your username and try again. error.support.email.not.set =Email could not be sent. The LAMS server has not been configured to handle emails. Please contact your System Administrator. error.password.request.expired =This request for a new password has expired. Please click the "Forgot your Password" link again to make a new request. +label.required =Required label.forgot.password.instructions.1 =Please enter your user name or email below. An email will be sent to you shortly with a link that will allow you to change your password. You only need to enter one value. label.forgot.password.instructions.2 =If you do not know your email address in LAMS, please contact your System Administrator. label.forgot.password.email =Check Email @@ -235,9 +236,44 @@ index.coursegradebook.tooltip =Open course-wide Gradebook monitoring page index.coursegradebook.learner =My Grades index.coursegradebookmonitor =Mark +label.timezone.title =Time Zone +label.timezone.0 =(GMT -12:00) Eniwetok, Kwajalein +label.timezone.1 =(GMT -11:00) Midway Island, Samoa +label.timezone.2 =(GMT -10:00) Hawaii +label.timezone.3 =(GMT -9:00) Alaska +label.timezone.4 =(GMT -8:00) Pacific Time (US & Canada) +label.timezone.5 =(GMT -7:00) Mountain Time (US & Canada) +label.timezone.6 =(GMT -6:00) Central Time (US & Canada), Mexico City +label.timezone.7 =(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima +label.timezone.8 =(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz +label.timezone.9 =(GMT -3:30) Newfoundland +label.timezone.10 =(GMT -3:00) Brazil, Buenos Aires, Georgetown +label.timezone.11 =(GMT -2:00) Mid-Atlantic +label.timezone.12 =(GMT -1:00 hour) Azores, Cape Verde Islands +label.timezone.13 =(GMT) Western Europe Time, London, Lisbon, Casablanca +label.timezone.14 =(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris +label.timezone.15 =(GMT +2:00) Kaliningrad, South Africa +label.timezone.16 =(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg +label.timezone.17 =(GMT +3:30) Tehran +label.timezone.18 =(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi +label.timezone.19 =(GMT +4:30) Kabul +label.timezone.20 =(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent +label.timezone.21 =(GMT +5:30) Bombay, Calcutta, Madras, New Delhi +label.timezone.22 =(GMT +5:45) Kathmandu +label.timezone.23 =(GMT +6:00) Almaty, Dhaka, Colombo +label.timezone.24 =(GMT +7:00) Bangkok, Hanoi, Jakarta +label.timezone.25 =(GMT +8:00) Beijing, Perth, Singapore, Hong Kong +label.timezone.26 =(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk +label.timezone.27 =(GMT +9:30) Adelaide, Darwin +label.timezone.28 =(GMT +10:00) Eastern Australia, Guam, Vladivostok +label.timezone.29 =(GMT +11:00) Magadan, Solomon Islands, New Caledonia +label.timezone.30 =(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka +title.import.lamscommunity =Import from lamscommunity.org +label.lamscommunity.notRegistered.1 =Your server is not registered with the LAMS Community so you can not seamlessly import sequences directly into your LAMS server from the community. Ask your system administrator to enable this feature. +label.lamscommunity.notRegistered.2 =However, you can download and import the sequences manually from the LAMS Community website: +label.lamscommunity.info =The LAMS Community is a global online community for all teachers, administrators and developers that use LAMS. Within the various sub-communities, you can access the latest news about LAMS, many different discussion forums, and a repository of shared LAMS sequences. - - +# planner stuff index.planner =Planner planner.title =Pedagogical Planner label.description =Description @@ -321,36 +357,11 @@ label.planner.export.sequence=Export sequence error.planner.export.template=There was an error while exporting the template. -label.timezone.title=Time Zone -label.timezone.0=(GMT -12:00) Eniwetok, Kwajalein -label.timezone.1=(GMT -11:00) Midway Island, Samoa -label.timezone.2=(GMT -10:00) Hawaii -label.timezone.3=(GMT -9:00) Alaska -label.timezone.4=(GMT -8:00) Pacific Time (US & Canada) -label.timezone.5=(GMT -7:00) Mountain Time (US & Canada) -label.timezone.6=(GMT -6:00) Central Time (US & Canada), Mexico City -label.timezone.7=(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima -label.timezone.8=(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz -label.timezone.9=(GMT -3:30) Newfoundland -label.timezone.10=(GMT -3:00) Brazil, Buenos Aires, Georgetown -label.timezone.11=(GMT -2:00) Mid-Atlantic -label.timezone.12=(GMT -1:00 hour) Azores, Cape Verde Islands -label.timezone.13=(GMT) Western Europe Time, London, Lisbon, Casablanca -label.timezone.14=(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris -label.timezone.15=(GMT +2:00) Kaliningrad, South Africa -label.timezone.16=(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg -label.timezone.17=(GMT +3:30) Tehran -label.timezone.18=(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi -label.timezone.19=(GMT +4:30) Kabul -label.timezone.20=(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent -label.timezone.21=(GMT +5:30) Bombay, Calcutta, Madras, New Delhi -label.timezone.22=(GMT +5:45) Kathmandu -label.timezone.23=(GMT +6:00) Almaty, Dhaka, Colombo -label.timezone.24=(GMT +7:00) Bangkok, Hanoi, Jakarta -label.timezone.25=(GMT +8:00) Beijing, Perth, Singapore, Hong Kong -label.timezone.26=(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk -label.timezone.27=(GMT +9:30) Adelaide, Darwin -label.timezone.28=(GMT +10:00) Eastern Australia, Guam, Vladivostok -label.timezone.29=(GMT +11:00) Magadan, Solomon Islands, New Caledonia -label.timezone.30=(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka -#======= End labels: Exported 229 labels for en AU ===== +label.planner.tutorial.video=Introduction to Pedagogical Planner +label.tutorial.video.never.show.again=Do not show this again + +label.planner.tutorial.video.show=Show tutorial video: Introduction to Pedagogical Planner +label.tutorial.enabled=Automatically open help assistants. If this option is No, then no online help assistants will be opened. +label.tutorial.disable.single=You have chosen not to show this video again. You can always play it using the video icon in the right upper corner of the page. +label.tutorial.disable.all=Welcome to LAMS! As a new user, you might want to spend a few minutes looking at the new online assistant animations and videos to help you get the most out of LAMS. You can turn this option off if you are an experience LAMS user. If you are new to LAMS, we recommend that you leave this on to get contextual help. Do you want to to leave this option on? +#======= End labels: Exported 266 labels for en AU ===== Index: lams_central/conf/xdoclet/struts-forms.xml =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/xdoclet/struts-forms.xml,v diff -u -r1.9 -r1.10 --- lams_central/conf/xdoclet/struts-forms.xml 27 Apr 2009 19:37:17 -0000 1.9 +++ lams_central/conf/xdoclet/struts-forms.xml 19 Jun 2009 10:54:17 -0000 1.10 @@ -37,6 +37,7 @@ + Index: lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java,v diff -u -r1.49 -r1.50 --- lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java 26 Feb 2009 19:20:10 -0000 1.49 +++ lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java 19 Jun 2009 10:54:17 -0000 1.50 @@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; @@ -41,10 +42,13 @@ import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.usermanagement.Role; import org.lamsfoundation.lams.usermanagement.User; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.session.SessionManager; +import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -92,6 +96,19 @@ setHeaderLinks(request); setAdminLinks(request); + // check if this is user's first login; some action (like displaying a dialog for disabling tutorials) can be + // taken based on that parameter; immediatelly, the value in DB is updated + HttpSession ss = SessionManager.getSession(); + UserDTO userDTO = (UserDTO) ss.getAttribute(AttributeNames.USER); + if (userDTO.isFirstLogin()) { + request.setAttribute("firstLogin", true); + User user = getUserManagementService().getUserByLogin(userDTO.getLogin()); + user.setFirstLogin(false); + getUserManagementService().save(user); + ss.removeAttribute(AttributeNames.USER); + ss.setAttribute(AttributeNames.USER, user.getUserDTO()); + } + // check if user is flagged as needing to change their password User loggedInUser = getUserManagementService().getUserByLogin(request.getRemoteUser()); if (loggedInUser.getChangePassword() != null) { @@ -118,6 +135,9 @@ } else if (StringUtils.equals(tab, "lessons")) { return mapping.findForward("lessons"); } else if (StringUtils.equals(tab, "community")) { + + String comLoginUrl = Configuration.get(ConfigurationKeys.SERVER_URL) + "/lamsCommunityLogin.do"; + request.setAttribute("comLoginUrl", comLoginUrl); request.setAttribute("tab", tab); return mapping.findForward("community"); } @@ -153,7 +173,8 @@ } headerLinks.add(new IndexLinkBean("index.myprofile", "index.do?tab=profile")); - if (Configuration.getAsBoolean(ConfigurationKeys.LAMS_COMMUNITY_ENABLE)) { + Registration reg = Configuration.getRegistration(); + if (reg != null) { if (request.isUserInRole(Role.SYSADMIN) || request.isUserInRole(Role.GROUP_ADMIN) || request.isUserInRole(Role.GROUP_MANAGER) || request.isUserInRole(Role.AUTHOR) || request.isUserInRole(Role.AUTHOR_ADMIN) || request.isUserInRole(Role.MONITOR)) { Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java,v diff -u -r1.18 -r1.19 --- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java 25 Mar 2009 20:35:03 -0000 1.18 +++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java 19 Jun 2009 10:54:18 -0000 1.19 @@ -220,6 +220,9 @@ private static final Map filterLanguageMap = new TreeMap(); private static final Map filterStopWordsMap = new TreeMap(); + // Tutorial video page string for recognising which page the video was started from + private static final String PAGE_STRING_START_PLANNER = "StPed"; + static { PedagogicalPlannerAction.filterLanguageMap.put("en", "English"); PedagogicalPlannerAction.filterLanguageMap.put("nl", "Dutch"); @@ -246,6 +249,19 @@ */ public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + + // First we check if a tutorial video should be displayed + HttpSession session = SessionManager.getSession(); + UserDTO userDto = (UserDTO) session.getAttribute(AttributeNames.USER); + + boolean doNotShowAgain = userDto.getPagesWithDisabledTutorials() != null + && userDto.getPagesWithDisabledTutorials().contains(PedagogicalPlannerAction.PAGE_STRING_START_PLANNER); + boolean showTutorial = !(userDto.getTutorialsDisabled() || doNotShowAgain); + + request.setAttribute(AttributeNames.ATTR_PAGE_STR, PedagogicalPlannerAction.PAGE_STRING_START_PLANNER); + request.setAttribute(AttributeNames.ATTR_SHOW_TUTORIAL, showTutorial); + request.setAttribute(AttributeNames.ATTR_DO_NOT_SHOW_AGAIN, doNotShowAgain); + return openSequenceNode(mapping, form, request, response); } @@ -561,7 +577,8 @@ getMonitoringService().startLesson(lesson.getLessonId(), userDto.getUserID()); String newPath = mapping.findForward(PedagogicalPlannerAction.FORWARD_PREVIEW).getPath(); newPath = newPath + PedagogicalPlannerAction.CHAR_AMPERSAND + AttributeNames.PARAM_LESSON_ID - + PedagogicalPlannerAction.CHAR_EQUALS + lesson.getLessonId(); + + PedagogicalPlannerAction.CHAR_EQUALS + lesson.getLessonId() + PedagogicalPlannerAction.CHAR_AMPERSAND + + AttributeNames.PARAM_MODE + PedagogicalPlannerAction.CHAR_EQUALS + "preview"; return new ActionForward(newPath, true); } Index: lams_central/web/editprofile.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/editprofile.jsp,v diff -u -r1.15 -r1.16 --- lams_central/web/editprofile.jsp 27 Apr 2009 19:37:17 -0000 1.15 +++ lams_central/web/editprofile.jsp 19 Jun 2009 10:54:17 -0000 1.16 @@ -139,6 +139,20 @@ + + : + + + + + + + + + @@ -269,6 +283,18 @@ + + : + + + + + + + Index: lams_central/web/main.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/main.jsp,v diff -u -r1.40 -r1.41 --- lams_central/web/main.jsp 31 Mar 2009 03:18:12 -0000 1.40 +++ lams_central/web/main.jsp 19 Jun 2009 10:54:17 -0000 1.41 @@ -34,7 +34,7 @@ - + @@ -49,6 +49,15 @@ initLoadGroup(this, 13, display); }); + <%-- If it's the user's first login, display a dialog asking if tutorial videos should be shown --%> + + + + + if (!confirm("")){ + $.get("${disableAllTutorialVideosUrl}"); + } + }); function getEnableSortingText() { Index: lams_central/web/css/pedagogicalPlanner.css =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/css/pedagogicalPlanner.css,v diff -u -r1.10 -r1.11 --- lams_central/web/css/pedagogicalPlanner.css 29 Mar 2009 23:58:15 -0000 1.10 +++ lams_central/web/css/pedagogicalPlanner.css 19 Jun 2009 10:54:17 -0000 1.11 @@ -170,3 +170,19 @@ border-bottom: 0px; } +a#tutorialVideoHref { + margin: 5px; + border: none; + color: inherit; + float: right; +} + +a#tutorialVideoHref:hover { + border: none; + color: inherit; + cursor: pointer; +} + +img#tutorialVideoImg { + border: none; +} \ No newline at end of file Index: lams_central/web/includes/javascript/thickbox.patched.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/Attic/thickbox.patched.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/web/includes/javascript/thickbox.patched.js 19 Jun 2009 10:54:17 -0000 1.1 @@ -0,0 +1,342 @@ +/* + * Thickbox 3.1 - One Box To Rule Them All. + * By Cody Lindley (http://www.codylindley.com) + * Copyright (c) 2007 cody lindley + * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php +*/ + +var tb_pathToImage = pathToImageFolder + "loadingAnimation.gif"; + +// fixed according to: http://jamazon.co.uk/web/2008/03/14/jquerybrowserversion-doesnt-recognise-ie7/ +$.browser.msie6 = +$.browser.msie +&& /MSIE 6\.0/i.test(window.navigator.userAgent) +&& !/MSIE 7\.0/i.test(window.navigator.userAgent) +&& !/MSIE 8\.0/i.test(window.navigator.userAgent); + +/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ + +//on page load call tb_init +$(document).ready(function(){ + tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox + imgLoader = new Image();// preload image + imgLoader.src = tb_pathToImage; +}); + +//add thickbox to href & area elements that have a class of .thickbox +function tb_init(domChunk){ + $(domChunk).click(function(){ + var t = this.title || this.name || null; + var a = this.href || this.alt; + var g = this.rel || false; + tb_show(t,a,g); + this.blur(); + return false; + }); +} + +function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link + + try { + if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 + $("body","html").css({height: "100%", width: "100%"}); + $("html").css("overflow","hidden"); + if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 + $("body").append("
"); + $("#TB_overlay").click(tb_remove); + } + }else{//all others + if(document.getElementById("TB_overlay") === null){ + $("body").append("
"); + $("#TB_overlay").click(tb_remove); + } + } + + if(tb_detectMacXFF()){ + $("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash + }else{ + $("#TB_overlay").addClass("TB_overlayBG");//use background and opacity + } + + if(caption===null){caption="";} + $("body").append("
");//add loader to the page + $('#TB_load').show();//show loader + + var baseURL; + if(url.indexOf("?")!==-1){ //ff there is a query string involved + baseURL = url.substr(0, url.indexOf("?")); + }else{ + baseURL = url; + } + + var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; + var urlType = baseURL.toLowerCase().match(urlString); + + var queryString = url.replace(/^[^\?]+\??/,''); + var params = tb_parseQuery( queryString ); + + + if((!params['TB_iframe'])){//code to show images + + TB_PrevCaption = ""; + TB_PrevURL = ""; + TB_PrevHTML = ""; + TB_NextCaption = ""; + TB_NextURL = ""; + TB_NextHTML = ""; + TB_imageCount = ""; + TB_FoundURL = false; + if(imageGroup){ + TB_TempArray = $("a[@rel="+imageGroup+"]").get(); + for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { + var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); + if (!(TB_TempArray[TB_Counter].href == url)) { + if (TB_FoundURL) { + TB_NextCaption = TB_TempArray[TB_Counter].title; + TB_NextURL = TB_TempArray[TB_Counter].href; + TB_NextHTML = "  Next >"; + } else { + TB_PrevCaption = TB_TempArray[TB_Counter].title; + TB_PrevURL = TB_TempArray[TB_Counter].href; + TB_PrevHTML = "  < Prev"; + } + } else { + TB_FoundURL = true; + TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length); + } + } + } + + imgPreloader = new Image(); + imgPreloader.onload = function(){ + imgPreloader.onload = null; + + // Resizing large images - orginal by Christian Montoya edited by me. + var pagesize = tb_getPageSize(); + var x = pagesize[0] - 150; + var y = pagesize[1] - 150; + var imageWidth = (jQuery.browser.msie) ? parseInt(params['dbWidth']) : imgPreloader.width; + var initialImageWidth = imageWidth; + var imageHeight = (jQuery.browser.msie) ? parseInt(params['dbHeight']) : imgPreloader.height; + var initialImageHeight = imageHeight; + if (imageWidth > x) { + imageHeight = imageHeight * (x / imageWidth); + imageWidth = x; + if (imageHeight > y) { + imageWidth = imageWidth * (y / imageHeight); + imageHeight = y; + } + } else if (imageHeight > y) { + imageWidth = imageWidth * (y / imageHeight); + imageHeight = y; + if (imageWidth > x) { + imageHeight = imageHeight * (x / imageWidth); + imageWidth = x; + } + } + // End Resizing + + TB_WIDTH = imageWidth + 30; + TB_HEIGHT = imageHeight + 60; + + if ((initialImageWidth > x) ||(initialImageHeight > y)) { + $("#TB_window").append("" + "
"+caption+"
" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
close or Esc Key
"); + } else { + $("#TB_window").append(""+caption+"" + "
"+caption+"
" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "
close or Esc Key
"); + } + + $("#TB_closeWindowButton").click(tb_remove); + + if (!(TB_PrevHTML === "")) { + function goPrev(){ + if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);} + $("#TB_window").remove(); + $("body").append("
"); + tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); + return false; + } + $("#TB_prev").click(goPrev); + } + + if (!(TB_NextHTML === "")) { + function goNext(){ + $("#TB_window").remove(); + $("body").append("
"); + tb_show(TB_NextCaption, TB_NextURL, imageGroup); + return false; + } + $("#TB_next").click(goNext); + + } + + document.onkeydown = function(e){ + if (e == null) { // ie + keycode = event.keyCode; + } else { // mozilla + keycode = e.which; + } + if(keycode == 27){ // close + tb_remove(); + } else if(keycode == 190){ // display previous image + if(!(TB_NextHTML == "")){ + document.onkeydown = ""; + goNext(); + } + } else if(keycode == 188){ // display next image + if(!(TB_PrevHTML == "")){ + document.onkeydown = ""; + goPrev(); + } + } + }; + + tb_position(); + $("#TB_load").remove(); + $("#TB_ImageOff").click(tb_remove); + $("#TB_window").css({display:"block"}); //for safari using css instead of show + }; + + imgPreloader.src = url; + }else{//code to show html + + TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL + TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL + ajaxContentW = TB_WIDTH - 30; + ajaxContentH = TB_HEIGHT - 45; + + if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window + urlNoQuery = url.split('TB_'); + $("#TB_iframeContent").remove(); + + var resize = ""; + if(params['resizeIframe']){ + resize = "resizeIframe();" + } + if(params['modal'] != "true"){//iframe no modal + $("#TB_window").append("
"+caption+"
close or Esc Key
"); + }else{//iframe modal + $("#TB_overlay").unbind(); + $("#TB_window").append(""); + } + }else{// not an iframe, ajax + if($("#TB_window").css("display") != "block"){ + if(params['modal'] != "true"){//ajax no modal + $("#TB_window").append("
"+caption+"
close or Esc Key
"); + }else{//ajax modal + $("#TB_overlay").unbind(); + $("#TB_window").append("
"); + } + }else{//this means the window is already up, we are just loading new content via ajax + $("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; + $("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; + $("#TB_ajaxContent")[0].scrollTop = 0; + $("#TB_ajaxWindowTitle").html(caption); + } + } + + $("#TB_closeWindowButton").click(tb_remove); + + if(url.indexOf('TB_inline') != -1){ + $("#TB_ajaxContent").append($('#' + params['inlineId']).children()); + $("#TB_window").unload(function () { + $('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished + }); + tb_position(); + $("#TB_load").remove(); + $("#TB_window").css({display:"block"}); + }else if(url.indexOf('TB_iframe') != -1){ + tb_position(); + if($.browser.safari){//safari needs help because it will not fire iframe onload + $("#TB_load").remove(); + $("#TB_window").css({display:"block"}); + } + }else{ + $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method + tb_position(); + $("#TB_load").remove(); + tb_init("#TB_ajaxContent a.thickbox"); + $("#TB_window").css({display:"block"}); + }); + } + + } + + if(!params['modal']){ + document.onkeyup = function(e){ + if (e == null) { // ie + keycode = event.keyCode; + } else { // mozilla + keycode = e.which; + } + if(keycode == 27){ // close + tb_remove(); + } + }; + } + + } catch(e) { + //nothing here + } +} + +//helper functions below +function tb_showIframe(){ + $("#TB_load").remove(); + $("#TB_window").css({display:"block"}); +} + +function tb_remove() { + $("#TB_imageOff").unbind("click"); + $("#TB_closeWindowButton").unbind("click"); + $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();}); + $("#TB_load").remove(); + if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 + $("body","html").css({height: "auto", width: "auto"}); + $("html").css("overflow",""); + } + document.onkeydown = ""; + document.onkeyup = ""; + return false; +} + +function tb_position() { + jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); + var version = jQuery.browser.version; + if (version instanceof Object) + version=version.number(); + if ( !(jQuery.browser.msie6)) { // take away IE6; fixed according to: http://jamazon.co.uk/web/2008/03/14/jquerybrowserversion-doesnt-recognise-ie7/ + $("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); + } +} + +function tb_parseQuery ( query ) { + var Params = {}; + if ( ! query ) {return Params;}// return empty object + var Pairs = query.split(/[;&]/); + for ( var i = 0; i < Pairs.length; i++ ) { + var KeyVal = Pairs[i].split('='); + if ( ! KeyVal || KeyVal.length != 2 ) {continue;} + var key = unescape( KeyVal[0] ); + var val = unescape( KeyVal[1] ); + val = val.replace(/\+/g, ' '); + Params[key] = val; + } + return Params; +} + +function tb_getPageSize(){ + var de = document.documentElement; + var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; + var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; + arrayPageSize = [w,h]; + return arrayPageSize; +} + +function tb_detectMacXFF() { + var userAgent = navigator.userAgent.toLowerCase(); + if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { + return true; + } +} + + Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/usermanagement/User.hbm.xml =================================================================== RCS file: /usr/local/cvsroot/lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/usermanagement/User.hbm.xml,v diff -u -r1.28 -r1.29 --- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/usermanagement/User.hbm.xml 27 Apr 2009 19:36:58 -0000 1.28 +++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/usermanagement/User.hbm.xml 19 Jun 2009 10:50:33 -0000 1.29 @@ -543,7 +543,37 @@ not-null="false" + + + @hibernate.property + column="tutorials_disabled" + length="1" + + + + + @hibernate.property + column="first_login" + length="1" + + + + + + + + Index: lams_common/db/sql/create_lams_11_tables.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/create_lams_11_tables.sql,v diff -u -r1.140 -r1.141 --- lams_common/db/sql/create_lams_11_tables.sql 27 Apr 2009 19:36:57 -0000 1.140 +++ lams_common/db/sql/create_lams_11_tables.sql 19 Jun 2009 10:50:33 -0000 1.141 @@ -322,6 +322,8 @@ , lams_community_token VARCHAR(255) , lams_community_username VARCHAR(255) , timezone TINYINT + , tutorials_disabled TINYINT(1) DEFAULT 0 + , first_login TINYINT(1) DEFAULT 1 , PRIMARY KEY (user_id) , INDEX (authentication_method_id) , CONSTRAINT FK_lams_user_1 FOREIGN KEY (authentication_method_id) @@ -1134,3 +1136,10 @@ , PRIMARY KEY (uid) )TYPE=InnoDB; +CREATE TABLE lams_user_disabled_tutorials ( + user_id BIGINT(20) NOT NULL + , page_str CHAR(5) NOT NULL + , CONSTRAINT FK_lams_user_disabled_tutorials_1 FOREIGN KEY (user_id) + REFERENCES lams_user (user_id) ON DELETE CASCADE ON UPDATE CASCADE + , PRIMARY KEY (user_id,page_str) +)TYPE=InnoDB; \ No newline at end of file Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java,v diff -u -r1.38 -r1.39 --- lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java 28 Apr 2009 08:57:41 -0000 1.38 +++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java 19 Jun 2009 10:50:34 -0000 1.39 @@ -21,6 +21,7 @@ * **************************************************************** */ /* $$Id$$ */ + package org.lamsfoundation.lams.usermanagement; import java.io.Serializable; @@ -161,12 +162,21 @@ /** persistent field */ private String lamsCommunityUsername; + /** persistent field */ + private Boolean tutorialsDisabled; + + /** persistent field */ + private Set pagesWithDisabledTutorials = new HashSet(); + + /** persistent field - latch */ + private Boolean firstLogin; + // ------- TIMEZONES (hardcoded, there is no need to put them into database -------------- public static String[] timezoneList = new String[] { "GMT-12", "GMT-11", "GMT-10", "GMT-9", "GMT-8", "GMT-7", - "GMT-6", "GMT-5", "GMT-4", "Canada/Newfoundland", "GMT-3", "GMT-2", "GMT-1", "GMT", "GMT+1", "GMT+2", - "GMT+3", "Asia/Tehran", "GMT+4", "Asia/Kabul", "GMT+5", "Asia/Calcutta", "Asia/Katmandu", "GMT+6", "GMT+7", - "GMT+8", "GMT+9", "Australia/Adelaide", "GMT+10", "GMT+11", "GMT+12" }; + "GMT-6", "GMT-5", "GMT-4", "GMT-3:30", "GMT-3", "GMT-2", "GMT-1", "GMT", "GMT+1", "GMT+2", "GMT+3", + "GMT+3:30", "GMT+4", "GMT+4:30", "GMT+5", "GMT+5:30", "GMT+5:45", "GMT+6", "GMT+7", "GMT+8", "GMT+9", + "GMT+9:30", "GMT+10", "GMT+11", "GMT+12" }; /** full constructor */ public User(String login, String password, String title, String firstName, String lastName, String addressLine1, @@ -670,11 +680,14 @@ TimeZone tz = TimeZone.getTimeZone(User.timezoneList[getTimeZone()]); + Set tutorialPages = pagesWithDisabledTutorials == null || pagesWithDisabledTutorials.isEmpty() ? null + : pagesWithDisabledTutorials; + return new UserDTO(userId, firstName, lastName, login, languageIsoCode, countryIsoCode, direction, email, new CSSThemeBriefDTO(flashTheme), new CSSThemeBriefDTO(htmlTheme), // TimeZone.getTimeZone("Australia/Sydney"), tz, authenticationMethod.getAuthenticationMethodId(), fckLanguageMapping, enableFlash, - lamsCommunityToken, lamsCommunityUsername); + lamsCommunityToken, lamsCommunityUsername, tutorialsDisabled, tutorialPages, firstLogin); } public UserFlashDTO getUserFlashDTO() { @@ -847,4 +860,40 @@ this.timeZone = timeZone; } + /** + * @hibernate.property column="tutorials_disabled" length="1" + * + */ + public Boolean getTutorialsDisabled() { + return tutorialsDisabled; + } + + public void setTutorialsDisabled(Boolean tutorialsDisabled) { + this.tutorialsDisabled = tutorialsDisabled; + } + + /** + * @hibernate.set lazy="false" cascade="all-delete-orphan" + * @hibernate.collection-key column="user_id" + * @hibernate.collection-element column="page_str" type="string" length="5" not-null="true" + */ + public Set getPagesWithDisabledTutorials() { + return pagesWithDisabledTutorials; + } + + public void setPagesWithDisabledTutorials(Set pagesWithDisabledTutorials) { + this.pagesWithDisabledTutorials = pagesWithDisabledTutorials; + } + + /** + * @hibernate.property column="first_login" length="1" + * + */ + public Boolean isFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(Boolean firstLogin) { + this.firstLogin = firstLogin; + } } \ No newline at end of file Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/dto/UserDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/usermanagement/dto/UserDTO.java,v diff -u -r1.20 -r1.21 --- lams_common/src/java/org/lamsfoundation/lams/usermanagement/dto/UserDTO.java 27 Apr 2009 19:36:58 -0000 1.20 +++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/dto/UserDTO.java 19 Jun 2009 10:50:33 -0000 1.21 @@ -23,6 +23,7 @@ /* $$Id$$ */ package org.lamsfoundation.lams.usermanagement.dto; +import java.util.Set; import java.util.TimeZone; import org.apache.commons.lang.builder.ToStringBuilder; @@ -51,21 +52,25 @@ private String lamsCommunityToken; private String lamsCommunityUsername; private Boolean loggedIntoLamsCommunity; + private Boolean tutorialsDisabled; + private Set pagesWithDisabledTutorials; + private Boolean firstLogin; - // public UserDTO(Integer userID, String firstName, String lastName, - // String login, String email, CSSThemeVisualElement theme) { - // this.userID = userID; - // this.firstName = firstName; - // this.lastName = lastName; - // this.login = login; - // this.email = email; - // this.theme = theme; - // } + // public UserDTO(Integer userID, String firstName, String lastName, + // String login, String email, CSSThemeVisualElement theme) { + // this.userID = userID; + // this.firstName = firstName; + // this.lastName = lastName; + // this.login = login; + // this.email = email; + // this.theme = theme; + // } public UserDTO(Integer userID, String firstName, String lastName, String login, String localeLanguage, String localeCountry, String direction, String email, CSSThemeBriefDTO flashTheme, CSSThemeBriefDTO htmlTheme, TimeZone timezone, Integer authenticationMethodId, String fckLanguageMapping, - Boolean enableFlash, String lamsCommunityToken, String lamsCommunityUsername) { + Boolean enableFlash, String lamsCommunityToken, String lamsCommunityUsername, Boolean tutorialsDisabled, + Set pagesWithDisabledTutorials, Boolean firstLogin) { this.userID = userID; this.firstName = firstName; this.lastName = lastName; @@ -76,20 +81,24 @@ this.email = email; this.flashTheme = flashTheme; this.htmlTheme = htmlTheme; - this.timeZone = timezone; + timeZone = timezone; this.authenticationMethodId = authenticationMethodId; this.fckLanguageMapping = fckLanguageMapping; this.enableFlash = enableFlash; this.lamsCommunityToken = lamsCommunityToken; this.lamsCommunityUsername = lamsCommunityUsername; + this.tutorialsDisabled = tutorialsDisabled; + this.pagesWithDisabledTutorials = pagesWithDisabledTutorials; + this.firstLogin = firstLogin; } /** * Equality test of UserDTO objects */ + @Override public boolean equals(Object o) { - if ((o != null) && (o.getClass() == this.getClass())) { - return ((UserDTO) o).userID == this.userID; + if (o != null && o.getClass() == this.getClass()) { + return ((UserDTO) o).userID == userID; } else { return false; } @@ -98,8 +107,9 @@ /** * Returns the hash code value for this object. */ + @Override public int hashCode() { - // TODO this might be an ineffcient implementation since userIDs are likely to be sequential, + // TODO this might be an ineffcient implementation since userIDs are likely to be sequential, // hence we dont get a good spread of values return userID.intValue(); } @@ -174,6 +184,7 @@ return authenticationMethodId; } + @Override public String toString() { return new ToStringBuilder(this).append("userID", getUserID()).append("firstName", getFirstName()).append( "lastName", getLastName()).append("login", getLogin()).append("localeLanguage", getLocaleLanguage()) @@ -183,7 +194,8 @@ .append("fckLanguageMapping", getFckLanguageMapping()).append("enableFlash", getEnableFlash()).append( "lamsCommunityUser", this.getLamsCommunityUsername()).append("lamsCommunityToken", this.getLamsCommunityToken()).append("loggedIntoLamsCommunity", - "" + this.getLoggedIntoLamsCommunity()).toString(); + "" + this.getLoggedIntoLamsCommunity()) + .append("tutorialsDisabled", "" + getTutorialsDisabled()).toString(); } public String getFckLanguageMapping() { @@ -222,12 +234,32 @@ this.loggedIntoLamsCommunity = loggedIntoLamsCommunity; } - // public CSSThemeVisualElement getTheme() { - // return theme; - // } + public Boolean getTutorialsDisabled() { + return tutorialsDisabled; + } + + public void setTutorialsDisabled(Boolean tutorialsDisabled) { + this.tutorialsDisabled = tutorialsDisabled; + } + + public Set getPagesWithDisabledTutorials() { + return pagesWithDisabledTutorials; + } + + public void setPagesWithDisabledTutorials(Set pagesWithDisabledTutorials) { + this.pagesWithDisabledTutorials = pagesWithDisabledTutorials; + } + + public Boolean isFirstLogin() { + return firstLogin; + } + + // public CSSThemeVisualElement getTheme() { + // return theme; + // } // - // public void setTheme(CSSThemeVisualElement theme) { - // this.theme = theme; - // } + // public void setTheme(CSSThemeVisualElement theme) { + // this.theme = theme; + // } } Index: lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java,v diff -u -r1.28 -r1.29 --- lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java 31 Mar 2009 03:32:50 -0000 1.28 +++ lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java 19 Jun 2009 10:50:33 -0000 1.29 @@ -88,4 +88,9 @@ public static final String COMMAND_GET_EDITING_ADVICE = "getEditingAdvice"; public static final String COMMAND_CHECK_EDITING_ADVICE = "checkEditingAdvice"; public static final String PARAM_ACTIVITY_INDEX = "activityIndex"; -} + + // for tutorial videos + public static final String ATTR_PAGE_STR = "pageString"; + public static final String ATTR_DO_NOT_SHOW_AGAIN = "doNotShowAgain"; + public static final String ATTR_SHOW_TUTORIAL = "showTutorial"; +} \ No newline at end of file Index: lams_learning/web/mainnoflash.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/Attic/mainnoflash.jsp,v diff -u -r1.10 -r1.11 --- lams_learning/web/mainnoflash.jsp 1 Apr 2009 00:44:23 -0000 1.10 +++ lams_learning/web/mainnoflash.jsp 19 Jun 2009 10:50:44 -0000 1.11 @@ -34,7 +34,7 @@ - + - - + + - - + - + - - + + - - + +