processUploads();
$manager->deleteFiles();
$refreshDir = false;
//process any directory functions
if ($manager->deleteDirs() || $manager->processNewDir())
$refreshDir = true;
//check for any sub-directory request
//check that the requested sub-directory exists
//and valid
if (isset($_REQUEST['dir'])) {
$path = rawurldecode($_REQUEST['dir']);
if ($manager->validRelativePath($path)) {
$relative = $path;
}
}
$manager = new ImageManager($IMConfig);
//get the list of files and directories
$list = $manager->getFiles($relative);
/* ================= OUTPUT/DRAW FUNCTIONS ======================= */
/**
* Draw the files in an table.
*/
function drawFiles($list, &$manager) {
global $relative;
global $IMConfig;
// add filename with course code in it
// here filename is images/gallery/COMES.jpg
// it should be /chamilo1884url/courses/COURSTESTSIMSUURLAPP/document/
global $_configuration;
//var topDoc = window.top.document;
$course_id = api_get_course_id();
$in_course = $course_id != -1 ? true : false;
foreach ($list as $entry => $file) {
//$chamiloPath = '/'.$_configuration['url_append'].'/courses/'.api_get_course_path().'/document'.$file['relative'];
?>