Source for file openoffice_presentation.class.php
Documentation is available at openoffice_presentation.class.php
* Defines the OpenOfficeDocument class, which is meant as a conversion
* tool from Office presentations (.ppt, .sxi, .odp, .pptx) to
* @package dokeos.learnpath.openofficedocument
* @author Eric Marguin <eric.marguin@dokeos.com>
* @license GNU/GPL - See Dokeos license directory for details
* Defines the "OpenofficePresentation" child of class "OpenofficeDocument"
* @package dokeos.learnpath.openofficedocument
require_once('openoffice_document.class.php');
if(!is_dir($this->base_work_dir. $this->created_dir))
foreach($files as $file){
list ($slide_name,$file_name) = explode('||',$file); // '||' is used as separator between slide name (with accents) and file name (without accents)
//filename is utf8 encoded, but when we decode, some chars are not translated (like quote ’).
//so we remove these chars by translating it in htmlentities and the reconvert it in want charset
$slide_name = ucfirst($slide_name);
// add the png to documents
$document_id = add_document($_course,$this->created_dir. '/'. urlencode($file_name),'file',filesize($this->base_work_dir. $this->created_dir. '/'. $file_name),$slide_name);
$html_file = $file_name. '.html';
$fp = fopen($this->base_work_dir. $this->created_dir. '/'. $html_file, 'w+');
$document_id = add_document($_course,$this->created_dir. '/'. urlencode($html_file),'file',filesize($this->base_work_dir. $this->created_dir. '/'. $html_file),$slide_name);
//put the document in item_property update
$previous = learnpath::add_item(0, $previous, 'document', $document_id, $slide_name, '');
if(empty($this->slide_width) || empty($this->slide_height))
return ' -w '. $this->slide_width. ' -h '. $this->slide_height. ' -d oogie "'. $this->base_work_dir. '/'. $this->file_path. '" "'. $this->base_work_dir. $this->created_dir. '.html"';
$this->slide_width = $width;
$this->slide_height = $height;
foreach($files as $file){
list ($slide_name,$file_name) = explode('||',$file); // '||' is used as separator between slide name (with accents) and file name (without accents)
$did = add_document($_course, $this->created_dir. '/'. urlencode($file_name), 'file', filesize($this->base_work_dir. $this->created_dir. '/'. $file_name), $slide_name);
|