[svn r17913] Added shared directory inside images/gallery to allow users to upload their pictures for images inserts into forums and all that

skala
Yannick Warnier 16 years ago
parent ed0bc4d954
commit 01b11c7ffc
  1. 1
      main/inc/lib/add_course.lib.inc.php
  2. 24
      main/install/update-files-1.8.5-1.8.6.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);

@ -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);

Loading…
Cancel
Save