diff --git a/lib/ajax/ajaxcourse.js b/lib/ajax/ajaxcourse.js index 32743f61d1f..79b5ba1227f 100644 --- a/lib/ajax/ajaxcourse.js +++ b/lib/ajax/ajaxcourse.js @@ -59,8 +59,10 @@ function main_class() { this.leftcolumn = null; this.rightcolumn = null; this.adminBlock = null; + this.tempBlock = null; this.icons = []; this.marker = null; + this.courseformat = null; //things to process onload onloadobj.add('main.process_document();'); @@ -116,6 +118,7 @@ main_class.prototype.process_document = function() { //process sections var ct = 0; + this.courseformat = this.portal.courseformat; 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'); @@ -132,6 +135,7 @@ main_class.prototype.process_document = function() { } this.adminBlock = YAHOO.util.Dom.getElementsByClassName('block_adminblock')[0]; + this.tempBlock = YAHOO.util.Dom.getElementsByClassName('tempblockhandler')[0]; YAHOO.log("admin - "+this.adminBlock.className); } diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index e6ca8625414..185d91f6bab 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -145,7 +145,7 @@ class jsportal { * Prints the JavaScript code needed to set up AJAX for the course. */ function print_javascript($courseid, $return=false) { - global $CFG, $USER; + global $CFG, $USER, $COURSE; $blocksoutput = $output = ''; for ($i=0; $iblocks); $i++) { @@ -160,6 +160,7 @@ class jsportal { $output .= "