Index: temp_moodle_dev/.project =================================================================== diff -u --- temp_moodle_dev/.project (revision 0) +++ temp_moodle_dev/.project (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,11 @@ + + + temp_moodle_dev + + + + + + + + Index: temp_moodle_dev/lamstwo.php =================================================================== diff -u --- temp_moodle_dev/lamstwo.php (revision 0) +++ temp_moodle_dev/lamstwo.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,60 @@ +Select one and click on the next button to continue.'; +$string['confirm'] = 'Confirm the lesson details.'; +$string['confirmExplanation'] = 'By pressing on the Start button you can begin the lesson straight away.
You can also schedule the lesson to start at a particular date and time.'; +$string['next'] = 'Next'; +$string['prev'] = 'Prev'; +$string['schedule'] = 'Schedule'; +$string['date'] = 'Date'; +$string['time'] = 'Time(Hours:Minutes)'; +$string['startnow'] = 'Start Now'; +$string['startlater'] = 'Start Later'; +$string['am'] = 'AM'; +$string['pm'] = 'PM'; +$string['sequenceNotSelected'] = 'You have to select a sequence to proceed.'; +$string['nameNotSpecified'] = 'You have to specify the activity name to proceed.'; +$string['Jan'] = 'Jan'; +$string['Feb'] = 'Feb'; +$string['Mar'] = 'Mar'; +$string['Apr'] = 'Apr'; +$string['May'] = 'May'; +$string['Jun'] = 'Jun'; +$string['Jul'] = 'Jul'; +$string['Aug'] = 'Aug'; +$string['Sep'] = 'Sep'; +$string['Oct'] = 'Oct'; +$string['Nov'] = 'Nov'; +$string['Dec'] = 'Dec'; +$string['scheduleSequence'] = 'Select your desired date:'; +$string['noPast'] = 'You have to schedule the lesson at some time point in the future!'; +$string['validate'] = 'Validate'; +$string['validating'] = 'Validating'; +$string['notempty'] = 'should not be empty!'; +$string['notvalid'] = 'is not valid. It should start with http:// at least.'; +$string['notvalidatedconfirm'] = 'It seems you have not validated the setting. Are you sure to save them directly?'; +$string['notvalidconfirm'] = 'It seems the setting is not valid. Are you sure to save them?'; +$string['update'] = 'Update the lesson details'; +$string['updateExplanation'] = 'Please change name and description'; + +?> Index: temp_moodle_dev/lamstwo/calendar.css =================================================================== diff -u --- temp_moodle_dev/lamstwo/calendar.css (revision 0) +++ temp_moodle_dev/lamstwo/calendar.css (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,172 @@ +/* +Copyright (c) 2006, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +Version 0.11.0 +*/ + +.yui-cal2upwrapper {height:1%;} /* IE */ +.yui-cal2upwrapper:after {content:'.';clear:both;display:block;visibility:hidden;height:0;} /* others */ + +.yui-calcontainer { + float:left; + padding:5px; + background-color:#F7F9FB; + border:1px solid #7B9EBD; +} + +.yui-calcontainer .title { + font:100% sans-serif; + color:#000; + font-weight:bold; + margin-bottom:5px; + height:auto; + width:304px; + position:relative; +} + +.yui-calcontainer .title .close-icon { + position:absolute; + right:0; + top:0; + border:none; +} + +.yui-calcontainer .cal2up { + float:left; +} + +.yui-calendar .calnavleft { + position:absolute; + background-repeat:no-repeat; + cursor:pointer; + top:2px; + bottom:0; + width:9px; + height:12px; + left:2px; +} + +.yui-calendar .calnavright { + position:absolute; + background-repeat:no-repeat; + cursor:pointer; + top:2px; + bottom:0; + width:9px; + height:12px; + right:2px; +} + +/* Calendar element styles */ + +.yui-calendar { + font:100% sans-serif; + text-align:center; + border-spacing:0; + border-collapse:separate; +} + +.yui-calendar td.calcell { + width:1.5em; + height:1em; + border:1px solid #E0E0E0; + background-color:#FFF; +} + +.yui-calendar td.calcell a { + color:#003DB8; + text-decoration:none; +} + +.yui-calendar td.calcell.today { + border:1px solid #000; +} + +.yui-calendar td.calcell.oom { + cursor:default; + color:#999; + background-color:#EEE; + border:1px solid #E0E0E0; +} + +.yui-calendar td.calcell.selected { + color:#003DB8; + background-color:#FFF19F; + border:1px solid #FF9900; +} + +.yui-calendar td.calcell.calcellhover { + cursor:pointer; + color:#FFF; + background-color:#FF9900; + border:1px solid #FF9900; +} + +/* Added to perform some correction for Opera 8.5 + hover redraw bug */ +table.yui-calendar:hover { + background-color:#FFF; +} + +.yui-calendar td.calcell.calcellhover a { + color:#FFF; +} + +.yui-calendar td.calcell.restricted { + text-decoration:line-through; +} + +.yui-calendar td.calcell.previous { + color:#CCC; +} + +.yui-calendar td.calcell.highlight1 { background-color:#CCFF99; } +.yui-calendar td.calcell.highlight2 { background-color:#99CCFF; } +.yui-calendar td.calcell.highlight3 { background-color:#FFCCCC; } +.yui-calendar td.calcell.highlight4 { background-color:#CCFF99; } + + +.yui-calendar .calhead { + border:1px solid #E0E0E0; + vertical-align:middle; + background-color:#FFF; +} + +.yui-calendar .calheader { + position:relative; + width:100%; + text-align:center; +} + +.yui-calendar .calheader img { + border:none; +} + +.yui-calendar .calweekdaycell { + color:#666; + font-weight:normal; +} + +.yui-calendar .calfoot { + background-color:#EEE; +} + +.yui-calendar .calrowhead, .yui-calendar .calrowfoot { + color:#666; + font-size:9px; + font-style:italic; + font-weight:normal; + width:15px; +} + +.yui-calendar .calrowhead { + border-right-width:2px; +} + +/*Specific changes for calendar running under fonts/reset */ +.yui-calendar a:hover {background:inherit;} +p#clear {clear:left; padding-top:10px;} + +#container1 {font-family:arial,helvetica,clean,sans-serif; font-size:small;} +table {font-size:inherit;font:100%;} Index: temp_moodle_dev/lamstwo/calendar.js =================================================================== diff -u --- temp_moodle_dev/lamstwo/calendar.js (revision 0) +++ temp_moodle_dev/lamstwo/calendar.js (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,155 @@ +/* +Copyright (c) 2006, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 0.11.0 +*/ +YAHOO.widget.DateMath=new function(){this.DAY="D";this.WEEK="W";this.YEAR="Y";this.MONTH="M";this.ONE_DAY_MS=1000*60*60*24;this.add=function(date,field,amount){var d=new Date(date.getTime());switch(field){case this.MONTH:var newMonth=date.getMonth()+amount;var years=0;if(newMonth<0){while(newMonth<0){newMonth+=12;years-=1;}}else if(newMonth>11){while(newMonth>11){newMonth-=12;years+=1;}} +d.setMonth(newMonth);d.setFullYear(date.getFullYear()+years);break;case this.DAY:d.setDate(date.getDate()+amount);break;case this.YEAR:d.setFullYear(date.getFullYear()+amount);break;case this.WEEK:d.setDate(date.getDate()+(amount*7));break;} +return d;};this.subtract=function(date,field,amount){return this.add(date,field,(amount*-1));};this.before=function(date,compareTo){var ms=compareTo.getTime();if(date.getTime()ms){return true;}else{return false;}};this.between=function(date,dateBegin,dateEnd){if(this.after(date,dateBegin)&&this.before(date,dateEnd)){return true;}else{return false;}};this.getJan1=function(calendarYear){return new Date(calendarYear,0,1);};this.getDayOffset=function(date,calendarYear){var beginYear=this.getJan1(calendarYear);var dayOffset=Math.ceil((date.getTime()-beginYear.getTime())/this.ONE_DAY_MS);return dayOffset;};this.getWeekNumber=function(date,calendarYear,weekStartsOn){date.setHours(12,0,0,0);if(!weekStartsOn){weekStartsOn=0;} +if(!calendarYear){calendarYear=date.getFullYear();} +var weekNum=-1;var jan1=this.getJan1(calendarYear);var jan1Offset=jan1.getDay()-weekStartsOn;var jan1DayOfWeek=(jan1Offset>=0?jan1Offset:(7+jan1Offset));var endOfWeek1=this.add(jan1,this.DAY,(6-jan1DayOfWeek));endOfWeek1.setHours(23,59,59,999);var month=date.getMonth();var day=date.getDate();var year=date.getFullYear();var dayOffset=this.getDayOffset(date,calendarYear);if(dayOffset<0||this.before(date,endOfWeek1)){weekNum=1;}else{weekNum=2;var weekBegin=new Date(endOfWeek1.getTime()+1);var weekEnd=this.add(weekBegin,this.WEEK,1);while(!this.between(date,weekBegin,weekEnd)){weekBegin=this.add(weekBegin,this.WEEK,1);weekEnd=this.add(weekEnd,this.WEEK,1);weekNum+=1;}} +return weekNum;};this.isYearOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getFullYear()!=weekBeginDate.getFullYear()){overlaps=true;} +return overlaps;};this.isMonthOverlapWeek=function(weekBeginDate){var overlaps=false;var nextWeek=this.add(weekBeginDate,this.DAY,6);if(nextWeek.getMonth()!=weekBeginDate.getMonth()){overlaps=true;} +return overlaps;};this.findMonthStart=function(date){var start=new Date(date.getFullYear(),date.getMonth(),1);return start;};this.findMonthEnd=function(date){var start=this.findMonthStart(date);var nextMonth=this.add(start,this.MONTH,1);var end=this.subtract(nextMonth,this.DAY,1);return end;};this.clearTime=function(date){date.setHours(0,0,0,0);return date;};} +YAHOO.widget.Calendar_Core=function(id,containerId,monthyear,selected){if(arguments.length>0){this.init(id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar_Core.IMG_ROOT=(window.location.href.toLowerCase().indexOf("https")==0?"https://a248.e.akamai.net/sec.yimg.com/i/":"http://us.i1.yimg.com/us.yimg.com/i/");YAHOO.widget.Calendar_Core.DATE="D";YAHOO.widget.Calendar_Core.MONTH_DAY="MD";YAHOO.widget.Calendar_Core.WEEKDAY="WD";YAHOO.widget.Calendar_Core.RANGE="R";YAHOO.widget.Calendar_Core.MONTH="M";YAHOO.widget.Calendar_Core.DISPLAY_DAYS=42;YAHOO.widget.Calendar_Core.STOP_RENDER="S";YAHOO.widget.Calendar_Core.prototype={Config:null,parent:null,index:-1,cells:null,weekHeaderCells:null,weekFooterCells:null,cellDates:null,id:null,oDomContainer:null,today:null,renderStack:null,_renderStack:null,pageDate:null,_pageDate:null,minDate:null,maxDate:null,selectedDates:null,_selectedDates:null,shellRendered:false,table:null,headerCell:null};YAHOO.widget.Calendar_Core.prototype.init=function(id,containerId,monthyear,selected){this.setupConfig();this.id=id;this.cellDates=new Array();this.cells=new Array();this.renderStack=new Array();this._renderStack=new Array();this.oDomContainer=document.getElementById(containerId);this.today=new Date();YAHOO.widget.DateMath.clearTime(this.today);var month;var year;if(monthyear){var aMonthYear=monthyear.split(this.Locale.DATE_FIELD_DELIMITER);month=parseInt(aMonthYear[this.Locale.MY_MONTH_POSITION-1]);year=parseInt(aMonthYear[this.Locale.MY_YEAR_POSITION-1]);}else{month=this.today.getMonth()+1;year=this.today.getFullYear();} +this.pageDate=new Date(year,month-1,1);this._pageDate=new Date(this.pageDate.getTime());if(selected){this.selectedDates=this._parseDates(selected);this._selectedDates=this.selectedDates.concat();}else{this.selectedDates=new Array();this._selectedDates=new Array();} +this.wireDefaultEvents();this.wireCustomEvents();};YAHOO.widget.Calendar_Core.prototype.wireDefaultEvents=function(){this.doSelectCell=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){if(cal.Options.MULTI_SELECT){var link=cell.getElementsByTagName("A")[0];link.blur();var cellDate=cal.cellDates[index];var cellDateIndex=cal._indexOfSelectedFieldArray(cellDate);if(cellDateIndex>-1){cal.deselectCell(index);}else{cal.selectCell(index);}}else{var link=cell.getElementsByTagName("A")[0];link.blur() +cal.selectCell(index);}}} +this.doCellMouseOver=function(e,cal){var cell=this;var index=cell.index;var d=cal.cellDates[index];var date=new Date(d[0],d[1]-1,d[2]);if(!cal.isDateOOM(date)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_RESTRICTED)&&!YAHOO.util.Dom.hasClass(cell,cal.Style.CSS_CELL_OOB)){YAHOO.util.Dom.addClass(cell,cal.Style.CSS_CELL_HOVER);}} +this.doCellMouseOut=function(e,cal){YAHOO.util.Dom.removeClass(this,cal.Style.CSS_CELL_HOVER);} +this.doNextMonth=function(e,cal){cal.nextMonth();} +this.doPreviousMonth=function(e,cal){cal.previousMonth();}} +YAHOO.widget.Calendar_Core.prototype.wireCustomEvents=function(){} +YAHOO.widget.Calendar_Core.prototype.setupConfig=function(){this.Config=new Object();this.Config.Style={CSS_ROW_HEADER:"calrowhead",CSS_ROW_FOOTER:"calrowfoot",CSS_CELL:"calcell",CSS_CELL_SELECTED:"selected",CSS_CELL_RESTRICTED:"restricted",CSS_CELL_TODAY:"today",CSS_CELL_OOM:"oom",CSS_CELL_OOB:"previous",CSS_HEADER:"calheader",CSS_HEADER_TEXT:"calhead",CSS_WEEKDAY_CELL:"calweekdaycell",CSS_WEEKDAY_ROW:"calweekdayrow",CSS_FOOTER:"calfoot",CSS_CALENDAR:"yui-calendar",CSS_CONTAINER:"yui-calcontainer",CSS_2UPWRAPPER:"yui-cal2upwrapper",CSS_NAV_LEFT:"calnavleft",CSS_NAV_RIGHT:"calnavright",CSS_CELL_TOP:"calcelltop",CSS_CELL_LEFT:"calcellleft",CSS_CELL_RIGHT:"calcellright",CSS_CELL_BOTTOM:"calcellbottom",CSS_CELL_HOVER:"calcellhover",CSS_CELL_HIGHLIGHT1:"highlight1",CSS_CELL_HIGHLIGHT2:"highlight2",CSS_CELL_HIGHLIGHT3:"highlight3",CSS_CELL_HIGHLIGHT4:"highlight4"};this.Style=this.Config.Style;this.Config.Locale={MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],MONTHS_LONG:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKDAYS_1CHAR:["S","M","T","W","T","F","S"],WEEKDAYS_SHORT:["Su","Mo","Tu","We","Th","Fr","Sa"],WEEKDAYS_MEDIUM:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WEEKDAYS_LONG:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DATE_DELIMITER:",",DATE_FIELD_DELIMITER:"/",DATE_RANGE_DELIMITER:"-",MY_MONTH_POSITION:1,MY_YEAR_POSITION:2,MD_MONTH_POSITION:1,MD_DAY_POSITION:2,MDY_MONTH_POSITION:1,MDY_DAY_POSITION:2,MDY_YEAR_POSITION:3};this.Locale=this.Config.Locale;this.Config.Options={MULTI_SELECT:false,SHOW_WEEKDAYS:true,START_WEEKDAY:0,SHOW_WEEK_HEADER:false,SHOW_WEEK_FOOTER:false,HIDE_BLANK_WEEKS:false,NAV_ARROW_LEFT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/callt.gif",NAV_ARROW_RIGHT:YAHOO.widget.Calendar_Core.IMG_ROOT+"us/tr/calrt.gif"};this.Options=this.Config.Options;this.customConfig();if(!this.Options.LOCALE_MONTHS){this.Options.LOCALE_MONTHS=this.Locale.MONTHS_LONG;} +if(!this.Options.LOCALE_WEEKDAYS){this.Options.LOCALE_WEEKDAYS=this.Locale.WEEKDAYS_SHORT;} +if(this.Options.START_WEEKDAY>0){for(var w=0;w0){this.preMonthDays-=this.Options.START_WEEKDAY;} +if(this.preMonthDays<0){this.preMonthDays+=7;} +this.monthDays=YAHOO.widget.DateMath.findMonthEnd(workingDate).getDate();this.postMonthDays=YAHOO.widget.Calendar_Core.DISPLAY_DAYS-this.preMonthDays-this.monthDays;workingDate=YAHOO.widget.DateMath.subtract(workingDate,YAHOO.widget.DateMath.DAY,this.preMonthDays);var weekRowIndex=0;for(var c=0;c=d1.getTime()&&workingDate.getTime()<=d2.getTime()){renderer=rArray[2];if(workingDate.getTime()==d2.getTime()){this.renderStack.splice(r,1);}} +break;case YAHOO.widget.Calendar_Core.WEEKDAY:var weekday=rArray[1][0];if(workingDate.getDay()+1==weekday){renderer=rArray[2];} +break;case YAHOO.widget.Calendar_Core.MONTH:month=rArray[1][0];if(workingDate.getMonth()+1==month){renderer=rArray[2];} +break;} +if(renderer){cellRenderers[cellRenderers.length]=renderer;}}} +if(this._indexOfSelectedFieldArray([workingDate.getFullYear(),workingDate.getMonth()+1,workingDate.getDate()])>-1){cellRenderers[cellRenderers.length]=this.renderCellStyleSelected;} +if(this.minDate){this.minDate=YAHOO.widget.DateMath.clearTime(this.minDate);} +if(this.maxDate){this.maxDate=YAHOO.widget.DateMath.clearTime(this.maxDate);} +if((this.minDate&&(workingDate.getTime()this.maxDate.getTime()))){cellRenderers[cellRenderers.length]=this.renderOutOfBoundsDate;}else{cellRenderers[cellRenderers.length]=this.renderCellDefault;} +for(var x=0;x=0&&c<=6){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TOP);} +if((c%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_LEFT);} +if(((c+1)%7)==0){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_RIGHT);} +var postDays=this.postMonthDays;if(postDays>=7&&this.Options.HIDE_BLANK_WEEKS){var blankWeeks=Math.floor(postDays/7);for(var p=0;p=((this.preMonthDays+postDays+this.monthDays)-7)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_BOTTOM);}}};YAHOO.widget.Calendar_Core.prototype.renderFooter=function(){};YAHOO.widget.Calendar_Core.prototype._unload=function(e,cal){for(var c in cal.cells){c=null;} +cal.cells=null;cal.tbody=null;cal.oDomContainer=null;cal.table=null;cal.headerCell=null;cal=null;};YAHOO.widget.Calendar_Core.prototype.renderOutOfBoundsDate=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOB);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;} +YAHOO.widget.Calendar_Core.prototype.renderRowHeader=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_HEADER);var useYear=this.pageDate.getFullYear();if(!YAHOO.widget.DateMath.isYearOverlapWeek(workingDate)){useYear=workingDate.getFullYear();} +var weekNum=YAHOO.widget.DateMath.getWeekNumber(workingDate,useYear,this.Options.START_WEEKDAY);cell.innerHTML=weekNum;if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderRowFooter=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_ROW_FOOTER);if(this.isDateOOM(workingDate)&&!YAHOO.widget.DateMath.isMonthOverlapWeek(workingDate)){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);}};YAHOO.widget.Calendar_Core.prototype.renderCellDefault=function(workingDate,cell){cell.innerHTML="";var link=document.createElement("a");link.href="javascript:void(null);";link.name=this.id+"__"+workingDate.getFullYear()+"_"+(workingDate.getMonth()+1)+"_"+workingDate.getDate();link.appendChild(document.createTextNode(this.buildDayLabel(workingDate)));cell.appendChild(link);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight1=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT1);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight2=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT2);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight3=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT3);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleHighlight4=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_HIGHLIGHT4);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleToday=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_TODAY);};YAHOO.widget.Calendar_Core.prototype.renderCellStyleSelected=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_SELECTED);};YAHOO.widget.Calendar_Core.prototype.renderCellNotThisMonth=function(workingDate,cell){YAHOO.util.Dom.addClass(cell,this.Style.CSS_CELL_OOM);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.renderBodyCellRestricted=function(workingDate,cell){YAHOO.widget.Calendar_Core.setCssClasses(cell,[this.Style.CSS_CELL,this.Style.CSS_CELL_RESTRICTED]);cell.innerHTML=workingDate.getDate();return YAHOO.widget.Calendar_Core.STOP_RENDER;};YAHOO.widget.Calendar_Core.prototype.addMonths=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractMonths=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.MONTH,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.addYears=function(count){this.pageDate=YAHOO.widget.DateMath.add(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.subtractYears=function(count){this.pageDate=YAHOO.widget.DateMath.subtract(this.pageDate,YAHOO.widget.DateMath.YEAR,count);this.resetRenderers();this.onChangePage();};YAHOO.widget.Calendar_Core.prototype.nextMonth=function(){this.addMonths(1);};YAHOO.widget.Calendar_Core.prototype.previousMonth=function(){this.subtractMonths(1);};YAHOO.widget.Calendar_Core.prototype.nextYear=function(){this.addYears(1);};YAHOO.widget.Calendar_Core.prototype.previousYear=function(){this.subtractYears(1);};YAHOO.widget.Calendar_Core.prototype.reset=function(){this.selectedDates.length=0;this.selectedDates=this._selectedDates.concat();this.pageDate=new Date(this._pageDate.getTime());this.onReset();};YAHOO.widget.Calendar_Core.prototype.clear=function(){this.selectedDates.length=0;this.pageDate=new Date(this.today.getTime());this.onClear();};YAHOO.widget.Calendar_Core.prototype.select=function(date){this.onBeforeSelect();var aToBeSelected=this._toFieldArray(date);for(var a=0;a-1){if(this.pageDate.getMonth()==dCellDate.getMonth()&&this.pageDate.getFullYear()==dCellDate.getFullYear()){YAHOO.util.Dom.removeClass(cell,this.Style.CSS_CELL_SELECTED);} +this.selectedDates.splice(cellDateIndex,1);} +if(this.parent){this.parent.sync(this);} +this.onDeselect();return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype.deselectAll=function(){this.onBeforeDeselect();var count=this.selectedDates.length;this.selectedDates.length=0;if(this.parent){this.parent.sync(this);} +if(count>0){this.onDeselect();} +return this.getSelectedDates();};YAHOO.widget.Calendar_Core.prototype._toFieldArray=function(date){var returnDate=new Array();if(date instanceof Date){returnDate=[[date.getFullYear(),date.getMonth()+1,date.getDate()]];}else if(typeof date=='string'){returnDate=this._parseDates(date);}else if(date instanceof Array){for(var i=0;i0){this.init(id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar.prototype.buildShell=function(){this.border=document.createElement("DIV");this.border.className=this.Style.CSS_CONTAINER;this.table=document.createElement("TABLE");this.table.cellSpacing=0;YAHOO.widget.Calendar_Core.setCssClasses(this.table,[this.Style.CSS_CALENDAR]);this.border.id=this.id;this.buildShellHeader();this.buildShellBody();this.buildShellFooter();};YAHOO.widget.Calendar.prototype.renderShell=function(){this.border.appendChild(this.table);this.oDomContainer.appendChild(this.border);this.shellRendered=true;};YAHOO.widget.Calendar.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.previousMonth);} +this.linkLeft=document.createElement("A");this.linkLeft.innerHTML=" ";YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.previousMonth,this,true);this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.nextMonth);} +this.linkRight=document.createElement("A");this.linkRight.innerHTML=" ";YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.nextMonth,this,true);this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;headerContainer.appendChild(this.linkLeft);headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));headerContainer.appendChild(this.linkRight);this.headerCell.appendChild(headerContainer);};YAHOO.widget.Cal=YAHOO.widget.Calendar;YAHOO.widget.CalendarGroup=function(pageCount,id,containerId,monthyear,selected){if(arguments.length>0){this.init(pageCount,id,containerId,monthyear,selected);}} +YAHOO.widget.CalendarGroup.prototype.init=function(pageCount,id,containerId,monthyear,selected){this.id=id;this.selectedDates=new Array();this.containerId=containerId;this.pageCount=pageCount;this.pages=new Array();for(var p=0;p0) +{year+=1;} +cal.setYear(year);}};YAHOO.widget.CalendarGroup.prototype.render=function(){for(var p=0;p=0;--p) +{var cal=this.pages[p];cal.previousMonth();}};YAHOO.widget.CalendarGroup.prototype.nextYear=function(){for(var p=0;p0) +{this.init(id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar2up_Cal.prototype=new YAHOO.widget.Calendar_Core();YAHOO.widget.Calendar2up_Cal.prototype.renderHeader=function(){this.headerCell.innerHTML="";var headerContainer=document.createElement("DIV");headerContainer.className=this.Style.CSS_HEADER;if(this.index==0){if(this.linkLeft){YAHOO.util.Event.removeListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth);} +this.linkLeft=document.createElement("A");this.linkLeft.innerHTML=" ";this.linkLeft.style.backgroundImage="url("+this.Options.NAV_ARROW_LEFT+")";this.linkLeft.className=this.Style.CSS_NAV_LEFT;YAHOO.util.Event.addListener(this.linkLeft,"mousedown",this.parent.doPreviousMonth,this.parent);headerContainer.appendChild(this.linkLeft);} +headerContainer.appendChild(document.createTextNode(this.buildMonthLabel()));if(this.index==1){if(this.linkRight){YAHOO.util.Event.removeListener(this.linkRight,"mousedown",this.parent.doNextMonth);} +this.linkRight=document.createElement("A");this.linkRight.innerHTML=" ";this.linkRight.style.backgroundImage="url("+this.Options.NAV_ARROW_RIGHT+")";this.linkRight.className=this.Style.CSS_NAV_RIGHT;YAHOO.util.Event.addListener(this.linkRight,"mousedown",this.parent.doNextMonth,this.parent);headerContainer.appendChild(this.linkRight);} +this.headerCell.appendChild(headerContainer);};YAHOO.widget.Calendar2up=function(id,containerId,monthyear,selected){if(arguments.length>0) +{this.buildWrapper(containerId);this.init(2,id,containerId,monthyear,selected);}} +YAHOO.widget.Calendar2up.prototype=new YAHOO.widget.CalendarGroup();YAHOO.widget.Calendar2up.CSS_2UPWRAPPER="yui-cal2upwrapper";YAHOO.widget.Calendar2up.CSS_CONTAINER="yui-calcontainer";YAHOO.widget.Calendar2up.CSS_2UPCONTAINER="cal2up";YAHOO.widget.Calendar2up.CSS_2UPTITLE="title";YAHOO.widget.Calendar2up.CSS_2UPCLOSE="close-icon";YAHOO.widget.Calendar2up.prototype.constructChild=function(id,containerId,monthyear,selected){var cal=new YAHOO.widget.Calendar2up_Cal(id,containerId,monthyear,selected);return cal;};YAHOO.widget.Calendar2up.prototype.buildWrapper=function(containerId){var outerContainer=document.getElementById(containerId);outerContainer.className=YAHOO.widget.Calendar2up.CSS_2UPWRAPPER;var innerContainer=document.createElement("DIV");innerContainer.className=YAHOO.widget.Calendar2up.CSS_CONTAINER;innerContainer.id=containerId+"_inner";var cal1Container=document.createElement("DIV");cal1Container.id=containerId+"_0";cal1Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;cal1Container.style.marginRight="10px";var cal2Container=document.createElement("DIV");cal2Container.id=containerId+"_1";cal2Container.className=YAHOO.widget.Calendar2up.CSS_2UPCONTAINER;outerContainer.appendChild(innerContainer);innerContainer.appendChild(cal1Container);innerContainer.appendChild(cal2Container);this.innerContainer=innerContainer;this.outerContainer=outerContainer;} +YAHOO.widget.Calendar2up.prototype.render=function(){this.renderHeader();YAHOO.widget.CalendarGroup.prototype.render.call(this);this.renderFooter();};YAHOO.widget.Calendar2up.prototype.renderHeader=function(){if(!this.title){this.title="";} +if(!this.titleDiv) +{this.titleDiv=document.createElement("DIV");if(this.title=="") +{this.titleDiv.style.display="none";}} +this.titleDiv.className=YAHOO.widget.Calendar2up.CSS_2UPTITLE;this.titleDiv.innerHTML=this.title;if(this.outerContainer.style.position=="absolute") +{var linkClose=document.createElement("A");linkClose.href="javascript:void(null)";YAHOO.util.Event.addListener(linkClose,"click",this.hide,this);var imgClose=document.createElement("IMG");imgClose.src=YAHOO.widget.Calendar_Core.IMG_ROOT+"us/my/bn/x_d.gif";imgClose.className=YAHOO.widget.Calendar2up.CSS_2UPCLOSE;linkClose.appendChild(imgClose);this.linkClose=linkClose;this.titleDiv.appendChild(linkClose);} +this.innerContainer.insertBefore(this.titleDiv,this.innerContainer.firstChild);} +YAHOO.widget.Calendar2up.prototype.hide=function(e,cal){if(!cal) +{cal=this;} +cal.outerContainer.style.display="none";} +YAHOO.widget.Calendar2up.prototype.renderFooter=function(){} +YAHOO.widget.Cal2up=YAHOO.widget.Calendar2up; Index: temp_moodle_dev/lamstwo/callt.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/calrt.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/calx.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/config.html =================================================================== diff -u --- temp_moodle_dev/lamstwo/config.html (revision 0) +++ temp_moodle_dev/lamstwo/config.html (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,161 @@ +
+ + + + + + + + + + + + + + + + + + + + + + +
server_url: + +
server_id: + +
server_key: + +
+ + "/> +
+ +" /> +" /> +" /> +" /> +" /> +
+ \ No newline at end of file Index: temp_moodle_dev/lamstwo/constants.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/constants.php (revision 0) +++ temp_moodle_dev/lamstwo/constants.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,19 @@ +login_request = '/LoginRequest'; +$LAMS2CONSTANTS->param_uid = 'uid'; +$LAMS2CONSTANTS->param_serverid = 'sid'; +$LAMS2CONSTANTS->param_timestamp = 'ts'; +$LAMS2CONSTANTS->param_hash = 'hash'; +$LAMS2CONSTANTS->param_method = 'method'; +$LAMS2CONSTANTS->param_courseid = 'courseid'; +$LAMS2CONSTANTS->param_country = 'country'; +$LAMS2CONSTANTS->param_lang = 'lang'; +$LAMS2CONSTANTS->param_lsid = 'lsid'; +$LAMS2CONSTANTS->author_method = 'author'; +$LAMS2CONSTANTS->monitor_method = 'monitor'; +$LAMS2CONSTANTS->learner_method = 'learner'; + +?> Index: temp_moodle_dev/lamstwo/db/install.xml =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/install.xml (revision 0) +++ temp_moodle_dev/lamstwo/db/install.xml (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file Index: temp_moodle_dev/lamstwo/db/migrate2utf8.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/migrate2utf8.php (revision 0) +++ temp_moodle_dev/lamstwo/db/migrate2utf8.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,78 @@ +lang; + $courselang = get_course_lang($lamstwo->course); //Non existing! + $userlang = get_main_teacher_lang($lamstwo->course); //N.E.!! + + $fromenc = get_original_encoding($sitelang, $courselang, $userlang); + } + +/// We are going to use textlib facilities + +/// Convert the text + if (($fromenc != 'utf-8') && ($fromenc != 'UTF-8')) { + $result = utfconvert($lamstwo->name, $fromenc); + + $newlamstwo = new object; + $newlamstwo->id = $recordid; + $newlamstwo->name = $result; + migrate2utf8_update_record('lamstwo',$newlamstwo); + } +/// And finally, just return the converted field + return $result; +} + +function migrate2utf8_lamstwo_introduction($recordid){ + global $CFG, $globallang; + +/// Some trivial checks + if (empty($recordid)) { + log_the_problem_somewhere(); + return false; + } + + if (!$lamstwo = get_record('lamstwo','id',$recordid)) { + log_the_problem_somewhere(); + return false; + } + if ($globallang) { + $fromenc = $globallang; + } else { + $sitelang = $CFG->lang; + $courselang = get_course_lang($lamstwo->course); //Non existing! + $userlang = get_main_teacher_lang($lamstwo->course); //N.E.!! + + $fromenc = get_original_encoding($sitelang, $courselang, $userlang); + } + +/// We are going to use textlib facilities + +/// Convert the text + if (($fromenc != 'utf-8') && ($fromenc != 'UTF-8')) { + $result = utfconvert($lamstwo->introduction, $fromenc); + + $newlamstwo = new object; + $newlamstwo->id = $recordid; + $newlamstwo->introduction = $result; + migrate2utf8_update_record('lamstwo',$newlamstwo); + } +/// And finally, just return the converted field + return $result; +} +?> Index: temp_moodle_dev/lamstwo/db/migrate2utf8.xml =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/migrate2utf8.xml (revision 0) +++ temp_moodle_dev/lamstwo/db/migrate2utf8.xml (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,18 @@ + + + + + + + migrate2utf8_lamstwo_name(RECORDID) + + + + + migrate2utf8_lamstwo_introduction(RECORDID) + + + +
+
+
Index: temp_moodle_dev/lamstwo/db/mysql.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/mysql.php (revision 0) +++ temp_moodle_dev/lamstwo/db/mysql.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,18 @@ + Index: temp_moodle_dev/lamstwo/db/mysql.sql =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/mysql.sql (revision 0) +++ temp_moodle_dev/lamstwo/db/mysql.sql (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,18 @@ +# This file contains a complete database schema for all the +# tables used by this module, written in SQL + +# It may also contain INSERT statements for particular data +# that may be used, especially new entries in the table log_display + +CREATE TABLE prefix_lamstwo ( + id int(10) unsigned NOT NULL auto_increment, + course int(10) unsigned NOT NULL default '0', + name varchar(255) NOT NULL default '', + introduction text NOT NULL default '', + sequence_id bigint(20) default '0', + lesson_id bigint(20) default '0', + timemodified int(10) unsigned NOT NULL default '0', + PRIMARY KEY (id), + KEY course (course) +)COMMENT='LAMS2 activity'; + Index: temp_moodle_dev/lamstwo/db/postgres7.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/postgres7.php (revision 0) +++ temp_moodle_dev/lamstwo/db/postgres7.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,18 @@ + Index: temp_moodle_dev/lamstwo/db/postgres7.sql =================================================================== diff -u --- temp_moodle_dev/lamstwo/db/postgres7.sql (revision 0) +++ temp_moodle_dev/lamstwo/db/postgres7.sql (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,18 @@ +# This file contains a complete database schema for all the +# tables used by this module, written in SQL + +# It may also contain INSERT statements for particular data +# that may be used, especially new entries in the table log_display + +CREATE TABLE prefix_lamstwo ( + id SERIAL PRIMARY KEY, + course integer NOT NULL default '0', + name varchar(255) NOT NULL default '', + introduction text NOT NULL default '', + sequence_id integer NOT NULL default '0', + lesson_id integer NOT NULL default '0', + timemodified integer NOT NULL default '0' +); + +CREATE INDEX prefix_lamstwo_course_idx ON prefix_lamstwo (course); + Index: temp_moodle_dev/lamstwo/dom.js =================================================================== diff -u --- temp_moodle_dev/lamstwo/dom.js (revision 0) +++ temp_moodle_dev/lamstwo/dom.js (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1 @@ +/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt Version: 0.11.1 */ YAHOO.util.Dom=function(){var ua=navigator.userAgent.toLowerCase();var isOpera=(ua.indexOf('opera')>-1);var isSafari=(ua.indexOf('safari')>-1);var isIE=(window.ActiveXObject);var id_counter=0;var util=YAHOO.util;var property_cache={};var toCamel=function(property){var convert=function(prop){var test=/(-[a-z])/i.exec(prop);return prop.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());};while(property.indexOf('-')>-1){property=convert(property);}return property;};var toHyphen=function(property){if(property.indexOf('-')>-1){return property;}var converted='';for(var i=0,len=property.length;i=this.left&®ion.right<=this.right&®ion.top>=this.top&®ion.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(region){var t=Math.max(this.top,region.top);var r=Math.min(this.right,region.right);var b=Math.min(this.bottom,region.bottom);var l=Math.max(this.left,region.left);if(b>=t&&r>=l){return new YAHOO.util.Region(t,r,b,l);}else{return null;}};YAHOO.util.Region.prototype.union=function(region){var t=Math.min(this.top,region.top);var r=Math.max(this.right,region.right);var b=Math.max(this.bottom,region.bottom);var l=Math.min(this.left,region.left);return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(el){var p=YAHOO.util.Dom.getXY(el);var t=p[1];var r=p[0]+el.offsetWidth;var b=p[1]+el.offsetHeight;var l=p[0];return new YAHOO.util.Region(t,r,b,l);};YAHOO.util.Point=function(x,y){if(x instanceof Array){y=x[1];x=x[0];}this.x=this.right=this.left=this[0]=x;this.y=this.top=this.bottom=this[1]=y;};YAHOO.util.Point.prototype=new YAHOO.util.Region(); Index: temp_moodle_dev/lamstwo/event.js =================================================================== diff -u --- temp_moodle_dev/lamstwo/event.js (revision 0) +++ temp_moodle_dev/lamstwo/event.js (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1 @@ +/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */ YAHOO.util.CustomEvent=function(_1,_2,_3){this.type=_1;this.scope=_2||window;this.silent=_3;this.subscribers=[];if(YAHOO.util.Event){YAHOO.util.Event.regCE(this);}if(!this.silent){}};YAHOO.util.CustomEvent.prototype={subscribe:function(fn,_5,_6){this.subscribers.push(new YAHOO.util.Subscriber(fn,_5,_6));},unsubscribe:function(fn,_7){var _8=false;for(var i=0,len=this.subscribers.length;i=0){_60=_18[_59];}if(!el||!_60){return false;}if(el.removeEventListener){el.removeEventListener(_58,_60[this.WFN],false);}else{if(el.detachEvent){el.detachEvent("on"+_58,_60[this.WFN]);}}delete _18[_59][this.WFN];delete _18[_59][this.FN];delete _18[_59];return true;},getTarget:function(ev,_62){var t=ev.target||ev.srcElement;return this.resolveTextNode(t);},resolveTextNode:function(_64){if(_64&&_64.nodeName&&"#TEXT"==_64.nodeName.toUpperCase()){return _64.parentNode;}else{return _64;}},getPageX:function(ev){var x=ev.pageX;if(!x&&0!==x){x=ev.clientX||0;if(this.isIE){x+=this._getScrollLeft();}}return x;},getPageY:function(ev){var y=ev.pageY;if(!y&&0!==y){y=ev.clientY||0;if(this.isIE){y+=this._getScrollTop();}}return y;},getXY:function(ev){return [this.getPageX(ev),this.getPageY(ev)];},getRelatedTarget:function(ev){var t=ev.relatedTarget;if(!t){if(ev.type=="mouseout"){t=ev.toElement;}else{if(ev.type=="mouseover"){t=ev.fromElement;}}}return this.resolveTextNode(t);},getTime:function(ev){if(!ev.time){var t=new Date().getTime();try{ev.time=t;}catch(e){return t;}}return ev.time;},stopEvent:function(ev){this.stopPropagation(ev);this.preventDefault(ev);},stopPropagation:function(ev){if(ev.stopPropagation){ev.stopPropagation();}else{ev.cancelBubble=true;}},preventDefault:function(ev){if(ev.preventDefault){ev.preventDefault();}else{ev.returnValue=false;}},getEvent:function(e){var ev=e||window.event;if(!ev){var c=this.getEvent.caller;while(c){ev=c.arguments[0];if(ev&&Event==ev.constructor){break;}c=c.caller;}}return ev;},getCharCode:function(ev){return ev.charCode||((ev.type=="keypress")?ev.keyCode:0);},_getCacheIndex:function(el,_68,fn){for(var i=0,len=_18.length;i0);}var _73=[];for(var i=0,len=_19.length;i0){for(var i=0,len=_18.length;i0){for(i=0,len=_18.length;iid); + + add_to_log($course->id, "lamstwo", "view all", "index.php?id=$course->id", ""); + + +/// Get all required strings + + $strlamstwos = get_string("modulenameplural", "lamstwo"); + $strlamstwo = get_string("modulename", "lamstwo"); + + +/// Print the header + + if ($course->category) { + $navigation = "id\">$course->shortname ->"; + } + + print_header("$course->shortname: $strlamstwos", "$course->fullname", "$navigation $strlamstwos", "", "", true, "", navmenu($course)); + +/// Get all the appropriate data + + if (! $lamstwos = get_all_instances_in_course("lamstwo", $course)) { + notice("There are no lamstwo", "../../course/view.php?id=$course->id"); + die; + } + +/// Print the list of instances (your module will probably extend this) + + $timenow = time(); + $strname = get_string("name"); + $strweek = get_string("week"); + $strtopic = get_string("topic"); + + if ($course->format == "weeks") { + $table->head = array ($strweek, $strname); + $table->align = array ('center', 'left'); + } else if ($course->format == "topics") { + $table->head = array ($strtopic, $strname); + $table->align = array ('center', 'left', 'left', 'left'); + } else { + $table->head = array ($strname); + $table->align = array ('left', 'left', 'left'); + } + + foreach ($lamstwos as $lamstwo) { + if (!$lamstwo->visible) { + //Show dimmed if the mod is hidden + $link = "coursemodule\">$lamstwo->name"; + } else { + //Show normal if the mod is visible + $link = "coursemodule\">$lamstwo->name"; + } + + if ($course->format == 'weeks' or $course->format == 'topics') { + $table->data[] = array ($lamstwo->section, $link); + } else { + $table->data[] = array ($link); + } + } + + echo '
'; + + print_table($table); + +/// Finish the page + + print_footer($course); + +?> Index: temp_moodle_dev/lamstwo/lib.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/lib.php (revision 0) +++ temp_moodle_dev/lamstwo/lib.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,309 @@ +libdir.'/datalib.php'); +require_once($CFG->libdir.'/moodlelib.php'); +require_once($CFG->libdir.'/soap/nusoap.php'); + + +function lamstwo_add_instance($lamstwo) { +/// Given an object containing all the necessary data, +/// (defined by the form in mod.html) this function +/// will create a new instance and return the id number +/// of the new instance. + global $USER; + $lamstwo->timemodified = time(); + $lamstwo->lesson_id = lamstwo_get_lesson($USER->username,$lamstwo->sequence_id,$lamstwo->course,$lamstwo->name,$lamstwo->introduction,$lamstwo->start_date,trim($USER->country),substr(trim($USER->lang),0,2)); + return insert_record("lamstwo", $lamstwo); +} + + +function lamstwo_update_instance($lamstwo) { +/// Given an object containing all the necessary data, +/// (defined by the form in mod.html) this function +/// will update an existing instance with new data. + //echo "enter lamstwo_update_instance
"; + $lamstwo->timemodified = time(); + $lamstwo->id = $lamstwo->instance; + /* + lamstwo_delete_lesson($USER->username,$lamstwo->lesson_id); + $start_date = ""; + if($lamstwo->start_date) $start_date=$lamstwo->start_date; + $country = ""; + if($USER->country) $country=trim($USER->country); + $lang = ""; + if($USER->lang) $lang = substr(trim($USER->lang),0,2); + $lamstwo->lesson_id = lamstwo_get_lesson($USER->username,$lamstwo->sequence_id,$lamstwo->course,$lamstwo->name,$lamstwo->introduction,$start_date,$country,$lang); + if(!$lamstwo->lesson_id){ + return false; + } + # May have to add extra stuff in here # + //echo $lamstwo->id."
"; + //echo $lamstwo->sequence_id."
"; + //echo $lamstwo->course."
"; + //echo $lamstwo->name."
"; + //echo $lamstwo->introduction."
"; + //echo $lamstwo->lesson_id."
"; + //echo "exit lamstwo_update_instance
"; +*/ + return update_record("lamstwo", $lamstwo); +} + + +function lamstwo_delete_instance($id) { +/// Given an ID of an instance of this module, +/// this function will permanently delete the instance +/// and any data that depends on it. + + if (! $lamstwo = get_record("lamstwo", "id", "$id")) { + return false; + } + + $result = true; + + # Delete any dependent records here # + lamstwo_delete_lesson($USER->username,$lamstwo->lesson_id); + if (! delete_records("lamstwo", "id", "$lamstwo->id")) { + $result = false; + } + + return $result; +} + +function lamstwo_user_outline($course, $user, $mod, $lamstwo) { +/// Return a small object with summary information about what a +/// user has done with a given particular instance of this module +/// Used for user activity reports. +/// $return->time = the time they did it +/// $return->info = a short text description + + return $return; +} + +function lamstwo_user_complete($course, $user, $mod, $lamstwo) { +/// Print a detailed representation of what a user has done with +/// a given particular instance of this module, for user activity reports. + + return true; +} + +function lamstwo_print_recent_activity($course, $isteacher, $timestart) { +/// Given a course and a time, this module should find recent activity +/// that has occurred in lamstwo activities and print it out. +/// Return true if there was output, or false is there was none. + + global $CFG; + + return false; // True if anything was printed, otherwise false +} + +function lamstwo_cron () { +/// Function to be run periodically according to the moodle cron +/// This function searches for things that need to be done, such +/// as sending out mail, toggling flags etc ... + + global $CFG; + + return true; +} + +function lamstwo_grades($lamstwoid) { +/// Must return an array of grades for a given instance of this module, +/// indexed by user. It also returns a maximum allowed grade. +/// +/// $return->grades = array of grades; +/// $return->maxgrade = maximum allowed grade; +/// +/// return $return; + + return NULL; +} + +function lamstwo_get_participants($lamstwoid) { +//Must return an array of user records (all data) who are participants +//for a given instance of lamstwo. Must include every user involved +//in the instance, independient of his role (student, teacher, admin...) +//See other modules as example. + + return false; +} + +function lamstwo_scale_used ($lamstwoid,$scaleid) { +//This function returns if a scale is being used by one lamstwo +//it it has support for grading and scales. Commented code should be +//modified if necessary. See forum, glossary or journal modules +//as reference. + + $return = false; + + //$rec = get_record("lamstwo","id","$lamstwoid","scale","-$scaleid"); + // + //if (!empty($rec) && !empty($scaleid)) { + // $return = true; + //} + + return $return; +} + +////////////////////////////////////////////////////////////////////////////////////// +/// Any other lamstwo functions go here. Each of them must have a name that +/// starts with lamstwo_ + +function lamstwo_get_soap_client($relativeurl) { + global $CFG; + if(!isset($CFG->lamstwo_serverurl)) + { + return NULL; + } + $wsdl = $CFG->lamstwo_serverurl.$relativeurl; + $s = new soap_client($wsdl,true,false,false,false,false,5,5); + return $s; +} + +/** + * Get sequences(learning designs) for the user in lamstwo + * + * @param string $username The username of the user. Set this to "" if you would just like to get sequences for the currently logged in user. + * @return string to define the tree structure + * @TODO complete the documentation of this function + */ +function lamstwo_get_sequences($username,$courseid,$country,$lang) { + global $CFG,$USER; + if(!isset($CFG->lamstwo_serverid)||!isset($CFG->lamstwo_serverkey)||!isset($CFG->lamstwo_serverurl)) + { + return get_string("notsetup", "lamstwo"); + } + $relativeurl="/services/LearningDesignRepositoryService?wsdl"; + $s = lamstwo_get_soap_client($relativeurl); + if(is_null($s)){ + return NULL; + } + $datetime = date("F d,Y g:i a"); + + if(!isset($username)){ + $username = $USER->username; + } + $rawstring = trim($datetime).trim($username).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $hashvalue = sha1(strtolower($rawstring)); + $mode = 2; //monitor mode + $parameters = array($CFG->lamstwo_serverid,$datetime,$hashvalue,$username,$courseid,$mode,$country,$lang); + $result = $s->call('getLearningDesigns',$parameters);//Array of simpleLearningDesign objects + if($s->getError()){//if some exception happened + $result = $s->getError();//return the string describing the error + } + unset($s); + $pattern = '/\'(\d+)\'/'; + $replacement = '\'javascript:selectSequence($1)\''; + return preg_replace($pattern,$replacement,$result); +} + +/** + * Get lesson id from lamstwo + * + * @param string $username The username of the user. Set this to "" if you would just like the currently logged in user to create the lesson + * @param int $ldid The id of the learning design that the lesson is based on + * @param int $courseid The id of the course that the lesson is associated with. + * @param string $title The title of the lesson + * @param string $desc The description of the lesson + * @param string $country The Country's ISO code + * @param string $lang The Language's ISO code + * @return int lesson id + */ +function lamstwo_get_lesson($username,$ldid,$courseid,$title,$desc,$startdate,$country,$lang) { + //echo "enter lamstwo_get_lesson
"; + global $CFG,$USER; + if(!isset($CFG->lamstwo_serverid)||!isset($CFG->lamstwo_serverkey)) + { + //echo "serverid or serverkey is not set
"; + return NULL; + } + $relativeurl="/services/LessonManagerService?wsdl"; + $s = lamstwo_get_soap_client($relativeurl); + if(is_null($s)){ + //echo "soap client is null
"; + return NULL; + } + $datetime = date("F d,Y g:i a"); + if(!isset($username)){ + $username = $USER->username; + } + $plaintext = $datetime.$username.$CFG->lamstwo_serverid.$CFG->lamstwo_serverkey; + //echo $plaintext; + $hashvalue = sha1(strtolower($plaintext)); + //echo $hashvalue; + if($startdate){ + $parameters = array($CFG->lamstwo_serverid,$datetime,$hashvalue,$username,$ldid,$courseid,$title,$desc,$startdate,$country,$lang); + $result = $s->call('scheduleLesson',$parameters); + }else{ + $parameters = array($CFG->lamstwo_serverid,$datetime,$hashvalue,$username,$ldid,$courseid,$title,$desc,$country,$lang); + $result = $s->call('startLesson',$parameters); + } + if($s->getError()){ + $result = $s->getError(); + echo 'result:'.$result.'
exit lamstwo_get_lesson
'; + } + unset($s); + return $result; +} + +/** + * Delete learning session(lesson) from lamstwo + * + * @param string $username The username of the user. Set this to "" if you would just like the currently logged in user to create the lesson + * @param int $lsid The id of the learning session(lesson) + * @return true or false + */ +function lamstwo_delete_lesson($username,$lsid) { + //echo "enter lamstwo_get_lesson
"; + global $CFG,$USER; + if(!isset($CFG->lamstwo_serverid)||!isset($CFG->lamstwo_serverkey)) + { + return "The LAMSv2 serverId and serverKey have not been set up"; + } + $relativeurl="/services/LessonManagerService?wsdl"; + $s = lamstwo_get_soap_client($relativeurl); + if(is_null($s)){ + return "Failed to get soap client based on:".$relativeurl; + } + $datetime = date("F d,Y g:i a"); + if(!isset($username)){ + $username = $USER->username; + } + $plaintext = $datetime.$username.$CFG->lamstwo_serverid.$CFG->lamstwo_serverkey; + //echo $plaintext; + $hashvalue = sha1(strtolower($plaintext)); + //echo $hashvalue; + $parameters = array($CFG->lamstwo_serverid,$datetime,$hashvalue,$username,$lsid); + $result = $s->call('deleteLesson',$parameters); + if($s->getError()){ + $result = $s->getError(); + } + unset($s); + return $result; +} + +/** + * Verify if the server_url, server_id and server_key are set properly + */ +function lamstwo_verify($url, $id, $key){ + $relativeurl="/services/VerificationService?wsdl"; + $wsdl = $url.$relativeurl; + $s = new soap_client($wsdl,true,false,false,false,false,3,3); + if(is_null($s)){ + return NULL; + } + $datetime = date("F d,Y g:i a"); + $plaintext = $datetime.$id.$key; + //echo $plaintext; + $hashvalue = sha1(strtolower($plaintext)); + //echo $hashvalue; + $parameters = array($id,$datetime,$hashvalue); + $result = $s->call('verify',$parameters); + if($s->getError()){ + $result = $s->getError(); + } + unset($s); + return $result; +} + +?> Index: temp_moodle_dev/lamstwo/mod.html =================================================================== diff -u --- temp_moodle_dev/lamstwo/mod.html (revision 0) +++ temp_moodle_dev/lamstwo/mod.html (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,478 @@ + + +dirroot.'/mod/lamstwo/constants.php'); +require_once($CFG->dirroot.'/mod/lamstwo/lib.php'); + +if (!isset($form->name)) { + $form->name = ''; +} +if (!isset($form->sequence_id)) { + $form->sequence_id = ''; +} +if (!isset($form->introduction)) { + $form->introduction = ''; +} +if (!isset($form->lesson_id)) { + $form->lesson_id = ''; +} + +if (!isset($form->create_sequence_url)) { + $datetime = date("F d,Y g:i a"); + $plaintext = trim($datetime).trim($USER->username).trim($LAMS2CONSTANTS->author_method).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $hash = sha1(strtolower($plaintext)); + $form->create_sequence_url = $CFG->lamstwo_serverurl.$LAMS2CONSTANTS->login_request. + '?'.$LAMS2CONSTANTS->param_uid.'='.$USER->username. + '&'.$LAMS2CONSTANTS->param_method.'='.$LAMS2CONSTANTS->author_method. + '&'.$LAMS2CONSTANTS->param_timestamp.'='.urlencode($datetime). + '&'.$LAMS2CONSTANTS->param_serverid.'='.$CFG->lamstwo_serverid. + '&'.$LAMS2CONSTANTS->param_hash.'='.$hash. + '&'.$LAMS2CONSTANTS->param_courseid.'='.$form->course. + '&'.$LAMS2CONSTANTS->param_country.'='.trim($USER->country). + '&'.$LAMS2CONSTANTS->param_lang.'='.substr(trim($USER->lang),0,2); +} +?> + + + +
+ + + + + +'; + }else{ + echo '
'; + } +?> + + + + + + + + + + +
+
+

+
+ + + + +
+ + + +
+
+ " onClick="openAuthor(create_sequence_url."'";?>,'author','location=0,toolbar=0,menubar=0,statusbar=0,width=796,height=570,resizable',0)" /> + " onclick="javascript:refreshSequences()" /> + " /> + " onClick="javascript:nextStep()"/> +
+
+ +'; + }else{ + echo ' + + + + + + + + + + + + + + + + + +
+ + + + + + + + Index: temp_moodle_dev/lamstwo/pdate.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/tree.js =================================================================== diff -u --- temp_moodle_dev/lamstwo/tree.js (revision 0) +++ temp_moodle_dev/lamstwo/tree.js (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,142 @@ +// Title: Tigra Tree +// Description: See the demo at url +// URL: http://www.softcomplex.com/products/tigra_menu_tree/ +// Version: 1.1 +// Date: 11-12-2002 (mm-dd-yyyy) +// Notes: This script is free. Visit official site for further details. + +function tree (a_items, a_template) { + + this.a_tpl = a_template; + this.a_config = a_items; + this.o_root = this; + this.a_index = []; + this.o_selected = null; + this.n_depth = -1; + + var o_icone = new Image(),o_iconl = new Image(); + o_icone.src = a_template['icon_e']; + o_iconl.src = a_template['icon_l']; + a_template['im_e'] = o_icone; + a_template['im_l'] = o_iconl; + for (var i = 0; i < 64; i++) + if (a_template['icon_' + i]) { + var o_icon = new Image(); + a_template['im_' + i] = o_icon; + o_icon.src = a_template['icon_' + i]; + } + + this.toggle = function (n_id) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened) }; + this.select = function (n_id) { return this.a_index[n_id].select(); }; + this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; + this.mover = function (n_id) { this.a_index[n_id].upstatus() }; + + this.a_children = []; + for (var i = 0; i < a_items.length; i++) + new tree_item(this, i); + + this.n_id = trees.length; + trees[this.n_id] = this; + + for (var i = 0; i < this.a_children.length; i++) { + document.write(this.a_children[i].init()); + open_recursively(this.a_children[i]); + } +} + +function open_recursively(tree_item){ + tree_item.open(false); + if(tree_item.a_children){ + for(var i = 0; i < tree_item.a_children.length; i++){ + open_recursively(tree_item.a_children[i]); + } + } +} + +function tree_item (o_parent, n_order) { + + this.n_depth = o_parent.n_depth + 1; + this.a_config = o_parent.a_config[n_order + (this.n_depth ? 2 : 0)]; + if (!this.a_config) return; + + this.o_root = o_parent.o_root; + this.o_parent = o_parent; + this.n_order = n_order; + this.b_opened = !this.n_depth; + + this.n_id = this.o_root.a_index.length; + this.o_root.a_index[this.n_id] = this; + o_parent.a_children[n_order] = this; + + this.a_children = []; + for (var i = 0; i < this.a_config.length - 2; i++) + new tree_item(this, i); + + this.get_icon = item_get_icon; + this.open = item_open; + this.select = item_select; + this.init = item_init; + this.upstatus = item_upstatus; + this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; +} + +function item_open (b_close) { + var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); + if (!o_idiv) return; + + if (!o_idiv.innerHTML) { + var a_children = []; + for (var i = 0; i < this.a_children.length; i++) + a_children[i]= this.a_children[i].init(); + o_idiv.innerHTML = a_children.join(''); + } + o_idiv.style.display = (b_close ? 'none' : 'block'); + + this.b_opened = !b_close; + var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], + o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_jicon) o_jicon.src = this.get_icon(true); + if (o_iicon) o_iicon.src = this.get_icon(); + this.upstatus(); +} + +function item_select (b_deselect) { + if (!b_deselect) { + var o_olditem = this.o_root.o_selected; + this.o_root.o_selected = this; + if (o_olditem) o_olditem.select(true); + } + var o_iicon = document.images['i_img' + this.o_root.n_id + '_' + this.n_id]; + if (o_iicon) o_iicon.src = this.get_icon(); + get_element('i_txt' + this.o_root.n_id + '_' + this.n_id).style.fontWeight = b_deselect ? 'normal' : 'bold'; + + this.upstatus(); + return Boolean(this.a_config[1]); +} + +function item_upstatus (b_clear) { + window.setTimeout('window.status="' + (b_clear ? '' : this.a_config[0] + (this.a_config[1] ? ' ('+ this.a_config[1] + ')' : '')) + '"', 10); +} + +function item_init () { + var a_offset = [], + o_current_item = this.o_parent; + for (var i = this.n_depth; i > 1; i--) { + a_offset[i] = ''; + o_current_item = o_current_item.o_parent; + } + return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length + ? '' + : '') : '') + + '' + this.a_config[0] + '
' + (this.a_children.length ? '' : ''); +} + +function item_get_icon (b_junction) { + return this.o_root.a_tpl['icon_' + ((this.n_depth ? 0 : 32) + (this.a_children.length ? 16 : 0) + (this.a_children.length && this.b_opened ? 8 : 0) + (!b_junction && !this.a_config[0] ? 'e' : (!b_junction && this.o_root.o_selected && this.a_config[0] == this ? 4 : 0)) + (b_junction ? 2 : 0) + (b_junction && this.is_last() ? 1 : 0))]; +} + +var trees = []; +get_element = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; Index: temp_moodle_dev/lamstwo/tree_tpl.js =================================================================== diff -u --- temp_moodle_dev/lamstwo/tree_tpl.js (revision 0) +++ temp_moodle_dev/lamstwo/tree_tpl.js (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,36 @@ +/* + Feel free to use your custom treeicons for the tree. Make sure they are all of the same size. + User treeicons collections are welcome, we'll publish them giving all regards. +*/ + +var TREE_TPL = { + 'target' : '_self', // name of the frame links will be opened in + // other possible values are: _blank, _parent, _search, _self and _top + + 'icon_e' : '../mod/lamstwo/treeicons/empty.gif', // empty image + 'icon_l' : '../mod/lamstwo/treeicons/line.gif', // vertical line + + 'icon_32' : '../mod/lamstwo/treeicons/base.gif', // root leaf icon normal + 'icon_36' : '../mod/lamstwo/treeicons/base.gif', // root leaf icon selected + + 'icon_48' : '../mod/lamstwo/treeicons/base.gif', // root icon normal + 'icon_52' : '../mod/lamstwo/treeicons/base.gif', // root icon selected + 'icon_56' : '../mod/lamstwo/treeicons/base.gif', // root icon opened + 'icon_60' : '../mod/lamstwo/treeicons/base.gif', // root icon selected + + 'icon_16' : '../mod/lamstwo/treeicons/folder.gif', // node icon normal + 'icon_20' : '../mod/lamstwo/treeicons/folderopen.gif', // node icon selected + 'icon_24' : '../mod/lamstwo/treeicons/folderopen.gif', // node icon opened + 'icon_28' : '../mod/lamstwo/treeicons/folderopen.gif', // node icon selected opened + + 'icon_0' : '../mod/lamstwo/treeicons/page.gif', // leaf icon normal + 'icon_4' : '../mod/lamstwo/treeicons/page.gif', // leaf icon selected + + 'icon_2' : '../mod/lamstwo/treeicons/joinbottom.gif', // junction for leaf + 'icon_3' : '../mod/lamstwo/treeicons/join.gif', // junction for last leaf + 'icon_18' : '../mod/lamstwo/treeicons/plusbottom.gif', // junction for closed node + 'icon_19' : '../mod/lamstwo/treeicons/plus.gif', // junctioin for last closed node + 'icon_26' : '../mod/lamstwo/treeicons/minusbottom.gif',// junction for opened node + 'icon_27' : '../mod/lamstwo/treeicons/minus.gif' // junctioin for last opended node +}; + Index: temp_moodle_dev/lamstwo/treeicons/Thumbs.db =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/base.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/empty.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/folder.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/folderopen.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/join.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/joinbottom.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/line.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/minus.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/minusbottom.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/page.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/plus.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/treeicons/plusbottom.gif =================================================================== diff -u Binary files differ Index: temp_moodle_dev/lamstwo/userinfo.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/userinfo.php (revision 0) +++ temp_moodle_dev/lamstwo/userinfo.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,42 @@ +libdir.'/datalib.php'); + + if(!isset($CFG->lamstwo_serverid)||!isset($CFG->lamstwo_serverkey)) + { + header("HTTP/1.1 401 Unauthenticated"); + exit(1); + } + $plaintext = trim($_GET["ts"]).trim($_GET["un"]).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $hash = sha1(strtolower($plaintext)); + if($hash!=$_GET["hs"]){ + header("HTTP/1.1 401 Unauthenticated"); + exit(1); + } + + //OK, the caller is authenticated. Now let's fulfill its request. + //What it needs is user info in CSV format. It should be like this: + //username,first name,last name,job title, department, organisation, + //address,phone,fax,mobile,email + $user = get_record('user', 'username', $_GET["un"]);//return false if none found + if(!$user){ + header("HTTP/1.1 401 Unauthenticated");//which status code is appropriate? + exit(1); + } + $array = array('',$user->firstname,$user->lastname,$user->address,$user->city,'','',$user->country,$user->phone1,'','',$user->email,$user->country,$user->lang); + $comma_separated = implode(",", $array);//need more sophiscated algorithm to generate CSV formatted string + echo $comma_separated; +?> Index: temp_moodle_dev/lamstwo/verify.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/verify.php (revision 0) +++ temp_moodle_dev/lamstwo/verify.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,6 @@ +dirroot.'/mod/lamstwo/lib.php'); + +echo lamstwo_verify($_POST['u'], $_POST['i'], $_POST['k']); +?> \ No newline at end of file Index: temp_moodle_dev/lamstwo/version.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/version.php (revision 0) +++ temp_moodle_dev/lamstwo/version.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,12 @@ +version = 2006092601; // The current module version (Date: YYYYMMDDXX) +$module->requires = 2006080900; // Requires this Moodle version +$module->cron = 0; // Period for cron to check this module (secs) + +?> Index: temp_moodle_dev/lamstwo/view.php =================================================================== diff -u --- temp_moodle_dev/lamstwo/view.php (revision 0) +++ temp_moodle_dev/lamstwo/view.php (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1,115 @@ + +course)) { + error("Course is misconfigured"); +} + +if (! $lamstwo = get_record("lamstwo", "id", $cm->instance)) { + error("Course module is incorrect"); +} + +require_login($course->id); + +add_to_log($course->id, "lamstwo", "view", "view.php?id=$cm->id", "$lamstwo->id"); + +/// Print the page header + +//if ($course->category) { +// $navigation = "id\">$course->shortname ->"; +//} +print_header_simple(format_string($lamstwo->name), "", + "id\">$strchoices -> ".format_string($lamstwo->name), "", "", true, + update_module_button($cm->id, $course->id, get_string("lesson","lamstwo")), navmenu($course, $cm)); + +echo ''; +echo '
'; +print_heading(format_string($lamstwo->name)); + +//$strlamstwos = get_string("modulenameplural", "lamstwo"); +//$strlamstwo = get_string("modulename", "lamstwo"); + +//print_header("$course->shortname: $lamstwo->name", "$course->fullname", +// "$navigation id>$strlamstwos -> $lamstwo->name", +// "", "", true, update_module_button($cm->id, $course->id, $strlamstwo), +// navmenu($course, $cm)); + +/// Print the main part of the page +if(isteacher($course->id,$USER->id)||isteacheredit($course->id,$USER->id)){ + $datetime = date("F d,Y g:i a"); + $plaintext = trim($datetime).trim($USER->username).trim($LAMS2CONSTANTS->monitor_method).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $hash = sha1(strtolower($plaintext)); + $url = $CFG->lamstwo_serverurl.$LAMS2CONSTANTS->login_request. + '?'.$LAMS2CONSTANTS->param_uid.'='.$USER->username. + '&'.$LAMS2CONSTANTS->param_method.'='.$LAMS2CONSTANTS->monitor_method. + '&'.$LAMS2CONSTANTS->param_timestamp.'='.urlencode($datetime). + '&'.$LAMS2CONSTANTS->param_serverid.'='.$CFG->lamstwo_serverid. + '&'.$LAMS2CONSTANTS->param_hash.'='.$hash. + '&'.$LAMS2CONSTANTS->param_lsid.'='.$lamstwo->lesson_id. + '&'.$LAMS2CONSTANTS->param_courseid.'='.$lamstwo->course. + '&'.$LAMS2CONSTANTS->param_country.'='.trim($USER->country). + '&'.$LAMS2CONSTANTS->param_lang.'='.substr(trim($USER->lang),0,2); + print_simple_box_start('center'); + echo ''.get_string("openmonitor", "lamstwo").''; + print_simple_box_end(); + + $plaintext = trim($datetime).trim($USER->username).trim($LAMS2CONSTANTS->learner_method).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $hash = sha1(strtolower($plaintext)); + $url = $CFG->lamstwo_serverurl.$LAMS2CONSTANTS->login_request. + '?'.$LAMS2CONSTANTS->param_uid.'='.$USER->username. + '&'.$LAMS2CONSTANTS->param_method.'='.$LAMS2CONSTANTS->learner_method. + '&'.$LAMS2CONSTANTS->param_timestamp.'='.urlencode($datetime). + '&'.$LAMS2CONSTANTS->param_serverid.'='.$CFG->lamstwo_serverid. + '&'.$LAMS2CONSTANTS->param_hash.'='.$hash. + '&'.$LAMS2CONSTANTS->param_lsid.'='.$lamstwo->lesson_id. + '&'.$LAMS2CONSTANTS->param_courseid.'='.$lamstwo->course. + '&'.$LAMS2CONSTANTS->param_country.'='.trim($USER->country). + '&'.$LAMS2CONSTANTS->param_lang.'='.substr(trim($USER->lang),0,2); + print_simple_box_start('center'); + echo ''.get_string("openlearner", "lamstwo").''; + print_simple_box_end(); +}else if(isstudent($course->id,$USER->id)){ + $datetime = date("F d,Y g:i a"); + $plaintext = trim($datetime).trim($USER->username).trim($LAMS2CONSTANTS->learner_method).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); + $hash = sha1(strtolower($plaintext)); + $url = $CFG->lamstwo_serverurl.$LAMS2CONSTANTS->login_request. + '?'.$LAMS2CONSTANTS->param_uid.'='.$USER->username. + '&'.$LAMS2CONSTANTS->param_method.'='.$LAMS2CONSTANTS->learner_method. + '&'.$LAMS2CONSTANTS->param_timestamp.'='.urlencode($datetime). + '&'.$LAMS2CONSTANTS->param_serverid.'='.$CFG->lamstwo_serverid. + '&'.$LAMS2CONSTANTS->param_hash.'='.$hash. + '&'.$LAMS2CONSTANTS->param_lsid.'='.$lamstwo->lesson_id. + '&'.$LAMS2CONSTANTS->param_courseid.'='.$lamstwo->course. + '&'.$LAMS2CONSTANTS->param_country.'='.trim($USER->country). + '&'.$LAMS2CONSTANTS->param_lang.'='.substr(trim($USER->lang),0,2); + print_simple_box_start('center'); + echo ''.get_string("openlearner", "lamstwo").''; + print_simple_box_end(); +} + +if ($lamstwo->introduction) { + print_simple_box(format_text($lamstwo->introduction), 'center', '70%', '', 5, 'generalbox', 'description'); + echo '
'; +} + + +/// Finish the page +echo '
'; + +/// Finish the page +print_footer($course); + +?> Index: temp_moodle_dev/lamstwo/yahoo.js =================================================================== diff -u --- temp_moodle_dev/lamstwo/yahoo.js (revision 0) +++ temp_moodle_dev/lamstwo/yahoo.js (revision c38e7385ccdf90536303d2299f492accdd29d869) @@ -0,0 +1 @@ +/* Copyright (c) 2006, Yahoo! Inc. All rights reserved. Code licensed under the BSD License: http://developer.yahoo.net/yui/license.txt version: 0.11.0 */ var YAHOO=window.YAHOO||{};YAHOO.namespace=function(ns){if(!ns||!ns.length){return null;}var _2=ns.split(".");var _3=YAHOO;for(var i=(_2[0]=="YAHOO")?1:0;i<_2.length;++i){_3[_2[i]]=_3[_2[i]]||{};_3=_3[_2[i]];}return _3;};YAHOO.log=function(_5,_6,_7){var l=YAHOO.widget.Logger;if(l&&l.log){return l.log(_5,_6,_7);}else{return false;}};YAHOO.extend=function(_9,_10){var f=function(){};f.prototype=_10.prototype;_9.prototype=new f();_9.prototype.constructor=_9;_9.superclass=_10.prototype;if(_10.prototype.constructor==Object.prototype.constructor){_10.prototype.constructor=_10;}};YAHOO.namespace("util");YAHOO.namespace("widget");YAHOO.namespace("example"); \ No newline at end of file