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

index 0ac21766728e3de5d4eff8144aed1821b61ccad6..e5c1ccacf1b4bd0c935f2802636bb633f432ba41 100644 (file)
@@ -244,6 +244,12 @@ function php_portal_class() {
     //flag for week fomat
     this.isWeek = false;
 
+    //client browser
+    this.clientIsIE = null;
+
+    //session key
+    this.sesskey = null;
+
     //strings    
     this.strings = [];
 
index e910176f24c31329c3b9cbbd7b4246840a8fbb67..ae7fa31695a6e7639b721d4c92263c8b1702f553 100644 (file)
@@ -115,6 +115,12 @@ class jsportal {
         $output .= "<script type=\"text/javascript\">\n";
         $output .= "   main.portal.id = ".$courseid.";\n";
         $output .= "    main.portal.blocks = new Array(".$blocksoutput.");\n";
+        $output .= "    main.portal.sesskey = \"".$USER->sesskey."\";\n";
+        if (check_browser_version('MSIE')) {
+            $output .= "    main.portal.clientIsIE = true;\n";
+        } else {
+            $output .= "    main.portal.clientIsIE = false;\n";
+        }
         $output .= "    main.portal.strings['wwwroot']='".$CFG->wwwroot."';\n";
         $output .= "    main.portal.strings['pixpath']='".$CFG->pixpath."';\n";
         $output .= "    main.portal.strings['move']='".get_string('move')."';\n";
index 5848217ca96ab57fd736d0bfcb2908a6b0c22537..3ecbc0280ca8e5b0b40bc07f81f60b320fd68812 100755 (executable)
@@ -766,22 +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;
+
+    if (!main.portal.clientIsIE) {
+        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.parentObj.remove_resource(this);
+        main.connect('DELETE', 'class=resource&id='+this.id);
+    } else {
+        // 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.sesskey+
+                        "&sr=" + this.parentObj.sectionId;
     }
-    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;
 }