this.icons = [];
this.courseformat = null;
this.marker = null;
+ this.numsections = null;
//things to process onload
onloadobj.add('main.process_document();');
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");
$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";