Documents: Use show_system_folders to show/hide default folders #3621

pull/3673/head
Angel Fernando Quiroz Campos 5 years ago
parent f67911dccb
commit 02cb0d7129
  1. 35
      main/inc/lib/document.lib.php

@ -4202,16 +4202,6 @@ class DocumentManager
*/
public static function is_folder_to_avoid($path, $is_certificate_mode = false)
{
$foldersToAvoid = [
'/HotPotatoes_files',
'/certificates',
];
$systemFolder = api_get_course_setting('show_system_folders');
if ($systemFolder == 1) {
$foldersToAvoid = [];
}
if (basename($path) == 'css') {
return true;
}
@ -4223,6 +4213,23 @@ class DocumentManager
}
}
$foldersToAvoid = [
'/HotPotatoes_files',
'/certificates',
];
$showSystemFolder = api_get_course_setting('show_system_folders');
// Admin setting for Hide/Show Default folders to all users
if (api_get_setting('show_default_folders') == 'false'
|| 2 == $showSystemFolder
) {
$foldersToAvoid[] = '/images';
$foldersToAvoid[] = '/flash';
$foldersToAvoid[] = '/audio';
$foldersToAvoid[] = '/video';
$foldersToAvoid[] = '/learning_path';
}
// Admin setting for Hide/Show the folders of all users
if (api_get_setting('show_users_folders') == 'false') {
$foldersToAvoid[] = '/shared_folder';
@ -4232,14 +4239,6 @@ class DocumentManager
}
}
// Admin setting for Hide/Show Default folders to all users
if (api_get_setting('show_default_folders') == 'false') {
$foldersToAvoid[] = '/images';
$foldersToAvoid[] = '/flash';
$foldersToAvoid[] = '/audio';
$foldersToAvoid[] = '/video';
}
// Admin setting for Hide/Show chat history folder
if (api_get_setting('show_chat_folder') == 'false') {
$foldersToAvoid[] = '/chat_files';

Loading…
Cancel
Save