Source for file lp_upload.php
Documentation is available at lp_upload.php
* Script managing the learnpath upload. To best treat the uploaded file, make sure we can identify it.
* @package dokeos.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
//flag to allow for anonymous user - needs to be set before global.inc.php
require_once('back_compat.inc.php');
//error_log('New LP - lp_upload.php',0);
* check the request method in place of a variable from POST
* because if the file size exceed the maximum file upload
* size set in php.ini, all variables from POST are cleared !
if ($_SERVER['REQUEST_METHOD'] == 'POST'
&& !empty($_FILES['user_file']['name'])
// A file upload has been detected, now deal with the file...
$s= $_FILES['user_file']['name'];
//get name of the zip file without the extension
$filename = $info['basename'];
$extension = $info['extension'];
$file_base_name = str_replace('.'. $extension,'',$filename);
require_once('learnpath.class.php');
require_once('scorm.class.php');
$manifest = $oScorm->import_package($_FILES['user_file'],$current_dir);
$oScorm->parse_manifest($manifest);
//show error message stored in $oScrom->error_msg
$oScorm->set_proximity($proximity);
$oScorm->set_maker($maker);
$oScorm->set_jslib('scorm_api.php');
require_once('aicc.class.php');
$config_dir = $oAICC->import_package($_FILES['user_file']);
$oAICC->parse_config_files($config_dir);
$oAICC->set_proximity($proximity);
$oAICC->set_maker($maker);
$oAICC->set_jslib('aicc_api.php');
require_once('openoffice_presentation.class.php');
$take_slide_name = empty($_POST['take_slide_name']) ? false : true;
$first_item_id = $o_ppt -> convert_document($_FILES['user_file']);
require_once('openoffice_text_document.class.php');
$split_steps = $_POST['split_steps'];
$o_doc = new OpenofficeTextDocument($split_steps);
$first_item_id = $o_doc -> convert_document($_FILES['user_file']);
} // end if is_uploaded_file
elseif($_SERVER['REQUEST_METHOD'] == 'POST')
//if file name given to get in claroline/upload/, try importing this way
// A file upload has been detected, now deal with the file...
//escape path with basename so it can only be directly into the claroline/upload directory
//get name of the zip file without the extension
$filename = $info['basename'];
$extension = $info['extension'];
$file_base_name = str_replace('.'. $extension,'',$filename);
require_once('learnpath.class.php');
require_once('scorm.class.php');
$manifest = $oScorm->import_local_package($s,$current_dir);
$oScorm->parse_manifest($manifest);
$oScorm->set_proximity($proximity);
$oScorm->set_maker($maker);
$oScorm->set_jslib('scorm_api.php');
require_once('aicc.class.php');
$config_dir = $oAICC->import_local_package($s,$current_dir);
$oAICC->parse_config_files($config_dir);
$oAICC->set_proximity($proximity);
$oAICC->set_maker($maker);
$oAICC->set_jslib('aicc_api.php');
|