course/view MDL-10142 AJAX move functionality on section content

This commit is contained in:
Rossiani Wijaya 2009-10-30 08:02:16 +00:00
parent dc01eb84f2
commit b1b4c2d75f
2 changed files with 16 additions and 9 deletions

View File

@ -63,6 +63,7 @@ function main_class() {
this.icons = [];
this.courseformat = null;
this.marker = null;
this.numsections = null;
//things to process onload
onloadobj.add('main.process_document();');
@ -117,17 +118,22 @@ main_class.prototype.process_document = function() {
this.rightcolumn = new column_class('right-column', "blocks", null, 'r');
//process sections
var ct = 0;
while (document.getElementById('section-'+ct) != null) {
this.sections[ct] = new section_class('section-'+ct, "sections", null, ct!=0?true:false);
this.sections[ct].addToGroup('resources');
if (ct > 0) {
var sectiontitle = YAHOO.util.Selector.query('#section-'+ct+' h3.weekdates')[0];
if (undefined !== sectiontitle) { // Only save date for weekly format
this.sectiondates[ct] = sectiontitle.innerHTML;
//var ct = 0;
//while (document.getElementById('section-'+ct) != null) {
var maxct = this.portal.numsections;
this.courseformat = this.portal.courseformat;
for(var ct=0; ct <= maxct; ct++){
if(document.getElementById('section-'+ct) != null) {
this.sections[ct] = new section_class('section-'+ct, "sections", null, ct!=0?true:false);
this.sections[ct].addToGroup('resources');
if (ct > 0) {
var sectiontitle = YAHOO.util.Selector.query('#section-'+ct+' h3.weekdates')[0];
if (undefined !== sectiontitle) { // Only save date for weekly format
this.sectiondates[ct] = sectiontitle.innerHTML;
}
}
}
ct++;
//ct++;
}
if (this.debug) {
YAHOO.log("Processed "+ct+" sections");

View File

@ -1398,6 +1398,7 @@ class jsportal {
$output .= " main.portal.strings['wwwroot']='".$CFG->wwwroot."';\n";
$output .= " main.portal.strings['marker']='".get_string('markthistopic', '', '_var_')."';\n";
$output .= " main.portal.strings['marked']='".get_string('markedthistopic', '', '_var_')."';\n";
$output .= " main.portal.numsections = ".$COURSE->numsections.";\n";
$output .= " main.portal.strings['hide']='".get_string('hide')."';\n";
$output .= " main.portal.strings['hidesection']='".get_string('hidesection', '', '_var_')."';\n";
$output .= " main.portal.strings['show']='".get_string('show')."';\n";