Feature #272 - Various encoding-related corrections.

skala
Ivan Tcholakov 15 years ago
parent e402ddf9cf
commit f3011085a0
  1. 3
      main/announcements/announcements.php
  2. 2
      main/exercice/exercice.php
  3. 3
      main/exercice/exercice_submit.php
  4. 3
      main/exercice/exercise_result.php
  5. 13
      main/inc/lib/main_api.lib.php
  6. 5
      main/newscorm/learnpath.class.php
  7. 9
      main/newscorm/learnpath_functions.inc.php
  8. 2
      main/newscorm/lp_list.php
  9. 3
      main/newscorm/lp_log.php
  10. 3
      main/newscorm/lp_message.php
  11. 5
      main/newscorm/lp_view.php

@ -719,9 +719,6 @@ if (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_ed
$mail_body .= "<br /> \n<a href=\"".api_get_path(WEB_COURSE_PATH).$_course['id']."\">";
$mail_body .= $_course['official_code'].' '.$_course['name'] . "</a>";
//set the charset and use it for the encoding of the email - small fix, not really clean (should check the content encoding origin first)
//here we use the encoding used for the webpage where the text is encoded (ISO-8859-1 in this case)
$recipient_name = api_get_person_name($myrow["firstname"], $myrow["lastname"], null, PERSON_NAME_EMAIL_ADDRESS);
$mailid = $myrow["email"];

@ -333,7 +333,7 @@ if ($show == 'result' && $_REQUEST['comments'] == 'update' && ($is_allowedToEdit
$headers .= "User-Agent: Dokeos/1.6";
$headers .= "Content-Transfer-Encoding: 7bit";
$headers .= 'From: ' . $from_name . ' <' . $from . '>' . "\r\n";
$headers = "From:$from_name\r\nReply-to: $to\r\nContent-type: text/html; charset=" . ($charset ? $charset : 'ISO-8859-15');
$headers = "From:$from_name\r\nReply-to: $to";
//mail($emailid, $subject, $mess,$headers);
@api_mail_html($emailid, $emailid, $subject, $mess, $from_name, $from);

@ -1016,9 +1016,6 @@ if ($origin != 'learnpath') { //so we are not in learnpath tool
Display :: display_warning_message(get_lang('SessionIsReadOnly'));
}
} else {
if (empty ($charset)) {
$charset = 'ISO-8859-15';
}
/*
* HTML HEADER
*/

@ -271,9 +271,6 @@ if ($origin != 'learnpath') {
Display::display_header($nameTools,"Exercise");
} else {
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
header('Content-Type: text/html; charset='. $charset);
@$document_language = api_get_language_isocode($language_interface);

@ -3677,18 +3677,7 @@ function replace_dangerous_char($filename, $strict = 'loose') {
$system_encoding = api_get_file_system_encoding();
//comment because (see support.dokeos.com/issues/5596)
// Compatibility: we keep the previous behaviour (Dokeos 1.8.6) for Latin 1 platforms (ISO-8859-15, ISO-8859-1, WINDOWS-1252, ...).
//if (api_is_latin1($system_encoding)) {
// $filename = ereg_replace("\.+$", "", substr(strtr(ereg_replace(
// "[^!-~\x80-\xFF]", "_", trim($filename)), '\/:*?"<>|\'',
// /* Keep C1 controls for UTF-8 streams */ '-----_---_'), 0, 250));
// if ($strict != 'strict') return $filename;
// return ereg_replace("[^!-~]", 'x', $filename);
// }
// For other platform encodings and various languages we use transliteration to ASCII filename string.
// Transliteration to ASCII filename string.
if (!api_is_valid_utf8($filename)) {
// Here we need to convert the file name to UTF-8 string first. We will try to guess the input encoding.
$input_encoding = api_get_file_system_encoding();

@ -2194,9 +2194,8 @@ class learnpath {
$progress_height = '16';
$size = str_replace('%', '', $percentage);
$output = ''
//.htmlentities(get_lang('ScormCompstatus'),ENT_QUOTES,'ISO-8859-1')."<br />"
. '<table border="0" cellpadding="0" cellspacing="0"><tr><td>' .
$output =
'<table border="0" cellpadding="0" cellspacing="0"><tr><td>' .
'<img id="progress_img_limit_left" src="' . $css_path . 'bar_1.gif" width="1" height="' . $progress_height . '">' .
'<img id="progress_img_full" src="' . $css_path . 'bar_1u.gif" width="' . $size * $factor . 'px" height="' . $progress_height . '" id="full_portion">' .
'<img id="progress_img_limit_middle" src="' . $css_path . 'bar_1m.gif" width="1" height="' . $progress_height . '">';

@ -1957,7 +1957,10 @@ function exportitem($id, $item_id, $item_type, $add_scorm_communications = false
case "Introduction_text" :
//1 Get the introduction text data from the database
$TBL_INTRO = Database :: get_course_tool_intro_table();
$result = Database::query("SELECT * FROM ".$TBL_INTRO." WHERE id=1");
// Modified by Ivan Tcholakov, 15-SEP-2008.
//$result = Database::query("SELECT * FROM ".$TBL_INTRO." WHERE id=1");
$result = Database::query("SELECT * FROM ".$TBL_INTRO." WHERE id='course_homepage'", __FILE__, __LINE__);
//
$myrow = Database::fetch_array($result);
$intro = $myrow["intro_text"];
//2 Write introduction text to the export string
@ -2409,7 +2412,6 @@ function xmltagwrite($tagname, $which, $data, $linebreak = "yes")
*/
function createimsmanifest($circle1_files, $learnpath_id)
{
global $charset;
global $_course, $LPname, $expdir, $LPnamesafe;
//$tbl_learnpath_main, $tbl_learnpath_chapter, $tbl_learnpath_item,
$tbl_learnpath_main = Database :: get_course_table(TABLE_LEARNPATH_MAIN);
@ -2425,8 +2427,7 @@ function createimsmanifest($circle1_files, $learnpath_id)
//1.2
//charset should be dependent on content
//$mycharset = 'ISO-8859-1';
$mycharset = $charset;
$mycharset = api_get_system_encoding();
$header = '<?xml version="1.0" encoding="'.$mycharset.'"?>'."\n<manifest identifier='".$LPnamesafe."' version='1.1'\n xmlns='http://www.imsproject.org/xsd/imscp_rootv1p1p2'\n xmlns:adlcp='http://www.adlnet.org/xsd/adlcp_rootv1p2'\n xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'\n xsi:schemaLocation='http://www.imsproject.org/xsd/imscp_rootv1p1p2 imscp_rootv1p1p2.xsd\n http://www.imsglobal.org/xsd/imsmd_rootv1p2p1 imsmd_rootv1p2p1.xsd\n http://www.adlnet.org/xsd/adlcp_rootv1p2 adlcp_rootv1p2.xsd'>\n";
$org .= xmltagwrite('metadata', 'open');

@ -27,8 +27,6 @@ $display_progress_bar = true;
require_once('learnpathList.class.php');
require_once('learnpath.class.php');
require_once('learnpathItem.class.php');
//$charset = 'UTF-8';
//$charset = 'ISO-8859-1';
/**
* Display initialisation and security checks

@ -19,9 +19,6 @@
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
require_once('back_compat.inc.php');
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
$htmlHeadXtra[] = '<script language="javascript">
function cleanlog(){

@ -33,9 +33,6 @@ if(isset($_SESSION['lpobject'])){
$display_mode = $_SESSION['oLP']->mode;
}
if($debug>0){error_log('New LP - Loaded lp_message : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'],0);}
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax;

@ -47,8 +47,6 @@ if ($is_allowed_in_course == false) api_not_allowed();
Variables
-----------------------------------------------------------
*/
//$charset = 'UTF-8';
//$charset = 'ISO-8859-1';
// we set the encoding of the lp
if (!empty($_SESSION['oLP']->encoding)) {
@ -56,9 +54,6 @@ if (!empty($_SESSION['oLP']->encoding)) {
} else {
$charset = api_get_system_encoding();
}
if (empty($charset)) {
$charset = 'ISO-8859-1';
}
$oLearnpath = false;
$course_code = api_get_course_id();

Loading…
Cancel
Save