mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
when inserting 'Give Up' button, if site encoding is not iso-8859-1, then set page encoding to get_string('thischarset')
This commit is contained in:
parent
f8895a0de5
commit
8e4b3a8cd8
1 changed files with 14 additions and 1 deletions
|
@ -440,9 +440,22 @@
|
||||||
break;
|
break;
|
||||||
} // end switch $framename
|
} // end switch $framename
|
||||||
break;
|
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:
|
default:
|
||||||
// HOTPOT_NAVIGATION_BUTTONS
|
// HOTPOT_NAVIGATION_BUTTONS
|
||||||
// HOTPOT_NAVIGATION_GIVEUP
|
|
||||||
// HOTPOT_NAVIGATION_NONE
|
// HOTPOT_NAVIGATION_NONE
|
||||||
if (!empty($available_msg)) {
|
if (!empty($available_msg)) {
|
||||||
$hp->insert_message('<!-- BeginTopNavButtons -->', $available_msg);
|
$hp->insert_message('<!-- BeginTopNavButtons -->', $available_msg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue