]> git.mjollnir.org Git - moodle.git/commitdiff
Use AJAX for weekly formats too. HOWEVER, there are some remaining
authormoodler <moodler>
Sat, 23 Sep 2006 14:38:01 +0000 (14:38 +0000)
committermoodler <moodler>
Sat, 23 Sep 2006 14:38:01 +0000 (14:38 +0000)
bugs with it so for now it only works in DEBUG_DEVELOPER mode

course/format/weeks/format.php

index f2646d219e444611ddb5f998dfbe41018d98746d..c54cefb7258579e9ff84f3d0263bbe9d9d1d43ae 100644 (file)
@@ -3,6 +3,7 @@
       // Included from "view.php"
 
     require_once("$CFG->dirroot/mod/forum/lib.php");
+    require_once($CFG->libdir.'/ajax/ajaxlib.php');
 
     $week = optional_param('week', -1, PARAM_INT);
 
         $strweekshow = get_string('weekshow', '', $strstudents);
         $strmoveup   = get_string('moveup');
         $strmovedown = get_string('movedown');
+
+        if (!empty($USER->ajax) && debugging('', DEBUG_DEVELOPER)) {   /// XXX TODO Debugging only temporary until fixed
+
+         // If user doesnt want AJAX, then they wont get it, 
+         // from here everything detects $COURSE->javascriptportal
+                               
+            $COURSE->javascriptportal = new jsportal();
+
+            print_require_js(array('yui_yahoo','yui_dom','yui_event','yui_dragdrop', 'yui_connection',
+                                   'ajaxcourse_blocks','ajaxcourse_sections','ajaxcourse'));
+            
+            //javascript logging facilities
+            if (debugging())  {
+                print_require_js(Array('yui_logger'));
+            }
+        }
     }
 
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
 
     echo '</tr></table>';
 
+    //create javascript portal code
+    if (!empty($COURSE->javascriptportal)) {
+        $COURSE->javascriptportal->print_javascript($course->id);
+    }
+
 ?>