]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from 1.7.
authorvyshane <vyshane>
Mon, 29 Jan 2007 02:22:18 +0000 (02:22 +0000)
committervyshane <vyshane>
Mon, 29 Jan 2007 02:22:18 +0000 (02:22 +0000)
lib/ajax/ajaxlib.php
lib/ajax/section_classes.js

index cdb61508bbc6ed249f3f7d4f63a59f9f004427a4..e910176f24c31329c3b9cbbd7b4246840a8fbb67 100644 (file)
@@ -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; $i<count($this->blocks); $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 .= "</script>";
index 9256bf9de9a8e1d496fefdf5b2f3055e5371d7d8..5848217ca96ab57fd736d0bfcb2908a6b0c22537 100755 (executable)
@@ -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) {