From 8bfc4df1dfb1262e50e6616a2ceb4b5099ef83b9 Mon Sep 17 00:00:00 2001 From: Cristian Fasanando Date: Wed, 6 May 2009 00:20:02 +0200 Subject: [PATCH] [svn r20349] Fixed apostrophes problem in Learning path - see FS#4143 (by rvelasquez) --- main/newscorm/learnpath.class.php | 87 +++++++++++++++---------------- main/newscorm/lp_edit.php | 4 +- main/newscorm/lp_list.php | 2 +- 3 files changed, 44 insertions(+), 49 deletions(-) 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= '
'.$this->get_name().'
'; + $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" . '' . "\n"; + $return .= "\t\t\t" . '' . "\n"; $return .= "\t\t" . '' . "\n"; } @@ -5755,7 +5753,7 @@ class learnpath { $return .= "\t\t\t\t" . '' . "\n"; + $return .= "\t\t\t" . '' . "\n"; $return .= "\t\t" . '' . "\n"; } @@ -6885,7 +6880,7 @@ class learnpath { $return .= "\t\t\t\t" . '