]> git.mjollnir.org Git - moodle.git/commitdiff
remove duplicate id attribute from body tag; microincrement version to 2007040200...
authorgbateson <gbateson>
Fri, 4 May 2007 02:53:52 +0000 (02:53 +0000)
committergbateson <gbateson>
Fri, 4 May 2007 02:53:52 +0000 (02:53 +0000)
mod/hotpot/README.TXT
mod/hotpot/version.php
mod/hotpot/view.php

index 32ff96a2c0bda72923fab93d94cacf5de2ad4eb0..8c8d2abf4a879d8d6c70d6e9923ce3847c87dbf7 100644 (file)
@@ -1,5 +1,5 @@
 ==================================================
-This is v2.4.1 of the HotPot module for Moodle 1.9
+This is v2.4.2 of the HotPot module for Moodle 1.9
 ==================================================
 
    This module allows teachers to administer Hot Potatoes and TexToys quizzes via Moodle.
@@ -33,11 +33,11 @@ IMPORTANT NOTICE
 TO INSTALL OR UPDATE THE HOTPOT MODULE
 ======================================
 
-   You should install only this module by installing a complete Moodle 1.8 package. 
+   You should install only this module by installing a complete Moodle 1.9 package. 
 
    Similarly, the recommended way to upgrade this module is to upgrade to a complete Moodle 1.8 package. 
 
-   However, it is possible to download and unzip a complete Moodle 1.8 package and extract the "mod/hotpot" folder for use on your live Moodle 1.8 site.
+   However, it is possible to download and unzip a complete Moodle 1.9 package and extract the "mod/hotpot" folder for use on your live Moodle 1.8 site.
 
 ========================
 TO USE THE HOTPOT MODULE
index 19cdce0103eb55d91aaff6cd697aa442f46049cb..172f5be74bf04d7183a0647ac113678e83011a9b 100644 (file)
@@ -3,8 +3,8 @@
 ///  Code fragment to define the version of hotpot
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
-$module->version  = 2007020201;   // release date of this version (see note below)
-$module->release  = 'v2.4.1';    // human-friendly version name (used in mod/hotpot/lib.php)
+$module->version  = 2007040200;   // release date of this version (see note below)
+$module->release  = 'v2.4.2';    // human-friendly version name (used in mod/hotpot/lib.php)
 $module->requires = 2007020200;  // Requires this Moodle version
 $module->cron     = 0;            // period for cron to check this module (secs)
 // interpretation of YYYYMMDDXY version numbers
index 9d2f3b47789add3bb5c5c49f1fcc1a553293f153..9ec4861c1be5773887adda7bc35f15b62ec82416 100644 (file)
     }
     // insert hot-potatoes.js
     $hp->insert_script(HOTPOT_JS);
+    // get Moodle pageid and pageclass
+    $pageid = '';
+    $pageclass = '';
+    if (function_exists('page_id_and_class')) {
+        page_id_and_class($pageid, $pageclass);
+    }
     // extract first <head> tag
     $head = '';
     $pattern = '|<head([^>]*)>(.*?)</head>|is';
     if (preg_match_all($pattern, $head, $matches)) {
         $count = count($matches[0]);
         for ($i=0; $i<$count; $i++) {
-            $styles .= $matches[0][$i]."\n";
+            if ($pageid) {
+                $styles .= str_replace('TheBody', $pageid, $matches[0][$i])."\n";
+                       }
             $head = str_replace($matches[0][$i], '', $head);
         }
     }
     if (preg_match_all($pattern, $head, $matches)) {
         $count = count($matches[0]);
         for ($i=0; $i<$count; $i++) {
-            $scripts .= $matches[0][$i]."\n";
+            if ($pageid) {
+                $scripts .= str_replace('TheBody', $pageid, $matches[0][$i])."\n";
+                       }
             $head = str_replace($matches[0][$i], '', $head);
         }
     }
     // HP6 and some HP5 (v6 and v4) 
     if (preg_match('|<body'.'([^>]*'.'onLoad=(["\'])(.*?)(\\2)'.'[^>]*)'.'>(.*)</body>|is', $hp->html, $matches)) {
         $body = $matches[5]; // contents of first <body onload="StartUp()">...</body> block
-        $body_tags = $matches[1];
+        if ($pageid) {
+            $body_tags = str_replace(' id="TheBody"', '', $matches[1]);
+               }
         // workaround to ensure javascript onload routine for quiz is always executed
         //  $body_tags will only be inserted into the <body ...> tag
         //  if it is included in the theme/$CFG->theme/header.html,