diff --git a/main/newscorm/display_audiorecorder.php b/main/newscorm/display_audiorecorder.php index cf758dd337..120e57c947 100755 --- a/main/newscorm/display_audiorecorder.php +++ b/main/newscorm/display_audiorecorder.php @@ -24,7 +24,6 @@ if (isset($_SESSION['lpobject'])) { die('Could not instanciate lp object.'); } } -$charset = $_SESSION['oLP']->encoding; $lp_theme_css = $_SESSION['oLP']->get_theme(); $scorm_css_header = true; diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 1946b1f644..8966fea83f 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -82,6 +82,7 @@ class learnpath { * @return boolean True on success, false on error */ public function __construct($course, $lp_id, $user_id) { + $this->encoding = api_get_system_encoding(); // Chamilo 1.8.8: We intend always to use the system encoding. // Check params. // Check course code. if ($this->debug > 0) {error_log('New LP - In learnpath::__construct('.$course.','.$lp_id.','.$user_id.')', 0); } @@ -120,7 +121,7 @@ class learnpath { $row = Database::fetch_array($res); $this->type = $row['lp_type']; $this->name = stripslashes($row['name']); - $this->encoding = $row['default_encoding']; + //$this->encoding = $row['default_encoding']; // Chamilo 1.8.8: We intend not to use 'default_encoding' field anymore. $this->proximity = $row['content_local']; $this->theme = $row['theme']; $this->maker = $row['content_maker']; diff --git a/main/newscorm/learnpathList.class.php b/main/newscorm/learnpathList.class.php index 723e1b1a7e..3ea0678019 100755 --- a/main/newscorm/learnpathList.class.php +++ b/main/newscorm/learnpathList.class.php @@ -84,7 +84,8 @@ class learnpathList { 'lp_force_commit' => $row['force_commit'], 'lp_maker' => stripslashes($row['content_maker']), 'lp_proximity' => $row['content_local'], - 'lp_encoding' => $row['default_encoding'], + //'lp_encoding' => $row['default_encoding'], + 'lp_encoding' => api_get_system_encoding(), // Chamilo 1.8.8: We intend always to use the system encoding. 'lp_visibility' => $vis, 'lp_published' => $pub, 'lp_prevent_reinit' => $row['prevent_reinit'], diff --git a/main/newscorm/learnpath_functions.inc.php b/main/newscorm/learnpath_functions.inc.php index 7b4e96e46d..be7f76ff69 100755 --- a/main/newscorm/learnpath_functions.inc.php +++ b/main/newscorm/learnpath_functions.inc.php @@ -2111,15 +2111,9 @@ function createimsmanifest($circle1_files, $learnpath_id) { include_once '../metadata/md_funcs.php'; // RH: export metadata - // 1.1 Header - /* - $header=''."\n"; - */ - - // 1.2 + // Header // Charset should be dependent on content. - $mycharset = api_get_system_encoding(); - $header = ''."\n\n"; + $header = ''."\n\n"; $org .= xmltagwrite('metadata', 'open'); $org .= ' '.xmltagwrite('schema', 'full', 'ADL SCORM'); diff --git a/main/newscorm/lp_author_image.php b/main/newscorm/lp_author_image.php index 5d6303c5a3..d0526b2d75 100755 --- a/main/newscorm/lp_author_image.php +++ b/main/newscorm/lp_author_image.php @@ -23,7 +23,6 @@ if (isset($_SESSION['lpobject'])) { } } /* -$charset = $_SESSION['oLP']->encoding; $lp_theme_css = $_SESSION['oLP']->get_theme(); */ diff --git a/main/newscorm/lp_controller.php b/main/newscorm/lp_controller.php index 23d6bec58d..43628407b3 100755 --- a/main/newscorm/lp_controller.php +++ b/main/newscorm/lp_controller.php @@ -748,7 +748,6 @@ switch ($action) { $lp_id = $_SESSION['oLP']->get_id(); $list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id); $user_id = api_get_user_id(); - $stats_charset = $_SESSION['oLP']->encoding; require 'lp_stats.php'; } break; @@ -829,7 +828,6 @@ switch ($action) { $lp_id = $_SESSION['oLP']->get_id(); $list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id); $user_id = api_get_user_id(); - $stats_charset = $_SESSION['oLP']->encoding; header('location: '.api_get_path(WEB_COURSE_PATH).api_get_course_path().'/index.php'); } break; diff --git a/main/newscorm/lp_stats.php b/main/newscorm/lp_stats.php index bdcededd48..b88d0fa961 100755 --- a/main/newscorm/lp_stats.php +++ b/main/newscorm/lp_stats.php @@ -30,38 +30,20 @@ $session_condition = api_get_session_condition($session_id); //$lp_id = $_SESSION['oLP']->get_id(); //$list = $_SESSION['oLP']->get_flat_ordered_items_list($lp_id); //$user_id = $_user['user_id']; -//$stats_charset = $_SESSION['oLP']->encoding + if (!isset($origin)) $origin = ''; if ($origin != 'tracking') { - if (!empty ($stats_charset)) { - $lp_charset = $stats_charset; - } else { - $lp_charset = api_get_system_encoding(); - } - $charset = $lp_charset; //$w = $tablewidth -20; - $htmlHeadXtra[] = ''.''; include_once api_get_path(INCLUDE_PATH).'reduced_header.inc.php'; - echo ''; -} else { - // Get learning path's encoding. - $TBL_LP = Database :: get_course_table(TABLE_LP_MAIN); - $sql = "SELECT default_encoding FROM $TBL_LP " . - "WHERE id = '".(int)$_GET['lp_id']."'"; - $res = Database::query($sql); - if (Database :: num_rows($res) > 0) { - $row = Database::fetch_array($res); - $lp_charset = $row['default_encoding']; - } + echo ''; } -// The Chamilo interface's encoding -$dokeos_charset = api_get_system_encoding(); $output = ''; // if display in fullscreen required. if (!empty($_GET['fs']) && strcmp($_GET['fs'], 'true') == 0) { @@ -80,16 +62,16 @@ if ($origin == 'tracking') { } if (!empty ($_GET['extend_all'])) { - $extend_all_link = 'fold_view'; + $extend_all_link = 'fold_view'; $extend_all = 1; } else { - $extend_all_link = 'extend_view'; + $extend_all_link = 'extend_view'; } if ($origin != 'tracking') { - $output .= "
" . api_convert_encoding(get_lang('ScormMystatus'), $lp_charset, $dokeos_charset) . "
"; + $output .= "
" . get_lang('ScormMystatus') . "
"; } -$output .= " " . "" . "\n" . '' . '\n" . '\n" . '\n" . '\n"; +$output .= "" . "
' . $extend_all_link . '
' . api_convert_encoding(get_lang('ScormLessonTitle'), $lp_charset, $dokeos_charset) . "
' . api_convert_encoding(get_lang('ScormStatus'), $lp_charset, $dokeos_charset) . "
' . api_convert_encoding(get_lang('ScormScore'), $lp_charset, $dokeos_charset) . "
' . api_convert_encoding(get_lang('ScormTime'), $lp_charset, $dokeos_charset) . "
" . api_convert_encoding(get_lang('Actions'), $lp_charset, $dokeos_charset) . "
 
" . "\n" . '' . '\n" . '\n" . '\n" . '\n"; // Going through the items using the $items[] array instead of the database order ensures // we get them in the same order as in the imsmanifest file, which is rather random when using @@ -115,14 +97,14 @@ $counter = 0; $total_score = 0; $total_max_score = 0; $total_time = 0; -$h = api_convert_encoding(get_lang('h'), $lp_charset, $dokeos_charset); +$h = get_lang('h'); if (!empty($export_csv)) { $csv_content[] = array ( - api_convert_encoding(get_lang('ScormLessonTitle'), $lp_charset, $dokeos_charset), - api_convert_encoding(get_lang('ScormStatus'), $lp_charset, $dokeos_charset), - api_convert_encoding(get_lang('ScormScore'), $lp_charset, $dokeos_charset), - api_convert_encoding(get_lang('ScormTime'), $lp_charset, $dokeos_charset) + get_lang('ScormLessonTitle'), + get_lang('ScormStatus'), + get_lang('ScormScore'), + get_lang('ScormTime') ); } @@ -221,7 +203,7 @@ if (is_array($list) && count($list) > 0) { } $extend_link = ''; if (!empty($inter_num)) { - $extend_link = ''.api_convert_encoding(get_lang('HideAttemptView'), $lp_charset, $dokeos_charset).'' . "\n"; + $extend_link = ''.get_lang('HideAttemptView').'' . "\n"; } $title = $row['mytitle']; @@ -231,7 +213,6 @@ if (is_array($list) && count($list) > 0) { if ($row['item_type'] != 'dokeos_chapter') { $correct_test_link = '-'; - //api_convert_encoding($title, $lp_charset, $lp_charset) $title = Security::remove_XSS($title); $output .= "\n" . "\n" . '\n" . '' . "\n" . '' . "\n" . '' . "\n" . "\n"; } @@ -247,10 +228,10 @@ if (is_array($list) && count($list) > 0) { if (!empty ($_GET['extend_attempt_id']) && $_GET['extend_attempt_id'] == $row['iv_id']) { // The extend button for this attempt has been clicked. $extend_this_attempt = 1; - $extend_attempt_link = ''.api_convert_encoding(get_lang('HideAttemptView'), $lp_charset, $dokeos_charset).'' . "\n"; + $extend_attempt_link = ''.get_lang('HideAttemptView').'' . "\n"; } else { // Same case if fold_attempt_id is set, so not implemented explicitly. // The extend button for this attempt has not been clicked. - $extend_attempt_link = ''.api_convert_encoding(get_lang('ExtendAttemptView'), $lp_charset, $dokeos_charset).'' . "\n"; + $extend_attempt_link = ''.get_lang('ExtendAttemptView').'' . "\n"; } } @@ -298,7 +279,7 @@ if (is_array($list) && count($list) > 0) { 'not attempted' => 'ScormNotAttempted' ); - $my_lesson_status = api_convert_encoding(get_lang($mylanglist[$lesson_status]), $lp_charset, $dokeos_charset); + $my_lesson_status = get_lang($mylanglist[$lesson_status]); if ($row['item_type'] != 'dokeos_chapter') { if (!$is_allowed_to_edit && $result_disabled_ext_all) { @@ -306,8 +287,7 @@ if (is_array($list) && count($list) > 0) { } else { $view_score = ($score == 0 ? '/' : ($maxscore === 0 ? $score : $score . '/' . float_format($maxscore, 1))); } - $output .= "\n" . "\n" . "\n" . '\n" - //."\n" + $output .= "\n" . "\n" . "\n" . '\n" . '\n" . '\n" . ''; if (!empty($export_csv)) { @@ -353,9 +333,7 @@ if (is_array($list) && count($list) > 0) { $student_response = implode(',',$content_student_response); } $output .= "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" - //."\n" . '\n" - //.'\n" . '\n" . '\n" . '\n" . '\n\n\n"; $counter++; } @@ -405,10 +383,10 @@ if (is_array($list) && count($list) > 0) { if (!empty ($_GET['extend_attempt_id']) && $_GET['extend_attempt_id'] == $row['iv_id']) { // The extend button for this attempt has been clicked. $extend_this_attempt = 1; - $extend_attempt_link = ''.api_convert_encoding(get_lang('HideAttemptView'),$lp_charset,$charset).'' . "\n"; + $extend_attempt_link = ''.get_lang('HideAttemptView').'' . "\n"; } else { // Same case if fold_attempt_id is set, so not implemented explicitly. // The extend button for this attempt has not been clicked. - $extend_attempt_link = ''.api_convert_encoding(get_lang('ExtendAttemptView'),$lp_charset,$charset).'' . "\n"; + $extend_attempt_link = ''.get_lang('ExtendAttemptView').'' . "\n"; } } @@ -420,7 +398,7 @@ if (is_array($list) && count($list) > 0) { //$extend_link = 'extend_disabled'; $extend_link = ''; if ($inter_num > 1) { - $extend_link = ''.api_convert_encoding(get_lang('ExtendAttemptView'),$lp_charset,$charset).''; + $extend_link = ''.get_lang('ExtendAttemptView').''; } if (($counter % 2) == 0) { $oddclass = 'row_odd'; @@ -524,7 +502,7 @@ if (is_array($list) && count($list) > 0) { 'not attempted' => 'ScormNotAttempted', ); - $my_lesson_status = api_convert_encoding(get_lang($mylanglist[$lesson_status]), $lp_charset, $dokeos_charset); + $my_lesson_status = get_lang($mylanglist[$lesson_status]); if ($row['item_type'] != 'dokeos_chapter') { if ($row['item_type'] == 'quiz') { @@ -542,10 +520,10 @@ if (is_array($list) && count($list) > 0) { $num = Database :: num_rows($resultLastAttempt); if ($num > 0) { if (isset($_GET['extend_attempt']) && $_GET['extend_attempt'] == 1 && (isset($_GET['lp_id']) && $_GET['lp_id'] == $my_lp_id) && (isset($_GET['my_lp_id']) && $_GET['my_lp_id'] == $my_id) ) { - $correct_test_link = 'fold_view'; + $correct_test_link = 'fold_view'; $extend_attempt = 1; } else { - $correct_test_link = 'extend_view'; + $correct_test_link = 'extend_view'; } } else { $correct_test_link = '-'; @@ -554,7 +532,6 @@ if (is_array($list) && count($list) > 0) { $correct_test_link = '-'; } - //."\n" $title = Security::remove_XSS($title); if ( (isset($_GET['lp_id']) && $_GET['lp_id'] == $my_lp_id ) && (isset($_GET['my_lp_id']) && $_GET['my_lp_id'] == $my_id)) { $output .= "\n" . "\n" . '' . "\n"; @@ -585,8 +562,8 @@ if (is_array($list) && count($list) > 0) { if (!empty($export_csv)) { $temp = array (); - $temp[] = api_html_entity_decode($title, ENT_QUOTES, $lp_charset); - $temp[] = api_html_entity_decode($my_lesson_status, ENT_QUOTES, $lp_charset); + $temp[] = api_html_entity_decode($title, ENT_QUOTES); + $temp[] = api_html_entity_decode($my_lesson_status, ENT_QUOTES); if ($row['item_type'] == 'quiz') { @@ -614,9 +591,7 @@ if (is_array($list) && count($list) > 0) { $oddclass = 'row_even'; } $output .= "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" - //."\n" . '\n" - //.'\n" . '\n" . '\n" . '\n" . '\n\n\n"; $counter++; } @@ -672,19 +647,19 @@ if (is_array($list) && count($list) > 0) { //$view_score = ($my_score == 0 ? '0.00/'.$my_maxscore : ($my_maxscore == 0 ? $my_score : $my_score . '/' . $my_maxscore)); } $time_attemp; - $output .= '' + $output .= '' . ''; if ($origin != 'tracking') { if (!$is_allowed_to_edit && $result_disabled_ext_all) { - $output .= ''; + $output .= ''; } else { - $output .= ''; + $output .= ''; } } else { if (!$is_allowed_to_edit && $result_disabled_ext_all ) { - $output .= ''; + $output .= ''; } else { - $output .= ''; + $output .= ''; } } $output .= ''; @@ -752,7 +727,7 @@ if (($counter % 2) == 0) { } if (empty($extend_all)) { - $output .= "\n" . "\n" . '\n" + $output .= "\n" . "\n" . '\n" . '' . "\n" . '\n" . '' . "\n" . "\n"; } @@ -767,7 +742,7 @@ if (!empty($export_csv)) { ); $csv_content[] = $temp; $temp = array ( - api_convert_encoding(get_lang('AccomplishedStepsTotal') , $lp_charset, $dokeos_charset), + get_lang('AccomplishedStepsTotal'), '', $final_score, $total_time diff --git a/main/newscorm/lp_toc.php b/main/newscorm/lp_toc.php index a6435b10f9..84bc1ed2b6 100755 --- a/main/newscorm/lp_toc.php +++ b/main/newscorm/lp_toc.php @@ -29,7 +29,6 @@ if (isset($_SESSION['lpobject'])) { die('Could not instanciate lp object'); } } -$charset = $_SESSION['oLP']->encoding; $htmlHeadXtra[] = '
' . $extend_all_link . '
' . get_lang('ScormLessonTitle') . "
' . get_lang('ScormStatus') . "
' . get_lang('ScormScore') . "
' . get_lang('ScormTime') . "
" .get_lang('Actions') . "
$extend_link
' . $title . "
$extend_attempt_link' . api_convert_encoding(get_lang('Attempt'), $lp_charset, $dokeos_charset) . ' ' . $row['iv_view_count'] . "
".api_htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."
$extend_attempt_link' . get_lang('Attempt') . ' ' . $row['iv_view_count'] . "
' . $my_lesson_status . "
' . $view_score . "
'.$time.'
 ' . $interaction['order_id'] . '' . $interaction['id'] . '
".api_convert_encoding($array_status[$lesson_status],$lp_charset,$lp_charset)."
' . $interaction['type'] . "'.$interaction['correct_responses']."' . $student_response . "' . $interaction['result'] . "' . $interaction['latency'] . "' . $interaction['time'] . "
".api_htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."
$extend_link
' .$title. '
 ' . $interaction['order_id'] . '' . $interaction['id'] . '
"api_convert_encoding($array_status[$lesson_status],$lp_charset,$lp_charset)."
' . $interaction['type'] . "'.$interaction['correct_responses']."' . urldecode($interaction['student_response']) . "' . $interaction['result'] . "' . $interaction['latency'] . "' . $interaction['time'] . "
 '.$extend_attempt_link.'' . api_convert_encoding(get_lang('Attempt'), $lp_charset, $dokeos_charset) . ' ' . $n . '
 '.$extend_attempt_link.'' . get_lang('Attempt') . ' ' . $n . '
' . $my_lesson_status . '
' . $view_score . '
' . $time_attemp . '
'.api_convert_encoding(get_lang('ShowAttempt'), $lp_charset, $dokeos_charset).''.get_lang('ShowAttempt').''.api_convert_encoding(get_lang('ShowAttempt'), $lp_charset, $dokeos_charset).''.get_lang('ShowAttempt').''.api_convert_encoding(get_lang('ShowAndQualifyAttempt'), $lp_charset, $dokeos_charset).''.get_lang('ShowAndQualifyAttempt').''.api_convert_encoding(get_lang('ShowAndQualifyAttempt'), $lp_charset, $dokeos_charset).''.get_lang('ShowAndQualifyAttempt').'
' . api_convert_encoding(get_lang('AccomplishedStepsTotal') , $lp_charset, $dokeos_charset) . "
' . get_lang('AccomplishedStepsTotal') . "
' . $final_score . "
' . $total_time . '