Fixing bug when uploading an scorm package when the learning_path folder doesn't exists see #4841

skala
Julio Montoya 14 years ago
parent e41bec4923
commit 838d458375
  1. 13
      main/newscorm/learnpath.class.php
  2. 3
      main/newscorm/lp_controller.php
  3. 2
      main/newscorm/lp_list.php
  4. 2
      main/newscorm/lp_upload.php

@ -5271,9 +5271,11 @@ class learnpath {
return $return;
}
public function generate_lp_folder($course) {
$filepath = '';
//Creating learning_path folder
/**
* Creates the default learning path folder
*/
public function generate_learning_path_folder($course) {
//Creating learning_path folder
$dir = '/learning_path';
$filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document';
$folder = null;
@ -5282,8 +5284,13 @@ class learnpath {
} else {
$folder = true;
}
return $folder;
}
public function generate_lp_folder($course) {
$filepath = '';
$dir = '/learning_path/';
$folder = self::generate_learning_path_folder($course);
//Creating LP folder
if ($folder) {
//Limits title size

@ -442,9 +442,7 @@ switch ($action) {
$_SESSION['refresh'] = 1;
require 'lp_view_item.php';
}
break;
case 'upload':
if (!$is_allowed_to_edit) {
api_not_allowed(true);
@ -489,7 +487,6 @@ switch ($action) {
if (!$lp_found) { error_log('New LP - No learnpath given for export_to_pdf', 0); require 'lp_list.php';
} else {
$result = $_SESSION['oLP']->scorm_export_to_pdf($_GET['lp_id']);
var_dump($result);exit;
if (!$result) {
require 'lp_list.php';
}

@ -503,4 +503,6 @@ if (!empty($flat_list)) {
echo '</div>';
}
}
$course_info = api_get_course_info();
$result = learnpath::generate_learning_path_folder($course_info);
Display::display_footer();

@ -56,6 +56,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && count($_FILES) > 0 && !empty($_FILES
$maker = Database::escape_string($_REQUEST['content_maker']);
}
switch ($type) {
case 'scorm':
require_once 'scorm.class.php';

Loading…
Cancel
Save