[svn r20852] Save items to the DB with the lp charset, showing the LP items in the platform charset see FS#4208

skala
Julio Montoya 16 years ago
parent 5a3d908018
commit b0370d8d94
  1. 12734
      main/newscorm/learnpath.class.php
  2. 12
      main/newscorm/lp_admin_view.php
  3. 8
      main/newscorm/lp_build.php
  4. 4
      main/newscorm/lp_edit.php
  5. 26
      main/newscorm/lp_edit_item.php
  6. 2
      main/newscorm/lp_list.php
  7. 20
      main/newscorm/lp_stats.php
  8. 38
      main/newscorm/lp_view.php

File diff suppressed because it is too large Load Diff

@ -203,19 +203,15 @@ switch($_GET['action'])
if (isset($_POST['save_audio']))
{
// deleting the audio fragments
foreach ($_POST as $key=>$value)
{
if (substr($key,0,9) == 'removemp3')
{
$lp_items_to_remove_audio[] = str_ireplace('removemp3','',$key);
foreach ($_POST as $key=>$value) {
if (substr($key,0,9) == 'removemp3') {
$lp_items_to_remove_audio[] = str_ireplace('removemp3','',$key);
// removing the audio from the learning path item
$tbl_lp_item = Database::get_course_table('lp_item');
$in = implode(',',$lp_items_to_remove_audio);
}
}
if (count($lp_items_to_remove_audio)>0)
{
if (count($lp_items_to_remove_audio)>0) {
$sql = "UPDATE $tbl_lp_item SET audio = '' WHERE id IN (".$in.")";
$result = api_sql_query($sql, __FILE__, __LINE__);
}

@ -158,7 +158,6 @@ if (!empty($gradebook) && $gradebook=='view') {
);
}
$interbreadcrumb[]= array ("url"=>"lp_controller.php?action=list", "name"=> get_lang("_learning_path"));
$interbreadcrumb[]= array ("url"=>api_get_self()."?action=build&lp_id=$learnpath_id", "name" => stripslashes("{$therow['name']}"));
//Theme calls
@ -166,7 +165,6 @@ $lp_theme_css=$_SESSION['oLP']->get_theme();
$show_learn_path=true;
Display::display_header(null,'Path');
//api_display_tool_title($therow['name']);
$suredel = trim(get_lang('AreYouSureToDelete'));
@ -211,8 +209,7 @@ echo '<table cellpadding="0" cellspacing="0" class="lp_build">';
echo $_SESSION['oLP']->build_tree();
echo '</div>';
echo '</td>';
echo '<td class="workspace">';
echo '<td class="workspace">';
if(isset($is_success) && $is_success === true) {
Display::display_confirmation_message(get_lang('ItemRemoved'));
} else {
@ -231,8 +228,7 @@ echo '<table cellpadding="0" cellspacing="0" class="lp_build">';
$learnpathadded .= '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&action=view&lp_id='.$_SESSION['oLP']->lp_id.'">'.Display::return_icon('learnpath_view.gif', get_lang('Display'),array('style'=> 'vertical-align: middle;')).' '.get_lang('Display').'</a>: '.get_lang('DisplayComment').'<br />';
$learnpathadded .= '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=chapter&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang("NewChapter").'">'.Display::return_icon('lp_dokeos_chapter_add.gif', get_lang('NewChapter'),array('style'=> 'vertical-align: middle;')).' '.get_lang('NewChapter').'</a>: '.get_lang('NewChapterComment').'<br />';
$learnpathadded .= '<a href="lp_controller.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&amp;gradebook='.$gradebook.'&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id . '" title="'.get_lang("NewStep").'">'.Display::return_icon('new_test.gif', get_lang('NewStep'),array('style'=> 'vertical-align: middle;')).' '.get_lang('NewStep').'</a>: '.get_lang('NewStepComment').'<br />';
$learnpathadded .= '<br /><br /><br /><br /></p>';
$learnpathadded .= '<br /><br /><br /><br /></p>';
Display::display_normal_message($learnpathadded, false);
}
}

@ -160,8 +160,8 @@ if (api_get_setting('search_enabled') === 'true')
$content_proximity_select -> setSelected($s_selected_proximity);
$origin_select -> setSelected($s_selected_origin);
$encoding_select -> setSelected($s_selected_encoding);
$defaults['lp_name'] = api_html_entity_decode(api_convert_encoding($_SESSION['oLP']->get_name(), $charset, $_SESSION['oLP']->encoding), ENT_QUOTES, $charset);
$defaults['lp_author'] = $_SESSION['oLP']->get_author();
$defaults['lp_name'] = Security::remove_XSS($_SESSION['oLP']->get_name());
$defaults['lp_author'] = Security::remove_XSS($_SESSION['oLP']->get_author());
//Submit button
$form->addElement('style_submit_button', 'Submit',get_lang('SaveLPSettings'),'class="save"');

@ -164,10 +164,8 @@ if (!empty($gradebook) && $gradebook=='view') {
'name' => get_lang('Gradebook')
);
}
$interbreadcrumb[]= array ("url"=>"lp_controller.php?action=list", "name"=> get_lang("_learning_path"));
$interbreadcrumb[]= array ("url"=>api_get_self()."?action=build&lp_id=$learnpath_id", "name" => stripslashes("{$therow['name']}"));
$interbreadcrumb[]= array ("url"=>api_get_self()."?action=build&lp_id=$learnpath_id", "name" =>stripslashes("{$therow['name']}"));
//Theme calls
$show_learn_path=true;
$lp_theme_css=$_SESSION['oLP']->get_theme();
@ -240,22 +238,14 @@ echo '<table cellpadding="0" cellspacing="0" class="lp_build">';
echo '</div>';
}
echo '</td>';
echo '<td class="workspace">';
if(isset($is_success) && $is_success === true)
{
$msg = '<div class="lp_message" style="margin-bottom:10px;">';
$msg .= 'The item has been edited.';
$msg .= '</div>';
echo '</td>';
echo '<td class="workspace">';
if(isset($is_success) && $is_success === true) {
$msg = '<div class="lp_message" style="margin-bottom:10px;">';
$msg .= 'The item has been edited.';
$msg .= '</div>';
echo $_SESSION['oLP']->display_item($_GET['id'], $msg);
}
else
{
} else {
echo $_SESSION['oLP']->display_edit_item($_GET['id']);
}
echo '</td>';

@ -216,7 +216,7 @@ if (is_array($flat_list))
if (($counter % 2)==0) { $oddclass="row_odd"; } else { $oddclass="row_even"; }
$url_start_lp = 'lp_controller.php?'.api_get_cidreq().'&action=view&lp_id='.$id;
$name = $details['lp_name'];
$name = Security::remove_XSS($details['lp_name']);
$image='<img src="../img/kcmdf.gif" border="0" align="absmiddle" alt="' . $name . '">'."\n";
$dsp_line = '<tr align="center" class="'.$oddclass.'">'."\n" .
'<td align="left" valign="top">' .

@ -251,8 +251,10 @@ if (is_array($list) && count($list) > 0){
}
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">' . 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";
$correct_test_link = '-';
//api_htmlentities($title, ENT_QUOTES, $lp_charset)
$title = Security::remove_XSS($title);
$output .= "<tr class='$oddclass'>\n" . "<td>$extend_link</td>\n" . '<td colspan="4" class="content"><div class="mystatus">' . $title . "</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++;
@ -331,9 +333,9 @@ if (is_array($list) && count($list) > 0){
. '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . "</div></font></td>\n" . '<td colspan="2"><div class="mystatus" align="center">' . $view_score . "</div></td>\n" . '<td colspan="2"><div class="mystatus">'.$time.'</div></td><td></td></tr>';
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 = array ();
$temp[] = $title = Security::remove_XSS($title);
$temp[] = Security::remove_XSS($my_lesson_status);
if ($row['item_type'] == 'quiz') {
@ -572,9 +574,9 @@ if (is_array($list) && count($list) > 0){
}
//."<td><font color='$color'><div class='mystatus'>".htmlentities($array_status[$lesson_status],ENT_QUOTES,$lp_charset)."</div></font></td>\n"
if ( (isset($_GET['lp_id']) && $_GET['lp_id'] == $my_lp_id ) && (isset($_GET['my_lp_id']) && $_GET['my_lp_id'] == $my_id)) {
$output .= "<tr class='$oddclass' >\n" . "<td>$extend_link</td>\n" . '<td colspan="4"><div class="mystatus">' . api_htmlentities($title, ENT_QUOTES, $lp_charset) . '</div></td>' . "\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 .= "<tr class='$oddclass' >\n" . "<td>$extend_link</td>\n" . '<td colspan="4"><div class="mystatus">' .$title. '</div></td>' . "\n";
$output .= '<td colspan="2">&nbsp;</td><td colspan="2">&nbsp;</td><td colspan="2">&nbsp;</td><td>'.$correct_test_link.'</td></tr>';
$output .= "</tr>\n";
} else {
@ -583,7 +585,7 @@ if (is_array($list) && count($list) > 0){
} else {
$output .= "<tr class='$oddclass'>\n";
}
$output .= "<td>$extend_link</td>\n" . '<td colspan="4"><div class="mystatus">' . api_htmlentities($title, ENT_QUOTES, $lp_charset) . '</div></td>' . "\n";
$output .= "<td>$extend_link</td>\n" . '<td colspan="4"><div class="mystatus">' .$title. '</div></td>' . "\n";
$output .= '<td colspan="2"><font color="' . $color . '"><div class="mystatus">' . $my_lesson_status . "</div></font></td>\n" . '<td colspan="2"><div class="mystatus" align="center">';
if ($row['item_type'] == 'quiz') {

@ -49,7 +49,17 @@ if ($is_allowed_in_course == false) api_not_allowed();
*/
//$charset = 'UTF-8';
//$charset = 'ISO-8859-1';
$charset = api_get_system_encoding();
// we set the encoding of the lp
if (!empty($_SESSION['oLP']->encoding)) {
$charset = $_SESSION['oLP']->encoding;
} else {
$charset = api_get_system_encoding();
}
if (empty($charset)) {
$charset = 'ISO-8859-1';
}
$oLearnpath = false;
$course_code = api_get_course_id();
$user_id = api_get_user_id();
@ -201,16 +211,15 @@ if ($type_quiz && !empty($_REQUEST['exeId']) && isset($_GET['lp_id']) && isset($
}
$_SESSION['oLP']->set_previous_item($lp_item_id);
$nameTools = $_SESSION['oLP']->get_name();
$nameTools = Security :: remove_XSS(api_convert_encoding($_SESSION['oLP']->get_name(), $charset, api_get_system_encoding()));
$save_setting = get_setting("show_navigation_menu");
global $_setting;
$_setting['show_navigation_menu'] = 'false';
$scorm_css_header=true;
$lp_theme_css=$_SESSION['oLP']->get_theme(); //sets the css theme of the LP this call is also use at the frames (toc, nav, message)
if($_SESSION['oLP']->mode == 'fullscreen')
{
if($_SESSION['oLP']->mode == 'fullscreen') {
$htmlHeadXtra[] = "<script>window.open('$src','content_id','toolbar=0,location=0,status=0,scrollbars=1,resizable=1');</script>";
include_once('../inc/reduced_header.inc.php');
@ -221,19 +230,20 @@ if($_SESSION['oLP']->mode == 'fullscreen')
<input type="hidden" id="current_item_id" name ="current_item_id" value="0" />
<div id="learningPathMain" style="width:100%;height:100%;" >
<div id="learningPathLeftZone" style="float:left;width:280px;height:100%">
<!-- header -->
<div id="header">
<div id="learningPathHeader" style="font-size:14px;">
<table>
<tr>
<td>
<a href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><img src="../img/lp_arrow.gif" /></a>
<a href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();">
<img src="../img/lp_arrow.gif" />
</a>
</td>
<td>
<a class="link" href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><?php echo get_lang('CourseHomepageLink'); ?></a>
<a class="link" href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();">
<?php echo api_convert_encoding(get_lang('CourseHomepageLink'), $charset, api_get_system_encoding()); ?></a>
</td>
</tr>
</table>
@ -244,9 +254,7 @@ if($_SESSION['oLP']->mode == 'fullscreen')
<!-- Image preview Layout -->
<div id="author_image" name="author_image" class="lp_author_image" style="height:23%; width:100%;margin-left:5px">
<?php $image = '../img/lp_author_background.gif'; ?>
<div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
<div id="preview_image" style="padding:5px;background-image: url('../img/lp_author_background.gif');background-repeat:no-repeat;height:110px">
<div style="width:100; float:left;height:105;margin:5px">
<span>
<?php if ($_SESSION['oLP']->get_preview_image()!=''): ?>
@ -435,7 +443,8 @@ else
<a href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><img src="../img/lp_arrow.gif" /></a>
</td>
<td>
<a class="link" href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();"><?php echo get_lang('CourseHomepageLink'); ?></a>
<a class="link" href="lp_controller.php?action=return_to_course_homepage" target="_top" onclick="window.parent.API.save_asset();">
<?php echo api_convert_encoding(get_lang('CourseHomepageLink'), $charset, api_get_system_encoding()); ?></a>
</td>
</tr>
</table>
@ -467,8 +476,7 @@ else
$scorm_css_header = true;
$lp_theme_css = $_SESSION['oLP']->get_theme();
//Setting up the CSS theme if exists
//Setting up the CSS theme if exists
if (!empty ($lp_theme_css) && !empty ($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
global $lp_theme_css;
} else {

Loading…
Cancel
Save