|
|
|
@ -1,7 +1,8 @@ |
|
|
|
|
<?php
|
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
/** |
|
|
|
|
* Action controller for the upload process. The display scripts (web forms) redirect |
|
|
|
|
* Action controller for the upload process. The display scripts (web forms) |
|
|
|
|
* redirect |
|
|
|
|
* the process here to do what needs to be done with each file. |
|
|
|
|
* @package chamilo.upload |
|
|
|
|
* @author Yannick Warnier <ywarnier@beeznest.org> |
|
|
|
@ -16,14 +17,12 @@ $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) . 'document.lib.php'); |
|
|
|
|
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); |
|
|
|
|
include '../inc/global.inc.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH) . 'document.lib.php'; |
|
|
|
|
require_once api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form_style= ' |
|
|
|
|
<style> |
|
|
|
|
$form_style= '<style> |
|
|
|
|
.row { |
|
|
|
|
width: 200px; |
|
|
|
|
} |
|
|
|
@ -40,20 +39,19 @@ $htmlHeadXtra[] = '<script type="text/javascript"> |
|
|
|
|
var myUpload = new upload(0); |
|
|
|
|
</script>'; |
|
|
|
|
$htmlHeadXtra[] = $form_style; |
|
|
|
|
if (api_get_setting('search_enabled')=='true') |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if (api_get_setting('search_enabled')=='true') { |
|
|
|
|
$specific_fields = get_specific_field_list(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (isset($_POST['convert'])) { |
|
|
|
|
$cwdir = getcwd(); |
|
|
|
|
if(isset($_FILES['user_file'])) |
|
|
|
|
{ |
|
|
|
|
if (isset($_FILES['user_file'])) { |
|
|
|
|
$allowed_extensions = array('doc','docx','odt','txt','sxw','rtf'); |
|
|
|
|
if(in_array(strtolower(pathinfo($_FILES['user_file']['name'],PATHINFO_EXTENSION)),$allowed_extensions)) |
|
|
|
|
{ |
|
|
|
|
if (in_array(strtolower(pathinfo($_FILES['user_file']['name'],PATHINFO_EXTENSION)),$allowed_extensions)) { |
|
|
|
|
require('../newscorm/lp_upload.php'); |
|
|
|
|
if (isset($o_doc) && $first_item_id != 0) { |
|
|
|
|
// Search-related section |
|
|
|
|
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(); |
|
|
|
@ -69,29 +67,24 @@ if(isset($_POST['convert'])){ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} //end of search-related section |
|
|
|
|
header('Location: ../newscorm/lp_controller.php?'.api_get_cidreq().'&lp_id='.$o_doc->lp_id.'&action=view_item&id='.$first_item_id); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
if(!empty($o_doc->error)) |
|
|
|
|
} else { |
|
|
|
|
if (!empty($o_doc->error)) { |
|
|
|
|
$errorMessage = $o_doc->error; |
|
|
|
|
else |
|
|
|
|
} else { |
|
|
|
|
$errorMessage = get_lang('OogieUnknownError'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
} else { |
|
|
|
|
$errorMessage = get_lang('WoogieBadExtension'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
@ -100,18 +93,10 @@ $interbreadcrumb[]= array ("url"=>"../newscorm/lp_controller.php?action=list", " |
|
|
|
|
$nameTools = get_lang("WoogieConversionPowerPoint"); |
|
|
|
|
Display :: display_header($nameTools); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
|
|
<img src="../img/mascot.png"><br> |
|
|
|
|
<span style="color: #5577af; font-size: 16px; font-family: Arial; margin-left: 10px;"><?php echo get_lang("WelcomeWoogieSubtitle");?></span><br>
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
//echo '<img src="../img/mascot.png"><br />'; |
|
|
|
|
echo '<span style="color: #5577af; font-size: 16px; font-family: Arial; margin-left: 10px;">'.get_lang("WelcomeWoogieSubtitle").'</span><br>'; |
|
|
|
|
$message = get_lang("WelcomeWoogieConverter"); |
|
|
|
|
|
|
|
|
|
echo '<br>'; |
|
|
|
|
|
|
|
|
|
echo '<br />'; |
|
|
|
|
$s_style = "border-width: 1px; |
|
|
|
|
border-style: solid; |
|
|
|
|
margin-left: 0; |
|
|
|
@ -175,8 +160,7 @@ EOT; |
|
|
|
|
$renderer->setElementTemplate($user_file_template); |
|
|
|
|
|
|
|
|
|
$form -> addElement ('file', 'user_file','<img src="../img/word_big.gif" align="absbottom" />'); |
|
|
|
|
if (api_get_setting('search_enabled')=='true') |
|
|
|
|
{ |
|
|
|
|
if (api_get_setting('search_enabled')=='true') { |
|
|
|
|
$form -> addElement ('checkbox', 'index_document','', get_lang('SearchFeatureDoIndexDocument')); |
|
|
|
|
$form -> addElement ('html','<br />'); |
|
|
|
|
$form -> addElement ('html', get_lang('SearchFeatureDocumentLanguage').': '. api_get_languages_combo()); |
|
|
|
@ -193,24 +177,12 @@ if (api_get_setting('search_enabled')=='true') |
|
|
|
|
* $form -> addElement ('radio', 'split_steps',null, get_lang('SplitStepsPerChapter'),'per_chapter'); |
|
|
|
|
*/ |
|
|
|
|
$form -> addElement ('hidden', 'split_steps','per_page'); |
|
|
|
|
|
|
|
|
|
$form -> addElement ('submit', 'convert', get_lang('ConvertToLP'), 'class="convert_button"'); |
|
|
|
|
|
|
|
|
|
$form -> addElement ('hidden', 'woogie', 'true'); |
|
|
|
|
|
|
|
|
|
$form -> add_real_progress_bar(md5(rand(0,10000)), 'user_file', 1, true); |
|
|
|
|
|
|
|
|
|
$defaults = array('split_steps'=>'per_page','index_document'=>'checked="checked"'); |
|
|
|
|
$form -> setDefaults($defaults); |
|
|
|
|
|
|
|
|
|
// display the form |
|
|
|
|
$form -> display(); |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
============================================================================== |
|
|
|
|
FOOTER |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
Display::display_footer(); |
|
|
|
|
|
|
|
|
|
?> |