From f0adf191a2a4cdeb2db125b00c0927c16705cf34 Mon Sep 17 00:00:00 2001 From: Eric Marguin Date: Mon, 30 Apr 2007 15:05:42 +0200 Subject: [PATCH] [svn r12197] fix a bug again with audio export/import --- main/newscorm/learnpath.class.php | 10 +++++++--- main/newscorm/learnpathItem.class.php | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index c863acd709..12b54c1a9d 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -6804,9 +6804,13 @@ function display_thread_form($action = 'add', $id = 0, $extra_info = '') } else if (empty($file_path)) { - $file_path = $_SERVER['DOCUMENT_ROOT'].$doc_info[0]; - $file_path = substr($file_path,strlen($root_path)+1); - //echo $file_path;echo '

'; + /*$document_root = substr(api_get_path(SYS_PATH), 0, strpos(api_get_path(SYS_PATH),api_get_path(REL_PATH))); + if(strpos($document_root,-1)=='/') + { + $document_root = substr(0, -1, $document_root); + }*/ + $file_path = substr($doc_info[0],strlen(api_get_path(REL_PATH))); + //echo $file_path.'

'; //error_log('Reduced path: '.$file_path,0); $zip_files_abs[] = $file_path; $link_updates[$my_file_path][] = array('orig'=>$doc_info[0],'dest'=>$file_path); diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index a9431ec32e..5bba0dc8d7 100644 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -545,7 +545,11 @@ class learnpathItem{ if(strpos($source , 'mp3file')) { $files_list[] = array(substr($source, 0, strpos($source , '.swf')+4),'local','abs'); - $files_list[] = array(substr($source , strpos($source , 'mp3file=')+8),'local','rel'); + $mp3file = substr($source , strpos($source , 'mp3file=')+8); + if(strpos($mp3file,0,1) == '/') + $files_list[] = array($mp3file,'local','abs'); + else + $files_list[] = array($mp3file,'local','rel'); } } if(strstr($source,'://') > 0)