2001-11-22 06:23:56 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
|
|
|
// Manage all uploaded files in a course file area
|
|
|
|
|
|
|
|
// All the Moodle-specific stuff is in this top section
|
|
|
|
// Configuration and access control occurs here.
|
|
|
|
// Must define: USER, basedir, baseweb, html_header and html_footer
|
|
|
|
// USER is a persistent variable using sessions
|
|
|
|
|
|
|
|
require("../config.php");
|
|
|
|
|
|
|
|
require_variable($id);
|
2003-01-02 13:08:20 +00:00
|
|
|
optional_variable($file, "");
|
|
|
|
optional_variable($wdir, "");
|
|
|
|
optional_variable($action, "");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
if (! $course = get_record("course", "id", $id) ) {
|
|
|
|
error("That's an invalid course id");
|
|
|
|
}
|
|
|
|
|
|
|
|
require_login($course->id);
|
|
|
|
|
|
|
|
if (! isteacher($course->id) ) {
|
|
|
|
error("Only teachers can edit files");
|
|
|
|
}
|
|
|
|
|
|
|
|
function html_footer() {
|
|
|
|
global $course;
|
|
|
|
echo "</td></tr></table></body></html>";
|
|
|
|
print_footer($course);
|
|
|
|
}
|
|
|
|
|
2002-08-30 13:18:06 +00:00
|
|
|
function html_header($course, $wdir, $formfield=""){
|
2002-08-18 15:26:04 +00:00
|
|
|
|
2003-08-01 15:09:35 +00:00
|
|
|
global $CFG;
|
|
|
|
|
2002-08-18 15:26:04 +00:00
|
|
|
$strfiles = get_string("files");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
2002-08-30 13:18:06 +00:00
|
|
|
if ($wdir == "/") {
|
2003-08-01 15:09:35 +00:00
|
|
|
$fullnav = "$strfiles";
|
2002-08-30 13:18:06 +00:00
|
|
|
} else {
|
|
|
|
$dirs = explode("/", $wdir);
|
|
|
|
$numdirs = count($dirs);
|
|
|
|
$link = "";
|
|
|
|
$navigation = "";
|
|
|
|
for ($i=1; $i<$numdirs; $i++) {
|
|
|
|
$navigation .= " -> ";
|
|
|
|
$link .= "/".urlencode($dirs[$i]);
|
|
|
|
$navigation .= "<A HREF=\"index.php?id=$course->id&wdir=$link\">".$dirs[$i]."</A>";
|
|
|
|
}
|
2003-08-01 15:09:35 +00:00
|
|
|
$fullnav = "<a href=\"index.php?id=$course->id&wdir=/\">$strfiles</a> $navigation";
|
|
|
|
}
|
2002-08-30 13:18:06 +00:00
|
|
|
|
2003-08-01 15:09:35 +00:00
|
|
|
if (! $site = get_site()) {
|
|
|
|
error("Invalid site!");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($course->id == $site->id) {
|
|
|
|
print_header("$course->shortname: $strfiles", "$course->fullname",
|
|
|
|
"<a href=\"../$CFG->admin/index.php\">".get_string("administration").
|
|
|
|
"</a> -> $fullnav", $formfield);
|
|
|
|
} else {
|
2002-08-30 13:18:06 +00:00
|
|
|
print_header("$course->shortname: $strfiles", "$course->fullname",
|
2003-08-01 15:09:35 +00:00
|
|
|
"<a href=\"../course/view.php?id=$course->id\">$course->shortname".
|
|
|
|
"</a> -> $fullnav", $formfield);
|
2002-08-30 13:18:06 +00:00
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<table border=0 align=center cellspacing=3 cellpadding=3 width=640>";
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<td colspan=\"2\">";
|
|
|
|
}
|
|
|
|
|
2002-08-07 03:45:22 +00:00
|
|
|
if (! $basedir = make_upload_directory("$course->id")) {
|
2002-08-04 16:20:30 +00:00
|
|
|
error("The site administrator needs to fix the file permissions");
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$baseweb = $CFG->wwwroot;
|
|
|
|
|
|
|
|
// End of configuration and access control
|
|
|
|
|
|
|
|
require("mimetypes.php");
|
|
|
|
|
|
|
|
$regexp="\\.\\.";
|
|
|
|
if (ereg( $regexp, $file, $regs )| ereg( $regexp, $wdir,$regs )) {
|
|
|
|
$message = "Error: Directories can not contain \"..\"";
|
|
|
|
$wdir = "/";
|
|
|
|
$action = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$wdir) {
|
|
|
|
$wdir="/";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch ($action) {
|
|
|
|
|
|
|
|
case "upload":
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2003-01-05 04:20:32 +00:00
|
|
|
if (!empty($_FILES['userfile'])) {
|
|
|
|
$userfile = $_FILES['userfile'];
|
|
|
|
} else {
|
|
|
|
$save = false;
|
|
|
|
}
|
|
|
|
if (!empty($save)) {
|
|
|
|
if (!is_uploaded_file($userfile['tmp_name']) or $userfile['size'] == 0) {
|
|
|
|
notify(get_string("uploadnofilefound"));
|
2001-11-22 06:23:56 +00:00
|
|
|
} else {
|
2002-08-07 03:45:22 +00:00
|
|
|
$userfile_name = clean_filename($userfile['name']);
|
|
|
|
if ($userfile_name) {
|
2001-11-22 06:23:56 +00:00
|
|
|
$newfile = "$basedir$wdir/$userfile_name";
|
2002-08-07 03:45:22 +00:00
|
|
|
if (move_uploaded_file($userfile['tmp_name'], $newfile)) {
|
2003-01-20 14:04:06 +00:00
|
|
|
chmod($newfile, 0666);
|
2003-01-05 04:20:32 +00:00
|
|
|
$a = NULL;
|
|
|
|
$a->file = "$userfile_name (".$userfile['type'].")";
|
|
|
|
$a->directory = $wdir;
|
|
|
|
print_string("uploadedfileto", "", $a);
|
2002-08-07 03:45:22 +00:00
|
|
|
} else {
|
2003-01-05 04:20:32 +00:00
|
|
|
notify(get_string("uploadproblem", "", $userfile_name));
|
2002-08-07 03:45:22 +00:00
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
displaydir($wdir);
|
|
|
|
|
|
|
|
} else {
|
2002-09-01 14:28:08 +00:00
|
|
|
$upload_max_filesize = get_max_upload_file_size();
|
|
|
|
$filesize = display_size($upload_max_filesize);
|
2002-08-07 08:24:38 +00:00
|
|
|
|
2003-01-05 04:20:32 +00:00
|
|
|
$struploadafile = get_string("uploadafile");
|
|
|
|
$struploadthisfile = get_string("uploadthisfile");
|
|
|
|
$strmaxsize = get_string("maxsize", "", $filesize);
|
|
|
|
$strcancel = get_string("cancel");
|
|
|
|
|
|
|
|
echo "<P>$struploadafile ($strmaxsize) --> <B>$wdir</B>";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<TABLE><TR><TD COLSPAN=2>";
|
|
|
|
echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"post\" ACTION=index.php>";
|
2002-08-07 03:45:22 +00:00
|
|
|
echo " <INPUT TYPE=hidden NAME=MAX_FILE_SIZE value=\"$upload_max_filesize\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=upload>";
|
2003-01-05 04:20:32 +00:00
|
|
|
echo " <INPUT NAME=\"userfile\" TYPE=\"file\" size=\"60\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo " </TD><TR><TD WIDTH=10>";
|
2003-01-05 04:20:32 +00:00
|
|
|
echo " <INPUT TYPE=submit NAME=save VALUE=\"$struploadthisfile\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD><TD WIDTH=100%>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
2003-01-05 04:20:32 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD></TR></TABLE>";
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "delete":
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($confirm)) {
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2001-11-22 06:23:56 +00:00
|
|
|
foreach ($USER->filelist as $file) {
|
|
|
|
$fullfile = $basedir.$file;
|
|
|
|
if (! fulldelete($fullfile)) {
|
|
|
|
echo "<BR>Error: Could not delete: $fullfile";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clearfilelist();
|
|
|
|
displaydir($wdir);
|
|
|
|
html_footer();
|
|
|
|
|
|
|
|
} else {
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2003-01-05 06:45:20 +00:00
|
|
|
if (setfilelist($_POST)) {
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<P ALIGN=CENTER>You are about to delete:</P>";
|
|
|
|
print_simple_box_start("center");
|
|
|
|
printfilelist($USER->filelist);
|
|
|
|
print_simple_box_end();
|
|
|
|
echo "<BR>";
|
|
|
|
notice_yesno ("Are you sure you want to delete these?",
|
|
|
|
"index.php?id=$id&wdir=$wdir&action=delete&confirm=1",
|
|
|
|
"index.php?id=$id&wdir=$wdir&action=cancel");
|
|
|
|
} else {
|
|
|
|
displaydir($wdir);
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "move":
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2003-01-05 06:45:20 +00:00
|
|
|
if ($count = setfilelist($_POST)) {
|
2001-11-22 06:23:56 +00:00
|
|
|
$USER->fileop = $action;
|
|
|
|
$USER->filesource = $wdir;
|
|
|
|
echo "<P align=center>$count files selected for moving. Now go to the destination and press \"Move files to here\".</P>";
|
|
|
|
}
|
|
|
|
displaydir($wdir);
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "paste":
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2003-01-02 13:08:20 +00:00
|
|
|
if (isset($USER->fileop) and $USER->fileop == "move") {
|
2001-11-22 06:23:56 +00:00
|
|
|
foreach ($USER->filelist as $file) {
|
|
|
|
$shortfile = basename($file);
|
|
|
|
$oldfile = $basedir.$file;
|
|
|
|
$newfile = $basedir.$wdir."/".$shortfile;
|
|
|
|
if (!rename($oldfile, $newfile)) {
|
|
|
|
echo "<P>Error: $shortfile not moved";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clearfilelist();
|
|
|
|
displaydir($wdir);
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "rename":
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($name)) {
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2001-11-22 06:23:56 +00:00
|
|
|
$name = clean_filename($name);
|
|
|
|
if (file_exists($basedir.$wdir."/".$name)) {
|
|
|
|
echo "Error: $name already exists!";
|
|
|
|
} else if (!rename($basedir.$wdir."/".$oldname, $basedir.$wdir."/".$name)) {
|
|
|
|
echo "Error: could not rename $oldname to $name";
|
|
|
|
}
|
|
|
|
displaydir($wdir);
|
|
|
|
|
|
|
|
} else {
|
2003-08-04 16:07:17 +00:00
|
|
|
$strrename = get_string("rename");
|
|
|
|
$strcancel = get_string("cancel");
|
|
|
|
$strrenamefileto = get_string("renamefileto", "moodle", $file);
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir, "form.name");
|
2003-08-04 16:07:17 +00:00
|
|
|
echo "<P>$strrenamefileto:";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<TABLE><TR><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=post NAME=form>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=rename>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=oldname VALUE=\"$file\">";
|
|
|
|
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"$file\">";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strrename\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD></TR></TABLE>";
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "mkdir":
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($name)) {
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2001-11-22 06:23:56 +00:00
|
|
|
$name = clean_filename($name);
|
2003-04-25 08:39:11 +00:00
|
|
|
if (file_exists("$basedir$wdir/$name")) {
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "Error: $name already exists!";
|
2003-04-25 08:39:11 +00:00
|
|
|
} else if (! make_upload_directory("$course->id/$wdir/$name")) {
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "Error: could not create $name";
|
|
|
|
}
|
|
|
|
displaydir($wdir);
|
|
|
|
|
|
|
|
} else {
|
2003-08-04 16:07:17 +00:00
|
|
|
$strcreate = get_string("create");
|
|
|
|
$strcancel = get_string("cancel");
|
|
|
|
$strcreatefolder = get_string("createfolder", "moodle", $wdir);
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir, "form.name");
|
2003-08-04 16:07:17 +00:00
|
|
|
echo "<P>$strcreatefolder:";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<TABLE><TR><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=post NAME=form>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir>";
|
|
|
|
echo " <INPUT TYPE=text NAME=name SIZE=35>";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strcreate\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strcancel\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD></TR></TABLE>";
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "edit":
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2001-11-22 06:23:56 +00:00
|
|
|
if (isset($text)) {
|
|
|
|
$fileptr = fopen($basedir.$file,"w");
|
|
|
|
fputs($fileptr, stripslashes($text));
|
|
|
|
fclose($fileptr);
|
|
|
|
displaydir($wdir);
|
|
|
|
|
|
|
|
} else {
|
2002-12-26 16:26:55 +00:00
|
|
|
$streditfile = get_string("edit", "", "<B>$file</B>");
|
2001-11-22 06:23:56 +00:00
|
|
|
$fileptr = fopen($basedir.$file, "r");
|
|
|
|
$contents = fread($fileptr, filesize($basedir.$file));
|
|
|
|
fclose($fileptr);
|
|
|
|
|
2002-12-26 16:26:55 +00:00
|
|
|
if (mimeinfo("type", $file) == "text/html") {
|
|
|
|
if ($usehtmleditor = can_use_richtext_editor()) {
|
|
|
|
$onsubmit = "onsubmit=\"copyrichtext(document.form.text);\"";
|
|
|
|
} else {
|
|
|
|
$onsubmit = "";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$usehtmleditor = false;
|
|
|
|
$onsubmit = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
print_heading("$streditfile");
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<TABLE><TR><TD COLSPAN=2>";
|
2002-12-26 16:26:55 +00:00
|
|
|
echo "<FORM ACTION=\"index.php\" METHOD=\"post\" NAME=\"form\" $onsubmit>";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=file VALUE=\"$file\">";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=edit>";
|
2002-12-26 16:26:55 +00:00
|
|
|
print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents);
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</TD></TR><TR><TD>";
|
2002-08-30 13:18:06 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("savechanges")."\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
2002-08-30 13:18:06 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD></TR></TABLE>";
|
2002-12-26 16:26:55 +00:00
|
|
|
|
|
|
|
if ($usehtmleditor) {
|
|
|
|
print_richedit_javascript("form", "text", "yes");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "zip":
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($name)) {
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2001-11-22 06:23:56 +00:00
|
|
|
$name = clean_filename($name);
|
2003-04-06 05:53:47 +00:00
|
|
|
if (empty($CFG->zip)) { // Use built-in php-based zip function
|
|
|
|
$files = array();
|
|
|
|
foreach ($USER->filelist as $file) {
|
2003-06-19 13:12:34 +00:00
|
|
|
$files[] = "$basedir/$file";
|
2003-04-06 05:53:47 +00:00
|
|
|
}
|
|
|
|
include_once('../lib/pclzip/pclzip.lib.php');
|
|
|
|
$archive = new PclZip("$basedir/$wdir/$name");
|
|
|
|
if (($list = $archive->create($files,'',"$basedir/$wdir/")) == 0) {
|
|
|
|
error($archive->errorInfo(true));
|
|
|
|
}
|
|
|
|
} else { // Use external zip program
|
|
|
|
$files = "";
|
|
|
|
foreach ($USER->filelist as $file) {
|
|
|
|
$files .= basename($file);
|
|
|
|
$files .= " ";
|
|
|
|
}
|
|
|
|
$command = "cd $basedir/$wdir ; $CFG->zip -r $name $files";
|
|
|
|
Exec($command);
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
clearfilelist();
|
|
|
|
displaydir($wdir);
|
|
|
|
|
|
|
|
} else {
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir, "form.name");
|
2003-08-04 16:07:17 +00:00
|
|
|
|
2003-01-05 06:45:20 +00:00
|
|
|
if (setfilelist($_POST)) {
|
2003-08-04 16:07:17 +00:00
|
|
|
echo "<P ALIGN=CENTER>".get_string("youareabouttocreatezip").":</P>";
|
2001-11-22 06:23:56 +00:00
|
|
|
print_simple_box_start("center");
|
|
|
|
printfilelist($USER->filelist);
|
|
|
|
print_simple_box_end();
|
|
|
|
echo "<BR>";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo "<P ALIGN=CENTER>".get_string("whattocallzip");
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<TABLE><TR><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=post NAME=form>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=zip>";
|
|
|
|
echo " <INPUT TYPE=text NAME=name SIZE=35 VALUE=\"new.zip\">";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("createziparchive")."\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD><TD>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
2003-08-04 16:07:17 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"".get_string("cancel")."\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD></TR></TABLE>";
|
|
|
|
} else {
|
|
|
|
displaydir($wdir);
|
|
|
|
clearfilelist();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "unzip":
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($file)) {
|
2003-04-06 05:53:47 +00:00
|
|
|
$strname = get_string("name");
|
|
|
|
$strsize = get_string("size");
|
|
|
|
$strmodified = get_string("modified");
|
|
|
|
$strstatus = get_string("status");
|
|
|
|
$strok = get_string("ok");
|
|
|
|
$strunpacking = get_string("unpacking", "", $file);
|
|
|
|
|
|
|
|
echo "<P ALIGN=CENTER>$strunpacking:</P>";
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
$file = basename($file);
|
2003-04-06 05:53:47 +00:00
|
|
|
|
|
|
|
if (empty($CFG->unzip)) { // Use built-in php-based unzip function
|
|
|
|
include_once('../lib/pclzip/pclzip.lib.php');
|
|
|
|
$archive = new PclZip("$basedir/$wdir/$file");
|
|
|
|
if (!$list = $archive->extract("$basedir/$wdir")) {
|
|
|
|
error($archive->errorInfo(true));
|
|
|
|
} else { // print some output
|
|
|
|
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
|
|
|
|
echo "<tr><th align=left>$strname</th>";
|
|
|
|
echo "<th align=right>$strsize</th>";
|
|
|
|
echo "<th align=right>$strmodified</th>";
|
|
|
|
echo "<th align=right>$strstatus</th></tr>";
|
|
|
|
foreach ($list as $item) {
|
|
|
|
echo "<tr>";
|
|
|
|
$item['filename'] = str_replace("$basedir/$wdir/", "", $item['filename']);
|
|
|
|
print_cell("left", $item['filename']);
|
|
|
|
if (! $item['folder']) {
|
|
|
|
print_cell("right", display_size($item['size']));
|
|
|
|
} else {
|
|
|
|
echo "<td> </td>";
|
|
|
|
}
|
|
|
|
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
|
|
|
|
print_cell("right", $filedate);
|
|
|
|
print_cell("right", $item['status']);
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
echo "</table>";
|
|
|
|
}
|
|
|
|
|
|
|
|
} else { // Use external unzip program
|
|
|
|
print_simple_box_start("center");
|
|
|
|
echo "<PRE>";
|
|
|
|
$command = "cd $basedir/$wdir ; $CFG->unzip -o $file 2>&1";
|
|
|
|
passthru($command);
|
|
|
|
echo "</PRE>";
|
|
|
|
print_simple_box_end();
|
|
|
|
}
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<CENTER><FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
2003-04-06 05:53:47 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</CENTER>";
|
|
|
|
} else {
|
|
|
|
displaydir($wdir);
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
2003-04-06 05:53:47 +00:00
|
|
|
case "listzip":
|
|
|
|
html_header($course, $wdir);
|
|
|
|
if (!empty($file)) {
|
|
|
|
$strname = get_string("name");
|
|
|
|
$strsize = get_string("size");
|
|
|
|
$strmodified = get_string("modified");
|
|
|
|
$strok = get_string("ok");
|
|
|
|
$strlistfiles = get_string("listfiles", "", $file);
|
|
|
|
|
|
|
|
echo "<P ALIGN=CENTER>$strlistfiles:</P>";
|
|
|
|
$file = basename($file);
|
|
|
|
|
|
|
|
include_once('../lib/pclzip/pclzip.lib.php');
|
|
|
|
$archive = new PclZip("$basedir/$wdir/$file");
|
|
|
|
if (!$list = $archive->listContent("$basedir/$wdir")) {
|
|
|
|
notify($archive->errorInfo(true));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
echo "<table cellpadding=\"4\" cellspacing=\"2\" border=\"0\" width=640>";
|
|
|
|
echo "<tr><th align=left>$strname</th><th align=right>$strsize</th><th align=right>$strmodified</th></tr>";
|
|
|
|
foreach ($list as $item) {
|
|
|
|
echo "<tr>";
|
|
|
|
print_cell("left", $item['filename']);
|
|
|
|
if (! $item['folder']) {
|
|
|
|
print_cell("right", display_size($item['size']));
|
|
|
|
} else {
|
|
|
|
echo "<td> </td>";
|
|
|
|
}
|
|
|
|
$filedate = userdate($item['mtime'], get_string("strftimedatetime"));
|
|
|
|
print_cell("right", $filedate);
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
|
|
|
echo "</table>";
|
|
|
|
}
|
|
|
|
echo "<br><center><form action=index.php method=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=$wdir>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=cancel>";
|
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strok\">";
|
|
|
|
echo "</FORM>";
|
|
|
|
echo "</CENTER>";
|
|
|
|
} else {
|
|
|
|
displaydir($wdir);
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
2003-05-14 23:09:34 +00:00
|
|
|
case "restore":
|
|
|
|
html_header($course, $wdir);
|
|
|
|
if (!empty($file)) {
|
|
|
|
echo "<P ALIGN=CENTER>".get_string("youaregoingtorestorefrom")."</P>";
|
|
|
|
print_simple_box_start("center");
|
|
|
|
echo $file;
|
|
|
|
print_simple_box_end();
|
|
|
|
echo "<BR>";
|
2003-07-09 04:56:04 +00:00
|
|
|
$restore_path = "../backup/restore.php";
|
2003-05-14 23:09:34 +00:00
|
|
|
notice_yesno (get_string("areyousuretorestorethis"),
|
2003-08-02 10:08:57 +00:00
|
|
|
$restore_path."?id=".$id."&file=".$id.$wdir."/".$file,
|
2003-05-14 23:09:34 +00:00
|
|
|
"index.php?id=$id&wdir=$wdir&action=cancel");
|
|
|
|
} else {
|
|
|
|
displaydir($wdir);
|
|
|
|
}
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
case "cancel";
|
|
|
|
clearfilelist();
|
|
|
|
|
|
|
|
default:
|
2002-08-30 13:18:06 +00:00
|
|
|
html_header($course, $wdir);
|
2001-11-22 06:23:56 +00:00
|
|
|
displaydir($wdir);
|
|
|
|
html_footer();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// FILE FUNCTIONS ///////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
function fulldelete($location) {
|
|
|
|
if (is_dir($location)) {
|
|
|
|
$currdir = opendir($location);
|
|
|
|
while ($file = readdir($currdir)) {
|
|
|
|
if ($file <> ".." && $file <> ".") {
|
|
|
|
$fullfile = $location."/".$file;
|
|
|
|
if (is_dir($fullfile)) {
|
|
|
|
if (!fulldelete($fullfile)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (!unlink($fullfile)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir($currdir);
|
|
|
|
if (! rmdir($location)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if (!unlink($location)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setfilelist($VARS) {
|
|
|
|
global $USER;
|
|
|
|
|
|
|
|
$USER->filelist = array ();
|
|
|
|
$USER->fileop = "";
|
|
|
|
|
|
|
|
$count = 0;
|
|
|
|
foreach ($VARS as $key => $val) {
|
|
|
|
if (substr($key,0,4) == "file") {
|
|
|
|
$count++;
|
|
|
|
$USER->filelist[] = rawurldecode($val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $count;
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearfilelist() {
|
|
|
|
global $USER;
|
|
|
|
|
|
|
|
$USER->filelist = array ();
|
|
|
|
$USER->fileop = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function printfilelist($filelist) {
|
|
|
|
global $basedir;
|
|
|
|
|
|
|
|
foreach ($filelist as $file) {
|
|
|
|
if (is_dir($basedir.$file)) {
|
|
|
|
echo "<IMG SRC=\"pix/folder.gif\" HEIGHT=16 WIDTH=16> $file<BR>";
|
|
|
|
$subfilelist = array();
|
|
|
|
$currdir = opendir($basedir.$file);
|
|
|
|
while ($subfile = readdir($currdir)) {
|
|
|
|
if ($subfile <> ".." && $subfile <> ".") {
|
|
|
|
$subfilelist[] = $file."/".$subfile;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printfilelist($subfilelist);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$icon = mimeinfo("icon", $file);
|
|
|
|
echo "<IMG SRC=\"pix/$icon\" HEIGHT=16 WIDTH=16> $file<BR>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function print_cell($alignment="center", $text=" ") {
|
|
|
|
echo "<TD ALIGN=\"$alignment\" NOWRAP>";
|
|
|
|
echo "<FONT SIZE=\"-1\" FACE=\"Arial, Helvetica\">";
|
|
|
|
echo "$text";
|
|
|
|
echo "</FONT>";
|
|
|
|
echo "</TD>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
function displaydir ($wdir) {
|
|
|
|
// $wdir == / or /a or /a/b/c/d etc
|
|
|
|
|
|
|
|
global $basedir;
|
|
|
|
global $id;
|
2002-08-28 13:41:38 +00:00
|
|
|
global $USER, $CFG;
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
$fullpath = $basedir.$wdir;
|
|
|
|
|
|
|
|
$directory = opendir($fullpath); // Find all files
|
|
|
|
while ($file = readdir($directory)) {
|
|
|
|
if ($file == "." || $file == "..") {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_dir($fullpath."/".$file)) {
|
|
|
|
$dirlist[] = $file;
|
|
|
|
} else {
|
|
|
|
$filelist[] = $file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir($directory);
|
|
|
|
|
2002-08-30 13:18:06 +00:00
|
|
|
$strname = get_string("name");
|
|
|
|
$strsize = get_string("size");
|
|
|
|
$strmodified = get_string("modified");
|
|
|
|
$straction = get_string("action");
|
|
|
|
$strmakeafolder = get_string("makeafolder");
|
|
|
|
$struploadafile = get_string("uploadafile");
|
|
|
|
$strwithchosenfiles = get_string("withchosenfiles");
|
|
|
|
$strmovetoanotherfolder = get_string("movetoanotherfolder");
|
|
|
|
$strmovefilestohere = get_string("movefilestohere");
|
|
|
|
$strdeletecompletely = get_string("deletecompletely");
|
|
|
|
$strcreateziparchive = get_string("createziparchive");
|
|
|
|
$strrename = get_string("rename");
|
|
|
|
$stredit = get_string("edit");
|
|
|
|
$strunzip = get_string("unzip");
|
2003-04-06 05:53:47 +00:00
|
|
|
$strlist = get_string("list");
|
2003-05-14 23:09:34 +00:00
|
|
|
$strrestore= get_string("restore");
|
2002-08-30 13:18:06 +00:00
|
|
|
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
echo "<FORM ACTION=\"index.php\" METHOD=post NAME=dirform>";
|
|
|
|
echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>";
|
|
|
|
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>";
|
|
|
|
echo "<TR>";
|
|
|
|
echo "<TH WIDTH=5></TH>";
|
2002-08-30 13:18:06 +00:00
|
|
|
echo "<TH ALIGN=left>$strname</TH>";
|
|
|
|
echo "<TH ALIGN=right>$strsize</TH>";
|
|
|
|
echo "<TH ALIGN=right>$strmodified</TH>";
|
|
|
|
echo "<TH ALIGN=right>$straction</TH>";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</TR>\n";
|
|
|
|
|
|
|
|
if ($wdir == "/") {
|
|
|
|
$wdir = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
$count = 0;
|
|
|
|
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($dirlist)) {
|
2001-11-22 06:23:56 +00:00
|
|
|
asort($dirlist);
|
|
|
|
foreach ($dirlist as $dir) {
|
|
|
|
|
|
|
|
$count++;
|
|
|
|
|
|
|
|
$filename = $fullpath."/".$dir;
|
|
|
|
$fileurl = rawurlencode($wdir."/".$dir);
|
|
|
|
$filesafe = rawurlencode($dir);
|
2002-11-19 14:27:57 +00:00
|
|
|
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
echo "<TR>";
|
|
|
|
|
|
|
|
print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\">");
|
|
|
|
print_cell("left", "<A HREF=\"index.php?id=$id&wdir=$fileurl\"><IMG SRC=\"pix/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\"></A> <A HREF=\"index.php?id=$id&wdir=$fileurl\">".htmlspecialchars($dir)."</A>");
|
|
|
|
print_cell("right", "-");
|
|
|
|
print_cell("right", $filedate);
|
2002-08-30 13:18:06 +00:00
|
|
|
print_cell("right", "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
echo "</TR>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($filelist)) {
|
2001-11-22 06:23:56 +00:00
|
|
|
asort($filelist);
|
|
|
|
foreach ($filelist as $file) {
|
|
|
|
|
|
|
|
$icon = mimeinfo("icon", $file);
|
|
|
|
|
|
|
|
$count++;
|
|
|
|
$filename = $fullpath."/".$file;
|
|
|
|
$fileurl = "$wdir/$file";
|
|
|
|
$filesafe = rawurlencode($file);
|
|
|
|
$fileurlsafe = rawurlencode($fileurl);
|
2002-11-19 14:27:57 +00:00
|
|
|
$filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
echo "<TR>";
|
|
|
|
|
|
|
|
print_cell("center", "<INPUT TYPE=checkbox NAME=\"file$count\" VALUE=\"$fileurl\">");
|
|
|
|
echo "<TD ALIGN=left NOWRAP>";
|
2002-08-26 09:48:00 +00:00
|
|
|
if ($CFG->slasharguments) {
|
|
|
|
$ffurl = "/file.php/$id$fileurl";
|
|
|
|
} else {
|
|
|
|
$ffurl = "/file.php?file=/$id$fileurl";
|
|
|
|
}
|
|
|
|
link_to_popup_window ($ffurl, "display",
|
2001-11-22 06:23:56 +00:00
|
|
|
"<IMG SRC=\"pix/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">",
|
|
|
|
480, 640);
|
|
|
|
echo "<FONT SIZE=\"-1\" FACE=\"Arial, Helvetica\">";
|
2002-08-26 09:48:00 +00:00
|
|
|
link_to_popup_window ($ffurl, "display",
|
2001-11-22 06:23:56 +00:00
|
|
|
htmlspecialchars($file),
|
|
|
|
480, 640);
|
|
|
|
echo "</FONT></TD>";
|
|
|
|
|
2002-09-01 14:28:08 +00:00
|
|
|
$file_size = filesize($filename);
|
|
|
|
print_cell("right", display_size($file_size));
|
2001-11-22 06:23:56 +00:00
|
|
|
print_cell("right", $filedate);
|
|
|
|
if ($icon == "text.gif" || $icon == "html.gif") {
|
2002-08-30 13:18:06 +00:00
|
|
|
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=edit\">$stredit</A>";
|
2001-11-22 06:23:56 +00:00
|
|
|
} else if ($icon == "zip.gif") {
|
2003-04-06 05:53:47 +00:00
|
|
|
$edittext = "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=unzip\">$strunzip</A> ";
|
|
|
|
$edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$fileurl&action=listzip\">$strlist</A> ";
|
2003-08-02 10:08:57 +00:00
|
|
|
if (!empty($CFG->backup_version) && isteacher($id)) {
|
2003-05-14 23:09:34 +00:00
|
|
|
$edittext .= "<A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=restore\">$strrestore</A> ";
|
|
|
|
}
|
2001-11-22 06:23:56 +00:00
|
|
|
} else {
|
|
|
|
$edittext = "";
|
|
|
|
}
|
2002-08-30 13:18:06 +00:00
|
|
|
print_cell("right", "$edittext <A HREF=\"index.php?id=$id&wdir=$wdir&file=$filesafe&action=rename\">$strrename</A>");
|
2001-11-22 06:23:56 +00:00
|
|
|
|
|
|
|
echo "</TR>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</TABLE>";
|
|
|
|
echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>";
|
|
|
|
|
2003-01-02 13:08:20 +00:00
|
|
|
if (empty($wdir)) {
|
2001-11-22 06:23:56 +00:00
|
|
|
$wdir = "/";
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<TABLE BORDER=0 cellspacing=2 cellpadding=2 width=640>";
|
|
|
|
echo "<TR><TD>";
|
|
|
|
echo "<INPUT TYPE=hidden NAME=id VALUE=\"$id\">";
|
|
|
|
echo "<INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\"> ";
|
|
|
|
$options = array (
|
2002-08-30 13:18:06 +00:00
|
|
|
"move" => "$strmovetoanotherfolder",
|
|
|
|
"delete" => "$strdeletecompletely",
|
|
|
|
"zip" => "$strcreateziparchive"
|
2001-11-22 06:23:56 +00:00
|
|
|
);
|
2003-01-02 13:08:20 +00:00
|
|
|
if (!empty($count)) {
|
2002-08-30 13:18:06 +00:00
|
|
|
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
|
2001-11-22 06:23:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
echo "</FORM>";
|
|
|
|
echo "<TD ALIGN=center>";
|
2003-01-08 09:08:05 +00:00
|
|
|
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=paste>";
|
2002-08-30 13:18:06 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strmovefilestohere\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
}
|
|
|
|
echo "<TD ALIGN=right>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=mkdir>";
|
2002-08-30 13:18:06 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$strmakeafolder\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD>";
|
|
|
|
echo "<TD ALIGN=right>";
|
|
|
|
echo "<FORM ACTION=index.php METHOD=get>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=id VALUE=$id>";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=wdir VALUE=\"$wdir\">";
|
|
|
|
echo " <INPUT TYPE=hidden NAME=action VALUE=upload>";
|
2002-08-30 13:18:06 +00:00
|
|
|
echo " <INPUT TYPE=submit VALUE=\"$struploadafile\">";
|
2001-11-22 06:23:56 +00:00
|
|
|
echo "</FORM>";
|
|
|
|
echo "</TD></TR>";
|
|
|
|
echo "</TABLE>";
|
|
|
|
echo "<HR WIDTH=640 ALIGN=CENTER NOSHADE SIZE=1>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|