mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
removed $SESSION->encoding now replaced by current_charset() and $CFG->unicodedb; 3rd party contribs must be fixed to be utf-8 and 1.6dev compatible anyway;
going to add a notice to wiki at http://docs.moodle.org/en/UTF-8_scripts
This commit is contained in:
parent
a3182bd7e7
commit
4f01826a27
@ -2791,8 +2791,6 @@ function set_login_session_preferences() {
|
||||
$SESSION->justloggedin = true;
|
||||
|
||||
unset($SESSION->lang);
|
||||
unset($SESSION->encoding);
|
||||
$SESSION->encoding = current_charset();
|
||||
|
||||
// Restore the calendar filters, if saved
|
||||
if (intval(get_user_preferences('calendar_persistflt', 0))) {
|
||||
|
@ -457,7 +457,6 @@ global $HTTPSPAGEREQUIRED;
|
||||
if (!detect_munged_arguments($lang, 0) and (file_exists($CFG->dataroot .'/lang/'. $lang) or
|
||||
file_exists($CFG->dirroot .'/lang/'. $lang))) {
|
||||
$SESSION->lang = $lang;
|
||||
$SESSION->encoding = get_string('thischarset');
|
||||
}
|
||||
}
|
||||
if (empty($CFG->lang)) {
|
||||
|
@ -1920,7 +1920,6 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta=
|
||||
if (!empty($CFG->courselang)) {
|
||||
moodle_setlocale();
|
||||
}
|
||||
$SESSION->encoding = $encoding;
|
||||
|
||||
$meta = '<meta http-equiv="content-type" content="text/html; charset='. $encoding .'" />'. "\n". $meta ."\n";
|
||||
if (!$usexml) {
|
||||
|
@ -676,24 +676,16 @@ class resource_ims extends resource_base {
|
||||
/// Configure links behaviour
|
||||
$fullurl = $CFG->wwwroot.'/mod/resource/view.php?r='.$resource->id.'&frameset=ims&page=';
|
||||
|
||||
/// Decide if we have to leave text in UTF-8, else convert to ISO-8859-1
|
||||
/// (interim solution until everything was migrated to UTF-8). Then we'll
|
||||
// delete this hack.
|
||||
$convert = true;
|
||||
if ($SESSION->encoding == 'UTF-8') {
|
||||
$convert = false;
|
||||
}
|
||||
|
||||
/// Iterate over items to build the menu
|
||||
$currlevel = 0;
|
||||
$currorder = 0;
|
||||
$endlevel = 0;
|
||||
foreach ($items as $item) {
|
||||
/// Convert text to ISO-8859-1 if specified (will remove this once utf-8 migration was complete- 1.6)
|
||||
if ($convert) {
|
||||
$item->title = utf8_decode($item->title);
|
||||
}
|
||||
|
||||
/// Convert text from UTF-8 to current charset if needed
|
||||
if (empty($CFG->unicodedb)) {
|
||||
$textlib = textlib_get_instance();
|
||||
$item->title = $textlib->convert($item->title, 'UTF-8', current_charset());
|
||||
}
|
||||
/// Skip pages until we arrive to $page
|
||||
if ($item->id < $page) {
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user