add/edit alternatives $pid = intval($_GET['pid']); // primary resource id, used at "adapted content" page, => add/edit alternatives $a_type = intval($_GET['a_type']); // alternative_type, used at "adapted content" page, => add/edit alternatives if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) { $get_file = 'get.php/'; } else { $get_file = 'content/' . $_course_id . '/'; } function fm_path(){ global $pathext, $framed, $popup, $cp, $cid, $pid, $a_type, $_course_id; echo '

'._AT('current_path').' '; if (isset($pathext) && $pathext != '') { echo ''._AT('home').' '; } else { $pathext = ''; echo _AT('home'); } if ($pathext == '' && isset($_POST['pathext'])) { $pathext = urlencode($_POST['pathext']); } if ($pathext != '') { $bits = explode('/', $pathext); foreach ($bits as $bit) { if ($bit != '') { $bit_path .= $bit . '/'; echo ' / '; if ($bit_path == $pathext) { echo $bit; } else { echo '' . $bit . ''; } } } $bit_path = ""; $bit = ""; } echo '

'; } if ($popup == TRUE) { $totalcol = 6; } else { $totalcol = 5; } $labelcol = 3; if (TRUE || $framed != TRUE) { if ($_GET['overwrite'] != '') { // get file name, out of the full path $path_parts = pathinfo($current_path.$_GET['overwrite']); if (!file_exists($path_parts['dirname'].'/'.$pathext.$path_parts['basename']) || !file_exists($path_parts['dirname'].'/'.$pathext.substr($path_parts['basename'], 5))) { /* source and/or destination does not exist */ $msg->addErrors('CANNOT_OVERWRITE_FILE'); } else { @unlink($path_parts['dirname'].'/'.$pathext.substr($path_parts['basename'], 5)); $result = @rename($path_parts['dirname'].'/'.$pathext.$path_parts['basename'], $path_parts['dirname'].'/'.$pathext.substr($path_parts['basename'], 5)); if ($result) { $msg->addFeedback('FILE_OVERWRITE'); } else { $msg->addErrors('CANNOT_OVERWRITE_FILE'); } } } // filemanager listing table // make new directory echo '
'._AT('add_file_folder').''."\n"; echo '
'."\n"; echo '
'."\n"; if( $MakeDirOn ) { if ($depth < $MaxDirDepth) { echo '
'."\n"; echo '  '._AT('keep_it_short').'
'."\n"; echo ' '."\n"; echo ' '."\n"; echo ' '."\n"; } else { echo _AT('depth_reached')."\n"; } } echo ' '."\n"; echo '
'."\n"; echo '
'."\n"; echo '

'."\n"; // If flash is available, provide the option of using Fluid's uploader or the basic uploader if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") { echo '
'."\n"; if (isset($_COOKIE["fluid_on"]) && $_COOKIE["fluid_on"]=="yes") $fluid_on = 'checked="checked"'; echo '( '."\n"; echo ')'."\n"; echo '
'."\n"; } // Create a new file echo '
'."\n"; $course_row = $coursesDAO->get($_course_id); if ($course_row['max_quota'] == '' || is_null($course_row['max_quota'])) $my_MaxCourseSize = $MaxCourseSize; // upload file if ($course_row['max_quota'] == TR_COURSESIZE_UNLIMITED || $my_MaxCourseSize-$course_total > 0) { echo '
'._AT('OR').'
'."\n".'
'."\n"; if (isset($_SESSION['flash']) && $_SESSION['flash'] == "yes") { ?>

Use the Browse button to add a file, and the Save button to upload it.

File Name Size
File Upload Queue:
File Name Placeholder 0 KB
Choose Browse files to add files to the queue.
'; else echo '
'; } else { // Display as regular if there's no Flash detected echo '
'."\n"; } // Simple single file uploader echo '
'; echo ''; echo '
'."\n"; echo ' '; echo ''; echo ''; echo ' '; if ($popup == TRUE) { echo ''; } echo '
'; echo '
'; echo '
'."\n".'
'; } else { echo ' '."\n"; $msg->printInfos('OVER_QUOTA'); } } // Directory and File listing echo '
'; echo ''; echo ''; if ($cid > 0) echo ''; // display the section to use a remote URL as an alternative if ($a_type > 0) { ?>
'.$file.''; $fileicon = ' '; $fileicon .= ''._AT('folder').':'.$file.''; $fileicon .= ' '; if(!$MakeDirOn) { $deletelink = ''; } $is_dir = true; } else if ($ext == 'zip') { $totalBytes += $filedata[7]; $filename = $file; $fileicon = ' '._AT('zip_archive').':'.$file.' '; } else { $totalBytes += $filedata[7]; $filename = $file; $fileicon = '  '; } $file1 = strtolower($file); // create listing for dirctor or file if ($is_dir) { $dirs[$file1] .= ''; $dirs[$file1] .= ''; $dirs[$file1] .= ''; $dirs[$file1] .= ''; $dirs[$file1] .= ''; } else { $files[$file1] .= ''; $files[$file1] .= ''; $files[$file1] .= ''; $files[$file1] .= ''; $files[$file1] .= ''; } } // end while // sort listing and output directories if (is_array($dirs)) { ksort($dirs, SORT_STRING); foreach($dirs as $x => $y) { echo $y; } } //sort listing and output files if (is_array($files)) { ksort($files, SORT_STRING); foreach($files as $x => $y) { echo $y; } } echo '
 
:   
:   
:  
'; $dirs[$file1] .= ' '; $dirs[$file1] .= $filename.' '; $dirs[$file1] .= AT_date(_AT('filemanager_date_format'), $filedata[10], TR_DATE_UNIX_TIMESTAMP); $dirs[$file1] .= ' '; $dirs[$file1] .= FileUtility::get_human_size($size).'
'; $files[$file1] .= '  '; if ($framed) { $files[$file1] .= ''.$filename.''; } else { $files[$file1] .= ''.$filename.''; } if ($ext == 'zip') { $files[$file1] .= ' '; $files[$file1] .= ''._AT('extract_archive').''; $files[$file1] .= ''; } if (in_array($ext, $editable_file_types)) { $files[$file1] .= ' '; $files[$file1] .= ''._AT('edit').''; $files[$file1] .= ''; } $files[$file1] .= ' '; if ($popup == TRUE) { if ($a_type > 0) // define content alternative { $files[$file1] .= ' '; } else $files[$file1] .= ' '; } $files[$file1] .= AT_date(_AT('filemanager_date_format'), $filedata[10], TR_DATE_UNIX_TIMESTAMP); $files[$file1] .= ' '; $files[$file1] .= FileUtility::get_human_size($filedata[7]).'
'; ?>