From 01b11c7ffc30974e00be8200a6ca5cb8f14d1d1a Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Wed, 21 Jan 2009 22:49:22 +0100 Subject: [PATCH] [svn r17913] Added shared directory inside images/gallery to allow users to upload their pictures for images inserts into forums and all that --- main/inc/lib/add_course.lib.inc.php | 1 + main/install/update-files-1.8.5-1.8.6.inc.php | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) 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);