From dfb1ba063c5b803e1c3d61184b236a9d766b7df7 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 4 Aug 2013 21:44:02 -0500 Subject: [PATCH] Code style for Woogie - not fixed yet --- main/newscorm/lp_upload.php | 4 +- main/upload/upload_word.php | 190 +++++++++++++++--------------------- 2 files changed, 83 insertions(+), 111 deletions(-) diff --git a/main/newscorm/lp_upload.php b/main/newscorm/lp_upload.php index b67b7814ca..7cf5be2258 100644 --- a/main/newscorm/lp_upload.php +++ b/main/newscorm/lp_upload.php @@ -100,7 +100,7 @@ if( Request::is_post() && $is_error){ break; case 'woogie': require_once 'openoffice_text.class.php'; - $split_steps = $_POST['split_steps']; + $split_steps = (empty($_POST['split_steps']) || $_POST['split_steps'] == 'per_page') ? 'per_page' : 'per_chapter'; $o_doc = new OpenofficeText($split_steps); $first_item_id = $o_doc->convert_document($_FILES['user_file']); break; @@ -178,4 +178,4 @@ if( Request::is_post() && $is_error){ default: return api_failure::set_failure('not_a_learning_path'); } -} \ No newline at end of file +} diff --git a/main/upload/upload_word.php b/main/upload/upload_word.php index 6ade4ceb75..df128becbc 100644 --- a/main/upload/upload_word.php +++ b/main/upload/upload_word.php @@ -1,7 +1,8 @@ @@ -16,20 +17,18 @@ $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= ' -