From fb21fc883b1bff082915493b7a27f366ce487519 Mon Sep 17 00:00:00 2001 From: Eric Marguin Date: Tue, 5 Dec 2006 11:46:34 +0100 Subject: [PATCH] [svn r10297] improve ppt2lp : work with .PPT, .ODP and even with powerpointsd without extensions --- main/newscorm/presentation.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/newscorm/presentation.class.php b/main/newscorm/presentation.class.php index fd49785479..ebbc3f9649 100644 --- a/main/newscorm/presentation.class.php +++ b/main/newscorm/presentation.class.php @@ -68,6 +68,7 @@ class presentation extends learnpath { chmod ($base_work_dir.$created_dir,0744); if($return != 0) { //if the java application returns an error code + api_send_mail('e.marguin@elixir-interactive.com','problème de conversion ppt2lp','fichier '.$file); DocumentManager::delete_document($_course, $dir_name, $base_work_dir); return false; } @@ -80,6 +81,7 @@ class presentation extends learnpath { $this->lp_id = learnpath::add_lp($_course['id'], $learnpath_name,'','guess','manual'); $previous = 0; $i = 0; + $first_item = 0; foreach($files as $file){ $i++; $document_id = add_document($_course,$created_dir.'/'.$file,'file',filesize($base_work_dir.$created_dir.'/'.$file),$file); @@ -93,11 +95,13 @@ class presentation extends learnpath { $slide_name = 'slide'.str_repeat('0',2-strlen($i)).$i; $previous = learnpath::add_item(0, $previous, 'document', $document_id, $slide_name, ''); - + if($first_item == 0){ + $first_item = $previous; + } } } } - return true; + return $first_item; }