]> git.mjollnir.org Git - moodle.git/commitdiff
when inserting 'Give Up' button, if site encoding is not iso-8859-1, then set page...
authorgbateson <gbateson>
Fri, 11 May 2007 05:28:28 +0000 (05:28 +0000)
committergbateson <gbateson>
Fri, 11 May 2007 05:28:28 +0000 (05:28 +0000)
mod/hotpot/view.php

index 5f42d9c8a267346393916e07893eb0b86a1665e0..6a08acc69b384e1eb6a95c7a33e8957dd0e986fc 100644 (file)
                 break;
             } // end switch $framename
         break;
+        case HOTPOT_NAVIGATION_GIVEUP:
+            // replace charset , if necessary
+            // HotPots are plain ascii (iso-8859-1) with unicode chars encoded as HTML entities
+            $charset = get_string("thischarset");
+            if ($charset == 'iso-8859-1') {
+                // do nothing
+            } else {
+                $hp->html = preg_replace(
+                    '|<meta[^>]*charset=iso-8859-1[^>]*>|is', 
+                    '<meta http-equiv="Content-Type" content="text/html; charset='.$charset.'" />', 
+                    $hp->html
+                );
+            }
+            // no break (continue to print html to browser)
         default:
             // HOTPOT_NAVIGATION_BUTTONS
-            // HOTPOT_NAVIGATION_GIVEUP
             // HOTPOT_NAVIGATION_NONE
             if (!empty($available_msg)) {
                 $hp->insert_message('<!-- BeginTopNavButtons -->', $available_msg);