From: vyshane Date: Mon, 29 Jan 2007 02:22:18 +0000 (+0000) Subject: Merged from 1.7. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c4ca9cb3b208123ab85896718ec0b5e7bc718246;p=moodle.git Merged from 1.7. --- diff --git a/lib/ajax/ajaxlib.php b/lib/ajax/ajaxlib.php index cdb61508bb..e910176f24 100644 --- a/lib/ajax/ajaxlib.php +++ b/lib/ajax/ajaxlib.php @@ -100,7 +100,7 @@ class jsportal { * Prints the JavaScript code needed to set up AJAX for the course. */ function print_javascript($courseid, $return=false) { - global $CFG; + global $CFG, $USER; $blocksoutput = $output = ''; for ($i=0; $iblocks); $i++) { @@ -128,6 +128,7 @@ class jsportal { $output .= " main.portal.strings['deletecheck']='".get_string('deletecheck','','_var_')."';\n"; $output .= " main.portal.strings['resource']='".get_string('resource')."';\n"; $output .= " main.portal.strings['activity']='".get_string('activity')."';\n"; + $output .= " main.portal.strings['sesskey']='".$USER->sesskey."';\n"; $output .= " onloadobj.load();\n"; $output .= " main.process_blocks();\n"; $output .= ""; diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index 9256bf9de9..5848217ca9 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -766,17 +766,23 @@ resource_class.prototype.toggle_groupmode = function() { resource_class.prototype.delete_button = function() { + /* if (this.debug) { YAHOO.log("Deleting "+this.getEl().id+" from parent "+this.parentObj.getEl().id); } if (!confirm(main.getString('deletecheck', main.getString(this.is)+" "+this.id))) { return false; } - //this.getEl().parentNode.removeChild(this.getEl()); this.parentObj.remove_resource(this); - main.connect('DELETE', 'class=resource&id='+this.id); -} + */ + + // Not currently doing deletion by ajax because of unsolved problem in + // resource_class.remove_resource() + self.location = main.portal.strings['wwwroot']+"/course/mod.php?delete=" + +this.id+"&sesskey="+main.portal.strings['sesskey']+ + "&sr=" + this.parentObj.sectionId; +} resource_class.prototype.update_index = function(index) {