*/
/**
* First, initialise the script
*/
// name of the language file which needs to be included
// 'inc.php' is automatically appended to the file name
$language_file[] = "document"; //the document file is loaded because most of the upload vocab relates to the document tool
$language_file[] = "learnpath";
$language_file[] = "scormdocument";
// global settings initialisation
// also provides access to main api (inc/lib/main_api.lib.php)
include("../inc/global.inc.php");
require_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
require_once(api_get_path(LIBRARY_PATH) . 'events.lib.inc.php');
require_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form_style= '
';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = '';
$htmlHeadXtra[] = $form_style;
if(isset($_POST['convert'])){
$cwdir = getcwd();
if(isset($_FILES['user_file']))
{
$allowed_extensions = array('odp','sxi','ppt','pps','sxd','pptx');
if(in_array(strtolower(pathinfo($_FILES['user_file']['name'],PATHINFO_EXTENSION)),$allowed_extensions))
{
require('../newscorm/lp_upload.php');
if(isset($o_ppt) && $first_item_id != 0){
if (api_get_setting('search_enabled')=='true') {
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {
$values = explode(',', trim($_POST[$specific_field['code']]));
if ( !empty($values) ) {
foreach ($values as $value) {
$value = trim($value);
if ( !empty($value) ) {
add_specific_field_value($specific_field['id'], api_get_course_id(), TOOL_LEARNPATH, $o_ppt->lp_id, $value);
}
}
}
}
}
header('Location: ../newscorm/lp_controller.php?'.api_get_cidreq().'&lp_id='.$o_ppt->lp_id.'&action=view_item&id='.$first_item_id);
}
else {
if(!empty($o_ppt->error))
$errorMessage = $o_ppt->error;
else
$errorMessage = get_lang('OogieUnknownError');
}
}
else
{
$errorMessage = get_lang('OogieBadExtension');
}
}
}
event_access_tool(TOOL_UPLOAD);
// check access permissions (edit permission is needed to add a document or a LP)
$is_allowed_to_edit = api_is_allowed_to_edit();
if(!$is_allowed_to_edit){
api_not_allowed(true);
}
$interbreadcrumb[]= array ("url"=>"../newscorm/lp_controller.php?action=list", "name"=> get_lang("Doc"));
$nameTools = get_lang("OogieConversionPowerPoint");
Display :: display_header($nameTools);
?>
';
$s_style="border-width: 1px;
border-style: solid;
margin-left: 0;
margin-top: 10px;
margin-bottom: 0px;
min-height: 30px;
padding: 5px;
position: relative;
width: 500px;
background-color: #E5EDF9;
border-color: #4171B5;
color: #000;";
$s_style_error="border-width: 1px;
border-style: solid;
margin-left: 0;
margin-top: 10px;
margin-bottom: 10px;
min-height: 30px;
padding: 5px;
position: relative;
width: 500px;
background-color: #FFD1D1;
border-color: #FF0000;
color: #000;";
//Display::display_normal_message($message);
$alt_text = '';
$attribute_list = '';
echo '