[svn r20465] FS#306 - The "Courses" tool again: Improvements for better encoding support.

skala
Ivan Tcholakov 16 years ago
parent 8e32a72e5b
commit 5060ac0676
  1. 10
      main/newscorm/learnpath_functions.inc.php
  2. 2
      main/newscorm/lp_controller.php
  3. 7
      main/newscorm/lp_log.php
  4. 6
      main/newscorm/lp_message.php
  5. 4
      main/newscorm/lp_save.php
  6. 4
      main/newscorm/lp_stats.php
  7. 4109
      main/newscorm/resourcelinker.inc.php
  8. 4
      main/newscorm/resourcelinker.php

@ -577,7 +577,7 @@ function display_learnpath_chapters($parent_item_id = 0, $tree = array (), $leve
$number_items2 = Database::num_rows($result_items2);
if ($number_items2 == 0)
{
echo $lang_prereq_deleted_error;
echo get_lang('prereq_deleted_error');
}
$row_items2 = mysql_fetch_array($result_items2);
display_addedresource_link_in_learnpath($row_items2["item_type"], $row_items2["ref"], '', $row_items2["id"], 'builder', '', 0);
@ -2410,6 +2410,7 @@ 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,7 +2426,8 @@ function createimsmanifest($circle1_files, $learnpath_id)
//1.2
//charset should be dependent on content
$mycharset = 'ISO-8859-1';
//$mycharset = 'ISO-8859-1';
$mycharset = $charset;
$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');
@ -2537,8 +2539,8 @@ function createimsmanifest($circle1_files, $learnpath_id)
$mds = new mdstore(TRUE); // RH: export metadata; if no table, create it
if (($mdt = $mds->mds_get($row['item_type'].'.'.$row['item_id'])))
if (($mdo = strpos($mdt, '<metadata>')) && ($mdc = strpos($mdt, '</metadata>')))
$org .= " ".substr($mdt, $mdo, $mdc - $mdo +11)."\n";
if (($mdo = api_strpos($mdt, '<metadata>')) && ($mdc = api_strpos($mdt, '</metadata>')))
$org .= " ".api_substr($mdt, $mdo, $mdc - $mdo +11)."\n";
$org .= " ".xmltagwrite('item', 'close');
$i ++;

@ -843,4 +843,4 @@ if(!empty($_SESSION['oLP'])){
$_SESSION['lpobject'] = serialize($_SESSION['oLP']);
if($debug>0) error_log('New LP - lpobject is serialized in session',0);
}
?>
?>

@ -19,7 +19,10 @@
//flag to allow for anonymous user - needs to be set before global.inc.php
$use_anonymous = true;
require_once('back_compat.inc.php');
$charset = 'ISO-8859-1';
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
$htmlHeadXtra[] = '<script language="javascript">
function cleanlog(){
if(document.getElementById){
@ -38,4 +41,4 @@ include_once('../inc/reduced_header.inc.php');
</div>
<div style="color: white;" onclick="cleanlog();">.</div>
</body>
</html>
</html>

@ -33,7 +33,9 @@ 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);}
$charset = 'ISO-8859-1';
if (empty($charset)) {
$charset = 'ISO-8859-15';
}
$htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript">
var dokeos_xajax_handler = window.parent.oxajax;
@ -50,4 +52,4 @@ session_write_close();
echo $error;
?>
</div>
</body></html>
</body></html>

@ -12,7 +12,7 @@
* Switching within the field to update
*/
$msg = $_SESSION['oLP']->get_message();
$charset = 'ISO-8859-1'; //not taken into account here as we don't include a header
$charset = 'ISO-8859-15'; //not taken into account here as we don't include a header
error_log('New LP - Loaded lp_save : '.$_SERVER['REQUEST_URI'].' from '.$_SERVER['HTTP_REFERER'],0);
?>
<!DOCTYPE html
@ -30,4 +30,4 @@ if($_SESSION['oLP']->mode != 'fullscreen'){
</head>
<body>
</body></html>
</body></html>

@ -243,7 +243,7 @@ foreach ($list as $my_item_id) {
$extend_link = '<a href="' . api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix . '"><img src="../img/visible.gif" alt="'.get_lang('HideAttemptView').'" title="'.get_lang('HideAttemptView').'" border="0"></a>' . "\n";
}
$title = $row['mytitle'];
$title = stripslashes(html_entity_decode($title, ENT_QUOTES, $dokeos_charset));
$title = stripslashes(api_html_entity_decode($title, ENT_QUOTES, $dokeos_charset));
if (empty ($title)) {
$title = rl_get_resource_name(api_get_course_id(), $lp_id, $row['myid']);
@ -251,7 +251,7 @@ foreach ($list as $my_item_id) {
if ($row['item_type'] != 'dokeos_chapter') {
$correct_test_link = '-';
$output .= "<tr class='$oddclass'>\n" . "<td>$extend_link</td>\n" . '<td colspan="4" class="content"><div class="mystatus">' . htmlentities($title, ENT_QUOTES, $lp_charset) . "</div></td>\n" . '<td colspan="2" class="content"></td>' . "\n" . '<td colspan="2" class="content"></td>' . "\n" . '<td colspan="2" class="content"></td><td class="content"></td>' . "\n" . "</tr>\n";
$output .= "<tr class='$oddclass'>\n" . "<td>$extend_link</td>\n" . '<td colspan="4" class="content"><div class="mystatus">' . api_htmlentities($title, ENT_QUOTES, $lp_charset) . "</div></td>\n" . '<td colspan="2" class="content"></td>' . "\n" . '<td colspan="2" class="content"></td>' . "\n" . '<td colspan="2" class="content"></td><td class="content"></td>' . "\n" . "</tr>\n";
}
$counter++;

File diff suppressed because it is too large Load Diff

@ -701,11 +701,11 @@ if ($from_learnpath != 'yes')
if ($from_learnpath != 'yes')
{
echo "<form method=\"post\" action=\"{$_SESSION['origintoolurl']}\" style=\"margin: 0px;\"><input type=\"submit\" value=\"".get_lang('Ok')."\"></form>";
echo "<form method=\"post\" action=\"{$_SESSION['origintoolurl']}\" style=\"margin: 0px;\"><input type=\"submit\" value=\"".' '.get_lang('Ok').' '."\"></form>";
}
else
{
echo "<form method=\"get\" action=\"lp_controller.php\" style=\"margin: 0px;\"><input type=\"hidden\" name=\"lp_id\" value=\"".htmlentities($learnpath_id)."\"><input type=\"hidden\" name=\"action\" value=\"admin_view\"><input type=\"submit\" value=\"".get_lang('Ok')."\"></form>";
echo "<form method=\"get\" action=\"lp_controller.php\" style=\"margin: 0px;\"><input type=\"hidden\" name=\"lp_id\" value=\"".htmlentities($learnpath_id)."\"><input type=\"hidden\" name=\"action\" value=\"admin_view\"><input type=\"submit\" value=\"".' '.get_lang('Ok').' '."\"></form>";
}
?>

Loading…
Cancel
Save