[svn r11182] improvments in oogie :

- we are now able to configure the size of the slides in the admin
- the slide is now integrated in an html file so that we are able to add later mp3, text, flash...
skala
Eric Marguin 19 years ago
parent b1f6a5611f
commit 6d683a349c
  1. 14
      main/admin/configure_extensions.php
  2. BIN
      main/inc/lib/ppt2png/DocumentConverter.class
  3. 17
      main/inc/lib/ppt2png/DocumentConverter.java
  4. 3
      main/install/dokeos_main.sql
  5. 29
      main/newscorm/presentation.class.php

@ -153,6 +153,12 @@ if(isset($_POST['activeExtension'])){
WHERE variable="service_ppt2lp"
AND subkey="path_to_lzx"';
api_sql_query($sql, __FILE__, __LINE__);
$sql = 'UPDATE '.$tbl_settings_current.' SET
selected_value="'.addslashes($_POST['size']).'"
WHERE variable="service_ppt2lp"
AND subkey="size"';
api_sql_query($sql, __FILE__, __LINE__);
break;
}
@ -325,6 +331,14 @@ Display::display_header($nameTool);
$form -> addElement('text', 'ftp_password', get_lang('FtpPassword'));
$form -> addElement('html','<br /><br />');
$form -> addElement('text', 'path_to_lzx', get_lang('PathToLzx'));
$form -> addElement('html','<br /><br />');
$options = array(
'540x405'=>'540x405',
'640x480'=>'640x480',
'800x600'=>'800x600',
'1000x750'=>'1000x750'
);
$form -> addElement('select', 'size', get_lang('SlideSize'), $options);
$form -> addElement('hidden', 'extension_code', 'ppt2lp');
$defaults = array();

@ -49,20 +49,25 @@ public class DocumentConverter {
public static void main(String args[]) {
String cnx, ftpuser, host, port, url, ftpPasswd, destinationFolder, remoteFolderFullPath, remoteFolder;
int width, height;
try {
try {
host = args[0];
port = args[1];
url = args[2];
destinationFolder = args[3];
if(args.length == 6){
ftpuser = args[4];
ftpPasswd = args[5];
width = Integer.parseInt(args[4]);
height = Integer.parseInt(args[5]);
if(args.length == 8){
ftpuser = args[6];
ftpPasswd = args[7];
}
else{
ftpuser = "";
ftpPasswd = "";
}
if(host.equals("localhost")){
String prefix = "file://";
if(url.charAt(0)!='/')
@ -185,9 +190,9 @@ public class DocumentConverter {
}
filterDatas[0].Name = "PixelWidth";
filterDatas[0].Value = new Integer(540);
filterDatas[0].Value = new Integer(width);
filterDatas[1].Name = "PixelHeight";
filterDatas[1].Value = new Integer(405);
filterDatas[1].Value = new Integer(height);
filterDatas[2].Name = "LogicalWidth";
filterDatas[2].Value = new Integer(2000);
filterDatas[3].Name = "LogicalHeight";

@ -491,7 +491,8 @@ INSERT INTO `settings_current` VALUES
(80, 'service_ppt2lp', 'user', 'textfield', NULL, NULL, 'UserOnHost', NULL, NULL, NULL),
(81, 'service_ppt2lp', 'ftp_password', 'textfield', NULL, NULL, 'FtpPassword', NULL, NULL, NULL),
(82, 'service_ppt2lp', 'path_to_lzx', 'textfield', NULL, NULL, '', NULL, NULL, NULL),
(83, 'wcag_anysurfer_public_pages', NULL, 'radio','Platform','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL);
(84, 'service_ppt2lp', 'size', 'radio', '540x405', NULL, '', NULL, NULL, NULL),
(85, 'wcag_anysurfer_public_pages', NULL, 'radio','Platform','false','PublicPagesComplyToWAITitle','PublicPagesComplyToWAIComment', NULL, NULL);
UNLOCK TABLES;

@ -78,15 +78,15 @@ class presentation extends learnpath {
{
$classpath = str_replace(':',';',$classpath);
}
list($slide_width, $slide_height) = explode('x',api_get_setting('service_ppt2lp','size'));
if(strpos($_ENV['OS'],'Windows') !== false)
{
$cmd = 'cd '.str_replace('/','\\',api_get_path(SYS_PATH)).'main/inc/lib/ppt2png && java '.$classpath.' DocumentConverter '.api_get_setting('service_ppt2lp','host').' 2002'.' "'.$file.'" "'.$base_work_dir.$created_dir.'"'.' '.api_get_setting('service_ppt2lp','user').' '.api_get_setting('service_ppt2lp','ftp_password');
{
$cmd = 'cd '.str_replace('/','\\',api_get_path(SYS_PATH)).'main/inc/lib/ppt2png && java '.$classpath.' DocumentConverter '.api_get_setting('service_ppt2lp','host').' 2002'.' "'.$file.'" "'.$base_work_dir.$created_dir.'"'.' '.$slide_width.' '.$slide_height.' '.api_get_setting('service_ppt2lp','user').' '.api_get_setting('service_ppt2lp','ftp_password');
}
else
{
$cmd = 'cd '.api_get_path(SYS_PATH).'main/inc/lib/ppt2png && java '.$classpath.' DocumentConverter '.api_get_setting('service_ppt2lp','host').' 2002'.' "'.$file.'" "'.$base_work_dir.$created_dir.'"'.' '.api_get_setting('service_ppt2lp','user').' '.api_get_setting('service_ppt2lp','ftp_password');
$cmd = 'cd '.api_get_path(SYS_PATH).'main/inc/lib/ppt2png && java '.$classpath.' DocumentConverter '.api_get_setting('service_ppt2lp','host').' 2002'.' "'.$file.'" "'.$base_work_dir.$created_dir.'"'.' '.$slide_width.' '.$slide_height.' '.api_get_setting('service_ppt2lp','user').' '.api_get_setting('service_ppt2lp','ftp_password');
}
chmod ($base_work_dir.$created_dir,0777);
@ -108,16 +108,27 @@ class presentation extends learnpath {
$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);
if ($document_id){
// create an html file
$html_file = $file.'.html';
$fp = fopen($base_work_dir.$created_dir.'/'.$html_file, 'w+');
fwrite($fp,
'<html>
<head></head>
<body>
<img src="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.$created_dir.'/'.$file.'" />
</body>
</html>');
fclose($fp);
$document_id = add_document($_course,$created_dir.'/'.$html_file,'file',filesize($base_work_dir.$created_dir.'/'.$html_file),$html_file);
if ($document_id){
//put the document in item_property update
api_item_property_update($_course,TOOL_DOCUMENT,$document_id,'DocumentAdded',$_SESSION['_uid'],$to_group_id,$to_user_id);
$infos = pathinfo($file);
//$slide_name = substr($infos['basename'],0,strpos($infos['basename'],'.'));
$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;

Loading…
Cancel
Save