[svn r18558] bring several items to the folder structure for users

skala
Juan Carlos Raña 16 years ago
parent bdc2a138ed
commit 72a778aa1e
  1. 9
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajax_file_upload.php
  2. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php
  3. 239
      main/inc/lib/fckeditor/repositories_config.php

@ -81,7 +81,14 @@
{
$dokeosFolder=$group_properties['directory'].$dokeosFolder;//get Dokeos
}
$doc_id = add_document($_course, $dokeosFolder,'file', $dokeosFileSize , $dokeosFile); //get Dokeos
if(api_is_allowed_to_edit())
{
$doc_id = add_document($_course, $dokeosFolder,'file', $dokeosFileSize , $dokeosFile); //get Dokeos
}
else
{
$doc_id = add_document($_course, '/shared_folder/'.$dokeosFolder,'file', $dokeosFileSize , $dokeosFile); //get Dokeos
}
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', api_get_user_id(),$to_group_id);//get Dokeos
}

@ -101,7 +101,7 @@
}
else
{
$PathDokeosAjaxFileManager='../../../../../../../courses/'.$_course['path'].'/document/shared_folder/';
$PathDokeosAjaxFileManager='../../../../../../../courses/'.$_course['path'].'/document/shared_folder/'.api_get_user_id();
}
}
}

@ -1,80 +1,159 @@
<?php
/**
* Aditional system config settings for document repositories, the Dokeos LMS
* @author Juan Carlos Ra<EFBFBD>a
* @since 31/December/2008
*/
require_once api_get_path(LIBRARY_PATH).'/fileUpload.lib.php';
$permissions_for_new_directories = api_get_setting('permissions_for_new_directories');
$permissions_for_new_directories = octdec(!empty($permissions_for_new_directories) ? $permissions_for_new_directories : '0777');
$permissions_for_new_files = api_get_setting('permissions_for_new_files');
$permissions_for_new_files = octdec(!empty($permissions_for_new_files) ? $permissions_for_new_files : '0777');
if (!empty($_course['path']))
{
require_once api_get_path(LIBRARY_PATH).'/document.lib.php';
require_once api_get_path(LIBRARY_PATH).'/groupmanager.lib.php';
// Get the Dokeos session properties. Before ajaximagemanager!!!
$to_group_id = !empty($_SESSION['_gid']) ? $_SESSION['_gid'] : 0 ;
$group_properties = GroupManager::get_group_properties($_SESSION['_gid']);
$is_user_in_group = GroupManager::is_user_in_group($_user['user_id'],$_SESSION['_gid']);
}
$user_folder = api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/';
// Sanity checks for Dokeos.
// Creation of a user owned folder if it does not exist.
if (!file_exists($user_folder))
{
// A recursive call of mkdir function.
@mkdir(api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/', 0777, true);
}
// Creation of repository used by paltform administrators if it does not exist.
if (api_is_platform_admin())
{
$homepage_folder = api_get_path(SYS_PATH).'home/default_platform_document/';
if (!file_exists($homepage_folder))
{
@mkdir(api_get_path(SYS_PATH).'home/default_platform_document/', 0777);
}
}
// Creation in the course document repository of a shared folder if it does not exist.
if (api_is_in_course())
{
$course_shared_folder = api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/';
if (!file_exists($course_shared_folder))
{
@mkdir(api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/', 0777);
$doc_id = add_document($_course, '/shared_folder', 'folder', 0, 'shared_folder');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'visible', api_get_user_id());
}
// Added by Ivan Tcholakov.
// When the current user is inside a course, his/her own hidden folder is created (if it does not exist) under shared_folder.
// This new folder is to be used by the online editor when the user is not in group-specific context.
// The name of the newly created folder is the user_id, the title is created from user names (first name and last name).
if (!file_exists($course_shared_folder.'/'.api_get_user_id())) {
//@todo call the create_unexisting_directory function and replace this code
$new_user_dir = api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/'.api_get_user_id();
@mkdir($new_user_dir);
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
chmod($new_user_dir,$perm);
$doc_id = add_document($_course, '/shared_folder/'.api_get_user_id(), 'folder', 0, $_user['firstName'].' '.$_user['lastName']);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', api_get_user_id());
}
}
?>
<<<<<<< .mine
<?php
/**
* Aditional system config settings for document repositories, the Dokeos LMS
* @author Juan Carlos Raña
* @since 31/December/2008
*/
require_once api_get_path(LIBRARY_PATH).'/fileUpload.lib.php';
$permissions_for_new_directories = api_get_setting('permissions_for_new_directories');
$permissions_for_new_directories = octdec(!empty($permissions_for_new_directories) ? $permissions_for_new_directories : '0777');
$permissions_for_new_files = api_get_setting('permissions_for_new_files');
$permissions_for_new_files = octdec(!empty($permissions_for_new_files) ? $permissions_for_new_files : '0777');
if (!empty($_course['path']))
{
require_once api_get_path(LIBRARY_PATH).'/document.lib.php';
require_once api_get_path(LIBRARY_PATH).'/groupmanager.lib.php';
// Get the Dokeos session properties. Before ajaximagemanager!!!
$to_group_id = !empty($_SESSION['_gid']) ? $_SESSION['_gid'] : 0 ;
$group_properties = GroupManager::get_group_properties($_SESSION['_gid']);
$is_user_in_group = GroupManager::is_user_in_group($_user['user_id'],$_SESSION['_gid']);
}
$user_folder = api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/';
// Sanity checks for Dokeos.
// Creation of a user owned folder if it does not exist.
if (!file_exists($user_folder))
{
// A recursive call of mkdir function.
@mkdir(api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/', 0777, true);
}
// Creation of repository used by paltform administrators if it does not exist.
if (api_is_platform_admin())
{
$homepage_folder = api_get_path(SYS_PATH).'home/default_platform_document/';
if (!file_exists($homepage_folder))
{
@mkdir(api_get_path(SYS_PATH).'home/default_platform_document/', 0777);
}
}
// Creation in the course document repository of a shared folder if it does not exist.
if (api_is_in_course())
{
$course_shared_folder = api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/';
if (!file_exists($course_shared_folder))
{
@mkdir(api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/', 0777);
$doc_id = add_document($_course, '/shared_folder', 'folder', 0, 'shared_folder');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'visible', api_get_user_id());
}
// Added by Ivan Tcholakov.
// When the current user is inside a course, his/her own hidden folder is created (if it does not exist) under shared_folder.
// This new folder is to be used by the online editor when the user is not in group-specific context.
// The name of the newly created folder is the user_id, the title is created from user names (first name and last name).
if (!file_exists($course_shared_folder.'/'.api_get_user_id()))
{
@mkdir(api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/'.api_get_user_id().'/', 0777);
$doc_id = add_document($_course, '/shared_folder/'.api_get_user_id(), 'folder', 0, $_user['firstName'].' '.$_user['lastName']);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', api_get_user_id());
}
}
?>
=======
<?php
/**
* Aditional system config settings for document repositories, the Dokeos LMS
* @author Juan Carlos Ra�a
* @since 31/December/2008
*/
require_once api_get_path(LIBRARY_PATH).'/fileUpload.lib.php';
$permissions_for_new_directories = api_get_setting('permissions_for_new_directories');
$permissions_for_new_directories = octdec(!empty($permissions_for_new_directories) ? $permissions_for_new_directories : '0777');
$permissions_for_new_files = api_get_setting('permissions_for_new_files');
$permissions_for_new_files = octdec(!empty($permissions_for_new_files) ? $permissions_for_new_files : '0777');
if (!empty($_course['path']))
{
require_once api_get_path(LIBRARY_PATH).'/document.lib.php';
require_once api_get_path(LIBRARY_PATH).'/groupmanager.lib.php';
// Get the Dokeos session properties. Before ajaximagemanager!!!
$to_group_id = !empty($_SESSION['_gid']) ? $_SESSION['_gid'] : 0 ;
$group_properties = GroupManager::get_group_properties($_SESSION['_gid']);
$is_user_in_group = GroupManager::is_user_in_group($_user['user_id'],$_SESSION['_gid']);
}
$user_folder = api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/';
// Sanity checks for Dokeos.
// Creation of a user owned folder if it does not exist.
if (!file_exists($user_folder))
{
// A recursive call of mkdir function.
@mkdir(api_get_path(SYS_PATH).'main/upload/users/'.api_get_user_id().'/my_files/', 0777, true);
}
// Creation of repository used by paltform administrators if it does not exist.
if (api_is_platform_admin())
{
$homepage_folder = api_get_path(SYS_PATH).'home/default_platform_document/';
if (!file_exists($homepage_folder))
{
@mkdir(api_get_path(SYS_PATH).'home/default_platform_document/', 0777);
}
}
// Creation in the course document repository of a shared folder if it does not exist.
if (api_is_in_course())
{
$course_shared_folder = api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/';
if (!file_exists($course_shared_folder))
{
@mkdir(api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/', 0777);
$doc_id = add_document($_course, '/shared_folder', 'folder', 0, 'shared_folder');
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'visible', api_get_user_id());
}
// Added by Ivan Tcholakov.
// When the current user is inside a course, his/her own hidden folder is created (if it does not exist) under shared_folder.
// This new folder is to be used by the online editor when the user is not in group-specific context.
// The name of the newly created folder is the user_id, the title is created from user names (first name and last name).
if (!file_exists($course_shared_folder.'/'.api_get_user_id())) {
//@todo call the create_unexisting_directory function and replace this code
$new_user_dir = api_get_path(SYS_PATH).'courses/'.$_course['path'].'/document/shared_folder/'.api_get_user_id().'/';
@mkdir($new_user_dir);
$perm = api_get_setting('permissions_for_new_directories');
$perm = octdec(!empty($perm)?$perm:'0770');
chmod($new_user_dir,$perm);
$doc_id = add_document($_course, '/shared_folder/'.api_get_user_id(), 'folder', 0, $_user['firstName'].' '.$_user['lastName']);
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'invisible', api_get_user_id());
}
}
?>
>>>>>>> .r18557

Loading…
Cancel
Save