diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php
index 5ab7871612..6993df09ac 100644
--- a/main/newscorm/learnpath.class.php
+++ b/main/newscorm/learnpath.class.php
@@ -82,9 +82,7 @@ class learnpath {
var $arrMenu = array(); //array for the menu items
var $debug = 1; //logging level
-
-
-
+
/**
* Class constructor. Needs a database handler, a course code and a learnpath id from the database.
* Also builds the list of items into $this->items.
@@ -2658,7 +2656,7 @@ class learnpath {
//echo $this->current;
//$parent = $this->items[$this->current]->get_parent();
//if(empty($parent)){$parent = $this->ordered_items[$this->items[$this->current]->get_previous_index()];}
- $html= '
';
+ $html= ''.utf8_decode(html_entity_decode($this->get_name(), ENT_QUOTES, $this->encoding)).'
';
// build, display
if(api_is_allowed_to_edit())
@@ -4450,7 +4448,7 @@ class learnpath {
for($i = 0; $i < count($arrLP); $i++)
{
- $title=$arrLP[$i]['title'];
+ $title = utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding));
if($arrLP[$i]['description'] == '')
$arrLP[$i]['description'] = ' ';
@@ -4548,8 +4546,8 @@ class learnpath {
$return .= '' . "\n";
}
- $return .= "\t\t\t" . '';
- $return .= ' ';
+ $return .= "\t\t\t" . ' ';
+ $return .= ' ';
$return .= ' ' . "\n";
$return .= "\t\t" . '' . "\n";
@@ -4619,7 +4617,7 @@ class learnpath {
$menu = 0;
$parent = '';
- $return .= "\tm.add(" . $menu . ", -1, '" . addslashes($this->name) . "');\n";
+ $return .= "\tm.add(" . $menu . ", -1, '" . utf8_decode(html_entity_decode(addslashes($this->name), ENT_QUOTES, $this->encoding)) . "');\n";
$tbl_lp_item = Database::get_course_table('lp_item');
@@ -4638,7 +4636,7 @@ class learnpath {
if($this->encoding!=$mycharset)
{
- $row['title'] = mb_convert_encoding($row['title'], $mycharset,$this->encoding);
+ $row['title'] = mb_convert_encoding($row['title'], $mycharset, $this->encoding);
}
$arrLP[] = array(
@@ -4664,8 +4662,7 @@ class learnpath {
$title='';
for($i = 0; $i < count($arrLP); $i++)
{
- //$title = addslashes(($arrLP[$i]['title']));
- $title = utf8_decode(html_entity_decode(addslashes($arrLP[$i]['title']),ENT_QUOTES,$this->encoding));
+ $title = utf8_decode(html_entity_decode(addslashes($arrLP[$i]['title']), ENT_QUOTES, $this->encoding));
$menu_page = api_get_self() . '?cidReq=' . $_GET['cidReq'] . '&action=view_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $_SESSION['oLP']->lp_id;
$icon_name = str_replace(' ', '', $arrLP[$i]['item_type']);
if (file_exists("../img/lp_" . $icon_name . ".png"))
@@ -5181,7 +5178,8 @@ class learnpath {
$item_description = '';
}
- $item_title = mb_convert_encoding($item_title,$charset,$this->encoding);
+ //$item_title = mb_convert_encoding($item_title,$charset,$this->encoding);
+
$return = '';
if($id != 0 && is_array($extra_info))
$parent = $extra_info['parent_item_id'];
@@ -5251,20 +5249,20 @@ class learnpath {
$return .= "\t\t\t\t" . '
';
- $return .= "\t\t\t\t\t" . '' . $this->name . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($this->name, ENT_QUOTES, $this->encoding)) . ' ';
$arrHide = array($id);
$parent_item_id = $_SESSION['parent_item_id'];
for($i = 0; $i < count($arrLP); $i++) {
if($action != 'add') {
if(($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') && !in_array($arrLP[$i]['id'], $arrHide) && !in_array($arrLP[$i]['parent_item_id'], $arrHide)) {
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
} else {
$arrHide[] = $arrLP[$i]['id'];
}
} else {
if($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir')
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
}
}
if (is_array($arrLP)) {
@@ -5293,7 +5291,7 @@ class learnpath {
else
$selected = '';
- $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . '" ';
+ $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . '" ';
}
}
@@ -5743,7 +5741,7 @@ class learnpath {
$return .= "\t\t" . '' . "\n";
$return .= "\t\t\t" . ''.get_lang('Title').' ' . "\n";
- $return .= "\t\t\t" . ' ' . "\n";
+ $return .= "\t\t\t" . ' ' . "\n";
$return .= "\t\t" . ' ' . "\n";
}
@@ -5755,7 +5753,7 @@ class learnpath {
$return .= "\t\t\t\t" . '';
- $return .= "\t\t\t\t\t" . '' . $this->name . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($this->name, ENT_QUOTES, $this->encoding)) . ' ';
$arrHide = array($id);
@@ -5767,7 +5765,7 @@ class learnpath {
{
if(($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') && !in_array($arrLP[$i]['id'], $arrHide) && !in_array($arrLP[$i]['parent_item_id'], $arrHide))
{
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
}
else
{
@@ -5777,7 +5775,7 @@ class learnpath {
else
{
if($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir')
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
}
}
if (is_array($arrLP)) {
@@ -5808,7 +5806,7 @@ class learnpath {
else
$selected = '';
- $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . '" ';
+ $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . '" ';
}
}
@@ -6184,7 +6182,7 @@ class learnpath {
if($id != 0 && is_array($extra_info))
{
- $item_title = $extra_info['title'];
+ $item_title = html_entity_decode(utf8_decode(html_entity_decode($extra_info['title'], ENT_QUOTES, $this->encoding)));
$item_description = $extra_info['description'];
$item_path = api_get_path(WEB_COURSE_PATH) . $_course['path'].'/scorm/'.$this->path.'/'.stripslashes($extra_info['path']);
}
@@ -6240,9 +6238,8 @@ class learnpath {
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form = new FormValidator('form','POST',api_get_self()."?".$_SERVER["QUERY_STRING"]);
-
- $defaults["title"]=mb_convert_encoding($item_title,$charset,$this->encoding);
- $defaults["description"]=mb_convert_encoding($item_description,$charset,$this->encoding);
+ $defaults["title"] = $item_title;
+ $defaults["description"] = mb_convert_encoding($item_description,$charset,$this->encoding);
$form->addElement('html',$return);
@@ -6296,7 +6293,7 @@ class learnpath {
foreach($arrHide as $key => $value)
{
- $parent_select->addOption($value['value'],$key,'style="padding-left:'.$value['padding'].'px;"');
+ $parent_select->addOption(utf8_decode(html_entity_decode($value['value'], ENT_QUOTES, $this->encoding)),$key,'style="padding-left:'.$value['padding'].'px;"');
}
$parent_select -> setSelected($s_selected_parent);
}
@@ -6314,7 +6311,7 @@ class learnpath {
elseif($action == 'add')
$s_selected_position=$arrLP[$i]['id'];
- $arrHide[$arrLP[$i]['id']]['value']=get_lang("After").' "' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding);
+ $arrHide[$arrLP[$i]['id']]['value']=get_lang("After").' "' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding));
}
}
@@ -6325,7 +6322,7 @@ class learnpath {
foreach($arrHide as $key => $value)
{
- $position->addOption($value['value'],$key,'style="padding-left:'.$value['padding'].'px;"');
+ $position->addOption($value['value'].'"',$key,'style="padding-left:'.$value['padding'].'px;"');
}
if(!empty($s_selected_position)) { $position->setSelected($s_selected_position); }
@@ -6352,7 +6349,7 @@ class learnpath {
//$form->addElement('html_editor','content_lp','');
$defaults["content_lp"]=file_get_contents($item_path);
}
-
+
$form->addElement('hidden', 'type', 'dokeos_'.$item_type);
$form->addElement('hidden', 'post_time', time());
$form->setDefaults($defaults);
@@ -6526,14 +6523,12 @@ class learnpath {
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form = new FormValidator('form','POST',api_get_self()."?".$_SERVER["QUERY_STRING"],'','enctype="multipart/form-data"');
-
- $defaults["title"] = html_entity_decode($item_title);
- $defaults["title"]=mb_convert_encoding($defaults["title"],$charset,$this->encoding);
+ $defaults["title"] = html_entity_decode(utf8_decode(html_entity_decode($defaults["title"], ENT_QUOTES, $this->encoding)));
if(empty($defaults["title"]))
{
- $defaults["title"] = html_entity_decode($item_title);
+ $defaults["title"] = html_entity_decode(utf8_decode(html_entity_decode($item_title, ENT_QUOTES, $this->encoding)));
}
- $defaults["description"]=mb_convert_encoding($item_description,$charset,$this->encoding);
+ $defaults["description"] = mb_convert_encoding($item_description,$charset,$this->encoding);
$form->addElement('html',$return);
@@ -6572,7 +6567,7 @@ class learnpath {
$parent_select = &$form->addElement('select', 'parent', get_lang('Parent'), '', 'class="learnpath_item_form" style="width:40%;" onchange="load_cbo(this.value);"');
foreach($arrHide as $key => $value) {
- $parent_select->addOption($value['value'],$key,'style="padding-left:'.$value['padding'].'px;"');
+ $parent_select->addOption(utf8_decode(html_entity_decode($value['value'], ENT_QUOTES, $this->encoding)),$key,'style="padding-left:'.$value['padding'].'px;"');
}
if (!empty($id)) {
@@ -6596,7 +6591,7 @@ class learnpath {
elseif($action == 'add')
$s_selected_position=$arrLP[$i]['id'];
- $arrHide[$arrLP[$i]['id']]['value']=get_lang("After").' "' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding).'"';
+ $arrHide[$arrLP[$i]['id']]['value']=get_lang("After").' "' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) .'"';
}
}
@@ -6873,7 +6868,7 @@ class learnpath {
$return .= "\t\t" . '' . "\n";
$return .= "\t\t\t" . ''.get_lang('Title').' ' . "\n";
- $return .= "\t\t\t" . ' ' . "\n";
+ $return .= "\t\t\t" . ' ' . "\n";
$return .= "\t\t" . ' ' . "\n";
}
@@ -6885,7 +6880,7 @@ class learnpath {
$return .= "\t\t\t\t" . '';
- $return .= "\t\t\t\t\t" . '' . $this->name . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($this->name, ENT_QUOTES, $this->encoding)) . ' ';
$arrHide = array($id);
@@ -6895,13 +6890,13 @@ class learnpath {
if($action != 'add') {
if(($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') && !in_array($arrLP[$i]['id'], $arrHide) && !in_array($arrLP[$i]['parent_item_id'], $arrHide))
{
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
} else {
$arrHide[] = $arrLP[$i]['id'];
}
} else {
if($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir')
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
}
}
@@ -6935,7 +6930,7 @@ class learnpath {
else
$selected = '';
- $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . '" ';
+ $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . '" ';
}
}
@@ -7159,7 +7154,7 @@ class learnpath {
{
if(($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir') && !in_array($arrLP[$i]['id'], $arrHide) && !in_array($arrLP[$i]['parent_item_id'], $arrHide))
{
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
}
else
{
@@ -7169,7 +7164,7 @@ class learnpath {
else
{
if($arrLP[$i]['item_type'] == 'dokeos_module' || $arrLP[$i]['item_type'] == 'dokeos_chapter' || $arrLP[$i]['item_type'] == 'dir')
- $return .= "\t\t\t\t\t" . '' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding). ' ';
+ $return .= "\t\t\t\t\t" . '' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . ' ';
}
}
@@ -7204,7 +7199,7 @@ class learnpath {
else
$selected = '';
- $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . mb_convert_encoding($arrLP[$i]['title'],$charset,$this->encoding) . '" ';
+ $return .= "\t\t\t\t\t" . ''.get_lang("After").' "' . utf8_decode(html_entity_decode($arrLP[$i]['title'], ENT_QUOTES, $this->encoding)) . '" ';
}
}
@@ -7384,7 +7379,7 @@ class learnpath {
{
$return .= ' '.get_lang('Prerequisites').' ';
}
- $return .= ' '.get_lang("Delete").' ';
+ $return .= ' '.get_lang("Delete").' ';
//$return .= '' . ((trim($s_description) == '') ? ''.get_lang("NoDescription").'' : stripslashes(nl2br($s_description))) . '
';
@@ -7684,7 +7679,7 @@ class learnpath {
$arrLP[] = array(
'id' => $row['id'],
'item_type' => $row['item_type'],
- 'title' => mb_convert_encoding($row['title'],$charset,$this->encoding),
+ 'title' => utf8_decode(html_entity_decode($row['title'], ENT_QUOTES, $this->encoding)),
'ref' => $row['ref'],
'description' => $row['description'],
'parent_item_id' => $row['parent_item_id'],
diff --git a/main/newscorm/lp_edit.php b/main/newscorm/lp_edit.php
index 1360179580..128f218ca7 100644
--- a/main/newscorm/lp_edit.php
+++ b/main/newscorm/lp_edit.php
@@ -148,8 +148,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']=$_SESSION['oLP']->get_name();
-$defaults['lp_author']=$_SESSION['oLP']->get_author();
+$defaults['lp_name'] = html_entity_decode(utf8_decode(html_entity_decode($_SESSION['oLP']->get_name(), ENT_QUOTES, 'UTF-8')));
+$defaults['lp_author'] = $_SESSION['oLP']->get_author();
//Submit button
$form->addElement('style_submit_button', 'Submit',get_lang('SaveLPSettings'),'class="save"');
diff --git a/main/newscorm/lp_list.php b/main/newscorm/lp_list.php
index e26c9e09a0..12738e874d 100644
--- a/main/newscorm/lp_list.php
+++ b/main/newscorm/lp_list.php
@@ -202,7 +202,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 = utf8_decode(html_entity_decode($details['lp_name'], ENT_QUOTES, 'UTF-8'));
$image=' '."\n";
$dsp_line = ''."\n" .
'' .