diff --git a/main/inc/lib/ppt2png/OogieDocumentConverter.class b/main/inc/lib/ppt2png/OogieDocumentConverter.class index fcce65b5b0..d9d7abecb2 100644 Binary files a/main/inc/lib/ppt2png/OogieDocumentConverter.class and b/main/inc/lib/ppt2png/OogieDocumentConverter.class differ diff --git a/main/inc/lib/ppt2png/OogieDocumentConverter.java b/main/inc/lib/ppt2png/OogieDocumentConverter.java index cc3739ab43..351bc18c07 100644 --- a/main/inc/lib/ppt2png/OogieDocumentConverter.java +++ b/main/inc/lib/ppt2png/OogieDocumentConverter.java @@ -142,13 +142,13 @@ public class OogieDocumentConverter extends AbstractDokeosDocumentConverter { slidename = slidename.replaceAll(" ", "_"); slidename = slidename.replaceAll("\n", "_"); slidename = slidename.replaceAll("__", "_"); - slidename = slidename.replaceAll("\\W", "_"); - slidename = slidename.replaceAll("__", "_"); + //slidename = slidename.replaceAll("\\W", "_"); + //slidename = slidename.replaceAll("__", "_"); for(int j=0 ; jbase_work_dir); return false; @@ -96,9 +97,9 @@ abstract class OpenofficeDocument extends learnpath { // call to the function implemented by child following action_after_conversion parameter switch ($action_after_conversion) { - case 'make_lp':$this -> make_lp($files); + case 'make_lp':$this -> make_lp(); break; - case 'add_docs_to_visio':$this -> add_docs_to_visio($files); + case 'add_docs_to_visio':$this -> add_docs_to_visio(); break; } diff --git a/main/newscorm/openoffice_presentation.class.php b/main/newscorm/openoffice_presentation.class.php index a2fd5a24c7..0491a13b3d 100644 --- a/main/newscorm/openoffice_presentation.class.php +++ b/main/newscorm/openoffice_presentation.class.php @@ -23,17 +23,28 @@ class OpenofficePresentation extends OpenofficeDocument { } - function make_lp($files = array()) { + function make_lp() { global $_course; $previous = 0; $i = 0; + + if(!is_dir($this->base_work_dir.$this->created_dir)) + return false; + + $files = scandir($this->base_work_dir.$this->created_dir); + foreach($files as $file){ - $i++; + + if($file=='.' || $file=='..') + continue; + + $i++; + $file = utf8_decode($file); //filename has been written in java, so unicode // add the png to documents - $document_id = add_document($_course,$this->created_dir.'/'.$file,'file',filesize($this->base_work_dir.$this->created_dir.'/'.$file),$file); + $document_id = add_document($_course,$this->created_dir.'/'.urlencode($file),'file',filesize($this->base_work_dir.$this->created_dir.'/'.$file),$file); api_item_property_update($_course,TOOL_DOCUMENT,$document_id,'DocumentAdded',$_SESSION['_uid'],0,0); @@ -45,11 +56,11 @@ class OpenofficePresentation extends OpenofficeDocument { ' - + '); fclose($fp); - $document_id = add_document($_course,$this->created_dir.'/'.$html_file,'file',filesize($this->base_work_dir.$this->created_dir.'/'.$html_file),$html_file); + $document_id = add_document($_course,$this->created_dir.'/'.urlencode($html_file),'file',filesize($this->base_work_dir.$this->created_dir.'/'.$html_file),$html_file); if ($document_id){ //put the document in item_property update @@ -60,6 +71,7 @@ class OpenofficePresentation extends OpenofficeDocument { { $slide_name = substr($infos['basename'],0,strrpos($infos['basename'],'.')); $slide_name = str_replace('_',' ',$slide_name); + $slide_name = ucfirst($slide_name); } else { @@ -92,11 +104,19 @@ class OpenofficePresentation extends OpenofficeDocument { global $_course; /* Add Files */ - foreach($files as $f) - { - $did = add_document($_course, $this->created_dir.'/'.$f, 'file', filesize($this->base_work_dir.$this->created_dir.'/'.$f), $f); + $files = scandir($this->base_work_dir.$this->created_dir); + + foreach($files as $file){ + + if($file=='.' || $file=='..') + continue; + + $file = utf8_decode($file); + + $did = add_document($_course, $this->created_dir.'/'.urlencode($file), 'file', filesize($this->base_work_dir.$this->created_dir.'/'.$file), $file); if ($did) api_item_property_update($_course, TOOL_DOCUMENT, $did, 'DocumentAdded', $_SESSION['_uid'], 0, NULL); + } } diff --git a/main/newscorm/openoffice_text_document.class.php b/main/newscorm/openoffice_text_document.class.php index bfa9f01e69..ca442f712a 100644 --- a/main/newscorm/openoffice_text_document.class.php +++ b/main/newscorm/openoffice_text_document.class.php @@ -37,7 +37,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument { * @param array The files that will compose the generated learning path. Unused so far. * @return boolean False if file does not exit. Nothing otherwise. */ - function make_lp($files=array()) + function make_lp() { global $_course;