diff --git a/main/inc/lib/add_course.lib.inc.php b/main/inc/lib/add_course.lib.inc.php index a0646bc0d3..a59ebf9697 100644 --- a/main/inc/lib/add_course.lib.inc.php +++ b/main/inc/lib/add_course.lib.inc.php @@ -202,6 +202,7 @@ function prepare_course_repository($courseRepository, $courseId) mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document", $perm); mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/images", $perm); mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/images/gallery/", $perm); + mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/images/gallery/shared/", $perm); mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/audio", $perm); mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/flash", $perm); mkdir(api_get_path(SYS_COURSE_PATH).$courseRepository . "/document/video", $perm); diff --git a/main/install/update-files-1.8.5-1.8.6.inc.php b/main/install/update-files-1.8.5-1.8.6.inc.php index b83b97baa0..1fc7764784 100755 --- a/main/install/update-files-1.8.5-1.8.6.inc.php +++ b/main/install/update-files-1.8.5-1.8.6.inc.php @@ -19,6 +19,20 @@ require_once("../inc/lib/main_api.lib.php"); require_once("../inc/lib/fileUpload.lib.php"); require_once('../inc/lib/database.lib.php'); +/* +============================================================================== + FUNCTIONS +============================================================================== +*/ +function insert_db($db_name, $folder_name, $text){ + + $_course['dbName'] = $db_name; + + $doc_id = add_document_180($_course, '/'.$folder_name, 'folder', 0, ucfirst($text)); + api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', 1); + +} + if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE')) { // Edit the Dokeos config file @@ -109,6 +123,16 @@ if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE')) mkdir($currentCourseRepositorySys."document/images",$perm); insert_db($db_name,"images",get_lang('Images')); } + //document > images + if(!is_dir($currentCourseRepositorySys."document/images/gallery")){ + mkdir($currentCourseRepositorySys."document/images/gallery",$perm); + insert_db($db_name,"gallery",get_lang('Gallery')); + } + //document > images + if(!is_dir($currentCourseRepositorySys."document/images/gallery/shared")){ + mkdir($currentCourseRepositorySys."document/images/gallery/shared",$perm); + insert_db($db_name,"shared",get_lang('SharedImagesDirectory')); + } //document > video if(!is_dir($currentCourseRepositorySys."document/video")){ mkdir($currentCourseRepositorySys."document/video",$perm);