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 ''."\n"; $msg->printInfos('OVER_QUOTA'); } } // Directory and File listing echo ''; ?>