diff --git a/files/index.php b/files/index.php index 729fada51aa..3ba59a1f6d8 100644 --- a/files/index.php +++ b/files/index.php @@ -1,4 +1,4 @@ -"; - print_footer($course); + + global $course, $choose; + + if ($choose) { + echo ""; + } else { + echo ""; + print_footer($course); + } } function html_header($course, $wdir, $formfield=""){ - - global $CFG; + global $CFG, $THEME, $ME, $choose; if (! $site = get_site()) { error("Invalid site!"); @@ -45,7 +60,7 @@ } else { $strfiles = get_string("files"); } - + if ($wdir == "/") { $fullnav = "$strfiles"; } else { @@ -56,29 +71,65 @@ for ($i=1; $i<$numdirs-1; $i++) { $navigation .= " -> "; $link .= "/".urlencode($dirs[$i]); - $navigation .= "id&wdir=$link\">".$dirs[$i].""; + $navigation .= "id&wdir=$link&choose=$choose\">".$dirs[$i].""; } - $fullnav = "id&wdir=/\">$strfiles $navigation -> ".$dirs[$numdirs-1]; + $fullnav = "id&wdir=/&choose=$choose\">$strfiles $navigation -> ".$dirs[$numdirs-1]; } - if ($course->id == $site->id) { - print_header("$course->shortname: $strfiles", "$course->fullname", - "admin/index.php\">".get_string("administration"). - " -> $fullnav", $formfield); - print_heading(get_string("publicsitefileswarning"), "center", 2); + if ($choose) { + print_header(); + + $chooseparts = explode('.', $choose); + + ?> + + + ', '»', "$course->shortname -> $fullnav"); + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'; + + if ($course->id == $site->id) { + print_heading(get_string("publicsitefileswarning"), "center", 2); + } } else { - print_header("$course->shortname: $strfiles", "$course->fullname", - "id\">$course->shortname". - " -> $fullnav", $formfield); + + if ($course->id == $site->id) { + print_header("$course->shortname: $strfiles", "$course->fullname", + "admin/index.php\">".get_string("administration"). + " -> $fullnav", $formfield); + + print_heading(get_string("publicsitefileswarning"), "center", 2); + + } else { + print_header("$course->shortname: $strfiles", "$course->fullname", + "id\">$course->shortname". + " -> $fullnav", $formfield); + } } + echo ""; echo ""; echo "\n"; + echo ""; + echo "\n"; } function displaydir ($wdir) { @@ -613,6 +659,7 @@ function displaydir ($wdir) { global $basedir; global $id; global $USER, $CFG; + global $choose; $fullpath = $basedir.$wdir; @@ -646,18 +693,20 @@ function displaydir ($wdir) { $strunzip = get_string("unzip"); $strlist = get_string("list"); $strrestore= get_string("restore"); + $strchoose = get_string("choose"); - echo ""; - echo "
"; - echo "
"; + } + if (! $basedir = make_upload_directory("$course->id")) { error("The site administrator needs to fix the file permissions"); } @@ -87,7 +138,6 @@ // End of configuration and access control - require("mimetypes.php"); if (!$wdir) { $wdir="/"; @@ -111,31 +161,16 @@ case "upload": html_header($course, $wdir); - if (!empty($_FILES['userfile'])) { - $userfile = $_FILES['userfile']; - } else { - $save = false; - } + require_once($CFG->dirroot.'/lib/uploadlib.php'); + if (!empty($save) and confirm_sesskey()) { - if (!is_uploaded_file($userfile['tmp_name']) or $userfile['size'] == 0) { - notify(get_string("uploadnofilefound")); - } else { - $userfile_name = clean_filename($userfile['name']); - if ($userfile_name) { - $newfile = "$basedir$wdir/$userfile_name"; - if (move_uploaded_file($userfile['tmp_name'], $newfile)) { - chmod($newfile, 0666); - $a = NULL; - $a->file = "$userfile_name (".$userfile['type'].")"; - $a->directory = $wdir; - print_string("uploadedfileto", "", $a); - } else { - notify(get_string("uploadproblem", "", $userfile_name)); - } - } + $um = new upload_manager('userfile',false,false,$course,false,0); + $dir = "$basedir$wdir"; + if ($um->process_file_uploads($dir)) { + notify(get_string('uploadedfile')); } + // um will take care of error reporting. displaydir($wdir); - } else { $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes); // Restricted by site setting $filesize = display_size($upload_max_filesize); @@ -145,26 +180,27 @@ $strmaxsize = get_string("maxsize", "", $filesize); $strcancel = get_string("cancel"); - echo "

$struploadafile ($strmaxsize) --> $wdir"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; + echo "

$struploadafile ($strmaxsize) --> $wdir"; + echo "
"; + echo ""; + echo ' '; + echo " "; + echo " "; + echo " "; echo " sesskey\" />"; - echo " "; - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + upload_print_form_fragment(1,array('userfile'),null,false,null,$course->maxbytes,0,false); + echo "

"; + echo " "; + echo ""; + echo ""; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; } html_footer(); break; @@ -175,7 +211,7 @@ foreach ($USER->filelist as $file) { $fullfile = $basedir.$file; if (! fulldelete($fullfile)) { - echo "
Error: Could not delete: $fullfile"; + echo "
Error: Could not delete: $fullfile"; } } clearfilelist(); @@ -185,14 +221,14 @@ } else { html_header($course, $wdir); if (setfilelist($_POST)) { - echo "

".get_string("deletecheckwarning").":

"; + echo "

".get_string("deletecheckwarning").":

"; print_simple_box_start("center"); printfilelist($USER->filelist); print_simple_box_end(); echo "
"; notice_yesno (get_string("deletecheckfiles"), - "index.php?id=$id&wdir=$wdir&action=delete&confirm=1&sesskey=$USER->sesskey", - "index.php?id=$id&wdir=$wdir&action=cancel"); + "index.php?id=$id&wdir=$wdir&action=delete&confirm=1&sesskey=$USER->sesskey", + "index.php?id=$id&wdir=$wdir&action=cancel"); } else { displaydir($wdir); } @@ -205,7 +241,7 @@ if (($count = setfilelist($_POST)) and confirm_sesskey()) { $USER->fileop = $action; $USER->filesource = $wdir; - echo "

"; + echo "

"; print_string("selectednowmove", "moodle", $count); echo "

"; } @@ -221,7 +257,7 @@ $oldfile = $basedir.$file; $newfile = $basedir.$wdir."/".$shortfile; if (!rename($oldfile, $newfile)) { - echo "

Error: $shortfile not moved"; + echo "

Error: $shortfile not moved"; } } } @@ -246,25 +282,27 @@ $strcancel = get_string("cancel"); $strrenamefileto = get_string("renamefileto", "moodle", $file); html_header($course, $wdir, "form.name"); - echo "

$strrenamefileto:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; + echo "

$strrenamefileto:"; + echo "
"; + echo ""; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; echo " sesskey\" />"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + echo " "; + echo " "; + echo ""; + echo "

"; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; } html_footer(); break; @@ -285,24 +323,26 @@ $strcancel = get_string("cancel"); $strcreatefolder = get_string("createfolder", "moodle", $wdir); html_header($course, $wdir, "form.name"); - echo "

$strcreatefolder:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; + echo "

$strcreatefolder:"; + echo "
"; + echo ""; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; echo " sesskey\" />"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + echo " "; + echo ""; + echo "

"; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; } html_footer(); break; @@ -316,7 +356,7 @@ displaydir($wdir); } else { - $streditfile = get_string("edit", "", "$file"); + $streditfile = get_string("edit", "", "$file"); $fileptr = fopen($basedir.$file, "r"); $contents = fread($fileptr, filesize($basedir.$file)); fclose($fileptr); @@ -330,25 +370,27 @@ print_heading("$streditfile"); - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; + echo "
"; + echo ""; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; echo " sesskey\" />"; print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + echo "
"; + echo " "; + echo ""; + echo ""; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; if ($usehtmleditor) { use_html_editor(); @@ -380,29 +422,31 @@ html_header($course, $wdir, "form.name"); if (setfilelist($_POST)) { - echo "

".get_string("youareabouttocreatezip").":

"; + echo "

".get_string("youareabouttocreatezip").":

"; print_simple_box_start("center"); printfilelist($USER->filelist); print_simple_box_end(); - echo "
"; - echo "

".get_string("whattocallzip"); - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; + echo "
"; + echo "

".get_string("whattocallzip"); + echo "
"; + echo ""; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; echo " sesskey\" />"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + echo " "; + echo ""; + echo "

"; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; } else { displaydir($wdir); clearfilelist(); @@ -417,7 +461,7 @@ $strok = get_string("ok"); $strunpacking = get_string("unpacking", "", $file); - echo "

$strunpacking:

"; + echo "

$strunpacking:

"; $file = basename($file); @@ -425,13 +469,14 @@ error(get_string("unzipfileserror","error")); } - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; } else { displaydir($wdir); } @@ -447,7 +492,7 @@ $strok = get_string("ok"); $strlistfiles = get_string("listfiles", "", $file); - echo "

$strlistfiles:

"; + echo "

$strlistfiles:

"; $file = basename($file); include_once("$CFG->libdir/pclzip/pclzip.lib.php"); @@ -456,8 +501,8 @@ notify($archive->errorInfo(true)); } else { - echo ""; - echo ""; + echo "
$strname$strsize$strmodified
"; + echo ""; foreach ($list as $item) { echo ""; print_cell("left", $item['filename']); @@ -472,13 +517,14 @@ } echo "
$strname$strsize$strmodified
"; } - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; } else { displaydir($wdir); } @@ -488,7 +534,7 @@ case "restore": html_header($course, $wdir); if (!empty($file) and confirm_sesskey()) { - echo "

".get_string("youaregoingtorestorefrom").":

"; + echo "

".get_string("youaregoingtorestorefrom").":

"; print_simple_box_start("center"); echo $file; print_simple_box_end(); @@ -581,7 +627,7 @@ function printfilelist($filelist) { foreach ($filelist as $file) { if (is_dir($basedir.$file)) { - echo "pixpath/f/folder.gif\" height=16 width=16> $file
"; + echo "pixpath/f/folder.gif\" height=\"16\" width=\"16\" alt=\"\" /> $file
"; $subfilelist = array(); $currdir = opendir($basedir.$file); while ($subfile = readdir($currdir)) { @@ -593,18 +639,18 @@ function printfilelist($filelist) { } else { $icon = mimeinfo("icon", $file); - echo "pixpath/f/$icon\" height=16 width=16> $file
"; + echo "pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"\" /> $file
"; } } } function print_cell($alignment="center", $text=" ") { - echo "
"; - echo ""; + echo ""; + echo ""; echo "$text"; - echo ""; - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; + echo ""; + echo ''; + echo "
"; + echo "
$strname$strsize$strmodified$straction
"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; if ($wdir == "/") { $wdir = ""; @@ -677,15 +726,15 @@ function displaydir ($wdir) { $filesize = display_size(get_directory_size("$fullpath/$dir")); $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p"); - echo ""; + echo ""; - print_cell("center", ""); - print_cell("left", "pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\">".htmlspecialchars($dir).""); + print_cell("center", ""); + print_cell("left", "pixpath/f/folder.gif\" height=\"16\" width=\"16\" border=\"0\" alt=\"Folder\" />".htmlspecialchars($dir).""); print_cell("right", "$filesize"); print_cell("right", $filedate); - print_cell("right", "$strrename"); + print_cell("right", "$strrename"); - echo ""; + echo ""; } } @@ -703,17 +752,23 @@ function displaydir ($wdir) { $fileurlsafe = rawurlencode($fileurl); $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p"); + if (substr($fileurl,0,1) == '/') { + $selectfile = substr($fileurl,1); + } else { + $selectfile = $fileurl; + } + echo ""; - print_cell("center", ""); - echo ""; + echo ""; } } - echo "
$strname$strsize$strmodified$straction
"; + print_cell("center", ""); + echo ""; if ($CFG->slasharguments) { $ffurl = "/file.php/$id$fileurl"; } else { $ffurl = "/file.php?file=/$id$fileurl"; } link_to_popup_window ($ffurl, "display", - "pixpath/f/$icon\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"File\">", + "pixpath/f/$icon\" height=\"16\" width=\"16\" border=\"0\" alt=\"File\" />", 480, 640); echo ""; link_to_popup_window ($ffurl, "display", @@ -724,33 +779,40 @@ function displaydir ($wdir) { $file_size = filesize($filename); print_cell("right", display_size($file_size)); print_cell("right", $filedate); - if ($icon == "text.gif" || $icon == "html.gif") { - $edittext = "$stredit"; - } else if ($icon == "zip.gif") { - $edittext = "sesskey\">$strunzip "; - $edittext .= "sesskey\">$strlist "; - if (!empty($CFG->backup_version) and isteacheredit($id)) { - $edittext .= "sesskey\">$strrestore "; - } + + if ($choose) { + $edittext = "$strchoose "; } else { - $edittext = ""; + $edittext = ''; } - print_cell("right", "$edittext $strrename"); + + + if ($icon == "text.gif" || $icon == "html.gif") { + $edittext .= "$stredit"; + } else if ($icon == "zip.gif") { + $edittext .= "sesskey&choose=$choose\">$strunzip "; + $edittext .= "sesskey&choose=$choose\">$strlist "; + if (!empty($CFG->backup_version) and isteacheredit($id)) { + $edittext .= "sesskey&choose=$choose\">$strrestore "; + } + } + + print_cell("right", "$edittext $strrename"); - echo "
"; - echo "
"; + echo ""; + echo "
"; if (empty($wdir)) { $wdir = "/"; } - echo ""; - echo ""; + echo ""; + echo "
"; - echo ""; - echo " "; + echo ""; + echo ""; - echo ""; - echo "
"; + echo ""; + echo " "; echo "sesskey\" />"; $options = array ( "move" => "$strmovetoanotherfolder", @@ -761,35 +823,37 @@ function displaydir ($wdir) { choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()"); } - echo ""; - echo ""; + echo ""; + echo ""; if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { - echo "
"; - echo " "; - echo " "; - echo " "; + echo ""; + echo ' '; + echo " "; + echo " "; + echo " "; echo " sesskey\" />"; - echo " "; - echo "
"; + echo " "; + echo ""; } - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; + echo "
"; + echo "
"; + echo ' '; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; + echo "
"; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
"; + echo "
"; + echo "
"; } diff --git a/mod/resource/coursefiles.php b/mod/resource/coursefiles.php deleted file mode 100644 index ab16b92f813..00000000000 --- a/mod/resource/coursefiles.php +++ /dev/null @@ -1,788 +0,0 @@ -id); - - if (! isteacheredit($course->id) ) { - error("You need to be a teacher with editing privileges"); - } - - function html_footer() { - echo ""; - } - - function html_header($course, $wdir, $formfield=""){ - - global $CFG, $THEME, $ME; - - if (! $site = get_site()) { - error("Invalid site!"); - } - - if ($course->id == $site->id) { - $strfiles = get_string("sitefiles"); - } else { - $strfiles = get_string("files"); - } - - if ($wdir == "/") { - $fullnav = "$strfiles"; - } else { - $dirs = explode("/", $wdir); - $numdirs = count($dirs); - $link = ""; - $navigation = ""; - for ($i=1; $i<$numdirs-1; $i++) { - $navigation .= " -> "; - $link .= "/".urlencode($dirs[$i]); - $navigation .= "id&wdir=$link\">".$dirs[$i].""; - } - $fullnav = "id&wdir=/\">$strfiles $navigation -> ".$dirs[$numdirs-1]; - } - - print_header(); - ?> - - ', '»', "$course->shortname -> $fullnav"); - echo ''; - echo ''; - echo ''; - echo ''; - echo '
'; - - if ($course->id == $site->id) { - print_heading(get_string("publicsitefileswarning"), "center", 2); - } - - echo ""; - echo ""; - echo "\n"; -} - -function displaydir ($wdir) { -// $wdir == / or /a or /a/b/c/d etc - - global $basedir; - global $id; - global $USER, $CFG, $ME; - - $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); - - $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"); - $strlist = get_string("list"); - $strchoose = get_string("choose"); - - - echo ""; - echo "
"; - } - - if (! $basedir = make_upload_directory("$course->id")) { - error("The site administrator needs to fix the file permissions"); - } - - $baseweb = $CFG->wwwroot; - -// End of configuration and access control - - - if (!$wdir) { - $wdir="/"; - } - - if (($wdir != '/' and detect_munged_arguments($wdir, 0)) - or ($file != '' and detect_munged_arguments($file, 0))) { - $message = "Error: Directories can not contain \"..\""; - $wdir = "/"; - $action = ""; - } - - - switch ($action) { - - case "upload": - html_header($course, $wdir); - - if (!empty($_FILES['userfile'])) { - $userfile = $_FILES['userfile']; - } else { - $save = false; - } - if (!empty($save) and confirm_sesskey()) { - if (!is_uploaded_file($userfile['tmp_name']) or $userfile['size'] == 0) { - notify(get_string("uploadnofilefound")); - } else { - $userfile_name = clean_filename($userfile['name']); - if ($userfile_name) { - $newfile = "$basedir$wdir/$userfile_name"; - if (move_uploaded_file($userfile['tmp_name'], $newfile)) { - chmod($newfile, 0666); - $a = NULL; - $a->file = "$userfile_name (".$userfile['type'].")"; - $a->directory = $wdir; - print_string("uploadedfileto", "", $a); - } else { - notify(get_string("uploadproblem", "", $userfile_name)); - } - } - } - displaydir($wdir); - - } else { - $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes); - $filesize = display_size($upload_max_filesize); - - $struploadafile = get_string("uploadafile"); - $struploadthisfile = get_string("uploadthisfile"); - $strmaxsize = get_string("maxsize", "", $filesize); - $strcancel = get_string("cancel"); - - echo "

$struploadafile ($strmaxsize) --> $wdir"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " sesskey\" />"; - echo " "; - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "delete": - if (!empty($confirm) and confirm_sesskey()) { - html_header($course, $wdir); - foreach ($USER->filelist as $file) { - $fullfile = $basedir.$file; - if (! fulldelete($fullfile)) { - echo "
Error: Could not delete: $fullfile"; - } - } - clearfilelist(); - displaydir($wdir); - html_footer(); - - } else { - html_header($course, $wdir); - if (setfilelist($_POST)) { - echo "

".get_string("deletecheckwarning").":

"; - print_simple_box_start("center"); - printfilelist($USER->filelist); - print_simple_box_end(); - echo "
"; - notice_yesno (get_string("deletecheckfiles"), - "".basename($ME)."?id=$id&wdir=$wdir&action=delete&confirm=1&sesskey=$USER->sesskey", - "".basename($ME)."?id=$id&wdir=$wdir&action=cancel"); - } else { - displaydir($wdir); - } - html_footer(); - } - break; - - case "move": - html_header($course, $wdir); - if (($count = setfilelist($_POST)) and confirm_sesskey()) { - $USER->fileop = $action; - $USER->filesource = $wdir; - echo "

"; - print_string("selectednowmove", "moodle", $count); - echo "

"; - } - displaydir($wdir); - html_footer(); - break; - - case "paste": - html_header($course, $wdir); - if (isset($USER->fileop) and ($USER->fileop == "move") and confirm_sesskey()) { - foreach ($USER->filelist as $file) { - $shortfile = basename($file); - $oldfile = $basedir.$file; - $newfile = $basedir.$wdir."/".$shortfile; - if (!rename($oldfile, $newfile)) { - echo "

Error: $shortfile not moved"; - } - } - } - clearfilelist(); - displaydir($wdir); - html_footer(); - break; - - case "rename": - if (!empty($name) and confirm_sesskey()) { - html_header($course, $wdir); - $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 { - $strrename = get_string("rename"); - $strcancel = get_string("cancel"); - $strrenamefileto = get_string("renamefileto", "moodle", $file); - html_header($course, $wdir, "form.name"); - echo "

$strrenamefileto:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " sesskey\" />"; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "mkdir": - if (!empty($name) and confirm_sesskey()) { - html_header($course, $wdir); - $name = clean_filename($name); - if (file_exists("$basedir$wdir/$name")) { - echo "Error: $name already exists!"; - } else if (! make_upload_directory("$course->id/$wdir/$name")) { - echo "Error: could not create $name"; - } - displaydir($wdir); - - } else { - $strcreate = get_string("create"); - $strcancel = get_string("cancel"); - $strcreatefolder = get_string("createfolder", "moodle", $wdir); - html_header($course, $wdir, "form.name"); - echo "

$strcreatefolder:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " sesskey\" />"; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "edit": - html_header($course, $wdir); - if (isset($text) and confirm_sesskey()) { - $fileptr = fopen($basedir.$file,"w"); - fputs($fileptr, stripslashes($text)); - fclose($fileptr); - displaydir($wdir); - - } else { - $streditfile = get_string("edit", "", "$file"); - $fileptr = fopen($basedir.$file, "r"); - $contents = fread($fileptr, filesize($basedir.$file)); - fclose($fileptr); - - if (mimeinfo("type", $file) == "text/html") { - $usehtmleditor = can_use_html_editor(); - } else { - $usehtmleditor = false; - } - $usehtmleditor = false; // Always keep it off for now - - print_heading("$streditfile"); - - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " sesskey\" />"; - print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - - if ($usehtmleditor) { - use_html_editor(); - } - - - } - html_footer(); - break; - - case "zip": - if (!empty($name) and confirm_sesskey()) { - html_header($course, $wdir); - $name = clean_filename($name); - - $files = array(); - foreach ($USER->filelist as $file) { - $files[] = "$basedir/$file"; - } - - if (!zip_files($files,"$basedir/$wdir/$name")) { - error(get_string("zipfileserror","error")); - } - - clearfilelist(); - displaydir($wdir); - - } else { - html_header($course, $wdir, "form.name"); - - if (setfilelist($_POST)) { - echo "

".get_string("youareabouttocreatezip").":

"; - print_simple_box_start("center"); - printfilelist($USER->filelist); - print_simple_box_end(); - echo "
"; - echo "

".get_string("whattocallzip"); - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " sesskey\" />"; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - clearfilelist(); - } - } - html_footer(); - break; - - case "unzip": - html_header($course, $wdir); - if (!empty($file) and confirm_sesskey()) { - $strok = get_string("ok"); - $strunpacking = get_string("unpacking", "", $file); - - echo "

$strunpacking:

"; - - $file = basename($file); - - if (!unzip_file("$basedir/$wdir/$file")) { - error(get_string("unzipfileserror","error")); - } - - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - } - html_footer(); - break; - - case "listzip": - html_header($course, $wdir); - if (!empty($file) and confirm_sesskey()) { - $strname = get_string("name"); - $strsize = get_string("size"); - $strmodified = get_string("modified"); - $strok = get_string("ok"); - $strlistfiles = get_string("listfiles", "", $file); - - echo "

$strlistfiles:

"; - $file = basename($file); - - include_once($CFG->libdir.'/pclzip/pclzip.lib.php'); - $archive = new PclZip(cleardoubleslashes("$basedir/$wdir/$file")); - if (!$list = $archive->listContent(cleardoubleslashes("$basedir/$wdir"))) { - notify($archive->errorInfo(true)); - - } else { - echo ""; - echo ""; - foreach ($list as $item) { - echo ""; - print_cell("left", $item['filename']); - if (! $item['folder']) { - print_cell("right", display_size($item['size'])); - } else { - echo ""; - } - $filedate = userdate($item['mtime'], get_string("strftimedatetime")); - print_cell("right", $filedate); - echo ""; - } - echo "
$strname$strsize$strmodified
 
"; - } - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - } - html_footer(); - break; - - case "cancel"; - clearfilelist(); - - default: - html_header($course, $wdir); - 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++; - $val = rawurldecode($val); - if (!detect_munged_arguments($val, 0)) { - $USER->filelist[] = $val; - } - } - } - return $count; -} - -function clearfilelist() { - global $USER; - - $USER->filelist = array (); - $USER->fileop = ""; -} - - -function printfilelist($filelist) { - global $basedir, $CFG; - - foreach ($filelist as $file) { - if (is_dir($basedir.$file)) { - echo "pixpath/f/folder.gif\" height=16 width=16> $file
"; - $subfilelist = array(); - $currdir = opendir($basedir.$file); - while ($subfile = readdir($currdir)) { - if ($subfile <> ".." && $subfile <> ".") { - $subfilelist[] = $file."/".$subfile; - } - } - printfilelist($subfilelist); - - } else { - $icon = mimeinfo("icon", $file); - echo "pixpath/f/$icon\" height=16 width=16> $file
"; - } - } -} - - -function print_cell($alignment="center", $text=" ") { - echo "
"; - echo ""; - echo "$text"; - echo ""; - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - - if ($wdir == "/") { - $wdir = ""; - } - - $count = 0; - - if (!empty($dirlist)) { - asort($dirlist); - foreach ($dirlist as $dir) { - - $count++; - - $filename = $fullpath."/".$dir; - $fileurl = rawurlencode($wdir."/".$dir); - $filesafe = rawurlencode($dir); - $filesize = display_size(get_directory_size("$fullpath/$dir")); - $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p"); - echo ""; - - print_cell("center", ""); - print_cell("left", "pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\">".htmlspecialchars($dir).""); - print_cell("right", "$filesize"); - print_cell("right", $filedate); - print_cell("right", "$strrename"); - - echo ""; - } - } - - - if (!empty($filelist)) { - asort($filelist); - foreach ($filelist as $file) { - - $icon = mimeinfo("icon", $file); - - $count++; - $filename = "$fullpath/$file"; - $fileurl = "$wdir/$file"; - $filesafe = rawurlencode($file); - $fileurlsafe = rawurlencode($fileurl); - $filedate = userdate(filemtime($filename), "%d %b %Y, %I:%M %p"); - - if (substr($fileurl,0,1) == '/') { - $selectfile = substr($fileurl,1); - } else { - $selectfile = $fileurl; - } - if ($CFG->slasharguments) { - $ffurl = "/file.php/$id$fileurl"; - } else { - $ffurl = "/file.php?file=/$id$fileurl"; - } - - echo ""; - - print_cell("center", ""); - - echo ""; - - $file_size = filesize($filename); - print_cell("right", display_size($file_size)); - print_cell("right", $filedate); - - $edittext = "$strchoose "; - - if ($icon == "text.gif" || $icon == "html.gif") { - $edittext .= "$stredit"; - } else if ($icon == "zip.gif") { - $edittext .= "sesskey\">$strunzip "; - $edittext .= "sesskey\">$strlist "; - } - - print_cell("right", "$edittext $strrename"); - - echo ""; - } - } - echo "
$strname$strsize$strmodified$straction
"; - link_to_popup_window ($ffurl, "display", - "pixpath/f/$icon\" height=16 width=16 border=0 alt=\"file\">", - 480, 640); - echo ""; - link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640); - echo "
"; - echo "
"; - - if (empty($wdir)) { - $wdir = "/"; - } - - echo ""; - echo ""; - echo ""; - echo "
"; - echo ""; - echo " "; - echo "sesskey\" />"; - $options = array ( - "move" => "$strmovetoanotherfolder", - "delete" => "$strdeletecompletely", - "zip" => "$strcreateziparchive" - ); - if (!empty($count)) { - choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()"); - } - - echo ""; - echo ""; - if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { - echo "
"; - echo " "; - echo " "; - echo " "; - echo " sesskey\" />"; - echo " "; - echo "
"; - } - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - -} - -?> diff --git a/mod/resource/type/file/file.html b/mod/resource/type/file/file.html index 2613d18228f..b24d4a3a27c 100644 --- a/mod/resource/type/file/file.html +++ b/mod/resource/type/file/file.html @@ -35,7 +35,7 @@ reference\">
"; - button_to_popup_window ("/mod/resource/coursefiles.php?id=$form->course", "coursefiles", $strchooseafile, 500, 750, $strchooseafile); + button_to_popup_window ("/files/index.php?id=$form->course&choose=form.reference", "coursefiles", $strchooseafile, 500, 750, $strchooseafile); echo "resource_websearch', 'websearch', 'menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600');\">\n"; ?> diff --git a/mod/resource/version.php b/mod/resource/version.php index 2d3595a7c18..2a2eacbaef8 100644 --- a/mod/resource/version.php +++ b/mod/resource/version.php @@ -5,8 +5,8 @@ // This fragment is called by /admin/index.php //////////////////////////////////////////////////////////////////////////////// -$module->version = 2004080801; -$module->requires = 2004073000; // Requires this Moodle version +$module->version = 2004083123; +$module->requires = 2004083123; // Requires this Moodle version $module->cron = 0; ?> diff --git a/mod/scorm/coursefiles.php b/mod/scorm/coursefiles.php deleted file mode 100755 index 68a2d71372c..00000000000 --- a/mod/scorm/coursefiles.php +++ /dev/null @@ -1,811 +0,0 @@ -id); - - if (! isteacher($course->id) ) { - error("Only teachers can edit files"); - } - - function html_footer() { - echo ""; - } - - function html_header($course, $wdir, $formfield=""){ - - global $CFG,$THEME,$ME; - - if (! $site = get_site()) { - error("Invalid site!"); - } - - if ($course->id == $site->id) { - $strfiles = get_string("sitefiles"); - } else { - $strfiles = get_string("files"); - } - - if ($wdir == "/") { - $fullnav = "$strfiles"; - } else { - $dirs = explode("/", $wdir); - $numdirs = count($dirs); - $link = ""; - $navigation = ""; - for ($i=1; $i<$numdirs; $i++) { - $navigation .= " -> "; - $link .= "/".urlencode($dirs[$i]); - $navigation .= "id&wdir=$link\">".$dirs[$i].""; - } - $fullnav = "id&wdir=/\">$strfiles $navigation"; - } - - print_header(); - ?> - - '; - echo ''; - echo ''; - echo ''."$course->shortname -> $fullnav".''; - echo ''; - echo ''; - echo ''; - - if ($course->id == $site->id) { - print_heading(get_string("publicsitefileswarning"), "center", 2); - } - - echo ""; - echo ""; - echo "\n"; -} - -function displaydir ($wdir) { -// $wdir == / or /a or /a/b/c/d etc - - global $basedir; - global $id; - global $USER, $CFG, $ME; - - $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 { - if ((basename(strtolower($file),".zip") != basename(strtolower($file))) || (basename(strtolower($file),".pif") != basename(strtolower($file)))) - $filelist[] = $file; - } - } - closedir($directory); - - $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"); - $strlist = get_string("list"); - $strchoose = get_string("choose"); - - - echo ""; - echo "
"; - } - - if (! $basedir = make_upload_directory("$course->id")) { - error("The site administrator needs to fix the file permissions"); - } - - $baseweb = $CFG->wwwroot; - -// End of configuration and access control - - - $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": - html_header($course, $wdir); - - 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")); - } else { - $userfile_name = clean_filename($userfile['name']); - if ($userfile_name) { - $newfile = "$basedir$wdir/$userfile_name"; - if (move_uploaded_file($userfile['tmp_name'], $newfile)) { - chmod($newfile, 0666); - $a = NULL; - $a->file = "$userfile_name (".$userfile['type'].")"; - $a->directory = $wdir; - print_string("uploadedfileto", "", $a); - } else { - notify(get_string("uploadproblem", "", $userfile_name)); - } - } - } - displaydir($wdir); - - } else { - $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes); - $filesize = display_size($upload_max_filesize); - - $struploadafile = get_string("uploadafile"); - $struploadthisfile = get_string("uploadthisfile"); - $strmaxsize = get_string("maxsize", "", $filesize); - $strcancel = get_string("cancel"); - - echo "

$struploadafile ($strmaxsize) --> $wdir"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "delete": - if (!empty($confirm)) { - html_header($course, $wdir); - foreach ($USER->filelist as $file) { - $fullfile = $basedir.$file; - if (! fulldelete($fullfile)) { - echo "
Error: Could not delete: $fullfile"; - } - } - clearfilelist(); - displaydir($wdir); - html_footer(); - - } else { - html_header($course, $wdir); - if (setfilelist($_POST)) { - echo "

".get_string("deletecheckwarning").":

"; - print_simple_box_start("center"); - printfilelist($USER->filelist); - print_simple_box_end(); - echo "
"; - notice_yesno (get_string("deletecheckfiles"), - "".basename($ME)."?id=$id&wdir=$wdir&action=delete&confirm=1", - "".basename($ME)."?id=$id&wdir=$wdir&action=cancel"); - } else { - displaydir($wdir); - } - html_footer(); - } - break; - - case "move": - html_header($course, $wdir); - if ($count = setfilelist($_POST)) { - $USER->fileop = $action; - $USER->filesource = $wdir; - echo "

"; - print_string("selectednowmove", "moodle", $count); - echo "

"; - } - displaydir($wdir); - html_footer(); - break; - - case "paste": - html_header($course, $wdir); - if (isset($USER->fileop) and $USER->fileop == "move") { - foreach ($USER->filelist as $file) { - $shortfile = basename($file); - $oldfile = $basedir.$file; - $newfile = $basedir.$wdir."/".$shortfile; - if (!rename($oldfile, $newfile)) { - echo "

Error: $shortfile not moved"; - } - } - } - clearfilelist(); - displaydir($wdir); - html_footer(); - break; - - case "rename": - if (!empty($name)) { - html_header($course, $wdir); - $name = clean_filename($name); - $oldname = clean_filename($oldname); - 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 { - $strrename = get_string("rename"); - $strcancel = get_string("cancel"); - $strrenamefileto = get_string("renamefileto", "moodle", $file); - html_header($course, $wdir, "form.name"); - echo "

$strrenamefileto:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "mkdir": - if (!empty($name)) { - html_header($course, $wdir); - $name = clean_filename($name); - if (file_exists("$basedir$wdir/$name")) { - echo "Error: $name already exists!"; - } else if (! make_upload_directory("$course->id/$wdir/$name")) { - echo "Error: could not create $name"; - } - displaydir($wdir); - - } else { - $strcreate = get_string("create"); - $strcancel = get_string("cancel"); - $strcreatefolder = get_string("createfolder", "moodle", $wdir); - html_header($course, $wdir, "form.name"); - echo "

$strcreatefolder:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "edit": - html_header($course, $wdir); - if (isset($text)) { - $fileptr = fopen($basedir.$file,"w"); - fputs($fileptr, stripslashes($text)); - fclose($fileptr); - displaydir($wdir); - - } else { - $streditfile = get_string("edit", "", "$file"); - $fileptr = fopen($basedir.$file, "r"); - $contents = fread($fileptr, filesize($basedir.$file)); - fclose($fileptr); - - if (mimeinfo("type", $file) == "text/html") { - if ($usehtmleditor = can_use_richtext_editor()) { - $onsubmit = "onsubmit=\"copyrichtext(document.form.text);\""; - } else { - $onsubmit = ""; - } - } else { - $usehtmleditor = false; - $onsubmit = ""; - } - $usehtmleditor = false; // Always keep it off for now - - print_heading("$streditfile"); - - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - - if ($usehtmleditor) { - print_richedit_javascript("form", "text", "yes"); - } - - - } - html_footer(); - break; - - case "zip": - if (!empty($name)) { - html_header($course, $wdir); - $name = clean_filename($name); - - $files = array(); - foreach ($USER->filelist as $file) { - $files[] = "$basedir/$file"; - } - - if (!zip_files($files,"$basedir/$wdir/$name")) { - error(get_string("zipfileserror","error")); - } - - clearfilelist(); - displaydir($wdir); - - } else { - html_header($course, $wdir, "form.name"); - - if (setfilelist($_POST)) { - echo "

".get_string("youareabouttocreatezip").":

"; - print_simple_box_start("center"); - printfilelist($USER->filelist); - print_simple_box_end(); - echo "
"; - echo "

".get_string("whattocallzip"); - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - clearfilelist(); - } - } - html_footer(); - break; - - case "unzip": - html_header($course, $wdir); - if (!empty($file)) { - $strok = get_string("ok"); - $strunpacking = get_string("unpacking", "", $file); - - echo "

$strunpacking:

"; - - $file = basename($file); - - if (!unzip_file("$basedir/$wdir/$file")) { - error(get_string("unzipfileserror","error")); - } - - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - } - html_footer(); - break; - - 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 "

$strlistfiles:

"; - $file = basename($file); - - include_once($CFG->libdir.'/pclzip/pclzip.lib.php'); - $archive = new PclZip("$basedir/$wdir/$file"); - if (!$list = $archive->listContent("$basedir/$wdir")) { - notify($archive->errorInfo(true)); - - } else { - echo ""; - echo ""; - foreach ($list as $item) { - echo ""; - print_cell("left", $item['filename']); - if (! $item['folder']) { - print_cell("right", display_size($item['size'])); - } else { - echo ""; - } - $filedate = userdate($item['mtime'], get_string("strftimedatetime")); - print_cell("right", $filedate); - echo ""; - } - echo "
$strname$strsize$strmodified
 
"; - } - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - } - html_footer(); - break; - - case "torte": - if($_POST) - { - while(list($key, $val) = each($_POST)) - { - if(ereg("file([0-9]+)", $key, $regs)) - { - $file = $val; - } - } - if(@filetype($CFG->dataroot ."/". $course->id . $file) == "file") - { - if(mimeinfo("icon", $file) == "image.gif") - { - $url = $CFG->wwwroot ."/file.php?file=/" .$course->id . $file; - runjavascript($url); - } - else - { - print "File is not a image!"; - } - } - else - { - print "You cannot insert FOLDER into richtext editor!!!"; - } - } - break; - case "cancel"; - clearfilelist(); - - default: - html_header($course, $wdir); - 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, $CFG; - - foreach ($filelist as $file) { - if (is_dir($basedir.$file)) { - echo "pixpath/f/folder.gif\" height=16 width=16> $file
"; - $subfilelist = array(); - $currdir = opendir($basedir.$file); - while ($subfile = readdir($currdir)) { - if ($subfile <> ".." && $subfile <> ".") { - $subfilelist[] = $file."/".$subfile; - } - } - printfilelist($subfilelist); - - } else { - $icon = mimeinfo("icon", $file); - echo "pixpath/f/$icon\" height=16 width=16> $file
"; - } - } -} - - -function print_cell($alignment="center", $text=" ") { - echo "
"; - echo ""; - echo "$text"; - echo ""; - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - - if ($wdir == "/") { - $wdir = ""; - } - - $count = 0; - - if (!empty($dirlist)) { - asort($dirlist); - foreach ($dirlist as $dir) { - - $count++; - - $filename = $fullpath."/".$dir; - $fileurl = rawurlencode($wdir."/".$dir); - $filesafe = rawurlencode($dir); - $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); - - echo ""; - - print_cell("center", ""); - print_cell("left", "pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\">".htmlspecialchars($dir).""); - print_cell("right", "-"); - print_cell("right", $filedate); - print_cell("right", "$strrename"); - - echo ""; - } - } - - - if (!empty($filelist)) { - asort($filelist); - foreach ($filelist as $file) { - - $icon = mimeinfo("icon", $file); - - $count++; - $filename = "$fullpath/$file"; - $fileurl = "$wdir/$file"; - $filesafe = rawurlencode($file); - $fileurlsafe = rawurlencode($fileurl); - $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); - - if (substr($fileurl,0,1) == '/') { - $selectfile = substr($fileurl,1); - } else { - $selectfile = $fileurl; - } - if ($CFG->slasharguments) { - $ffurl = "/file.php/$id$fileurl"; - } else { - $ffurl = "/file.php?file=/$id$fileurl"; - } - - echo ""; - - print_cell("center", ""); - - echo ""; - - $file_size = filesize($filename); - print_cell("right", display_size($file_size)); - print_cell("right", $filedate); - - $edittext = "$strchoose "; - - if ($icon == "text.gif" || $icon == "html.gif") { - $edittext .= "$stredit"; - } else if ($icon == "zip.gif") { - $edittext .= "$strunzip "; - $edittext .= "$strlist "; - } - - print_cell("right", "$edittext $strrename"); - - echo ""; - } - } - echo "
$strname$strsize$strmodified$straction
"; - link_to_popup_window ($ffurl, "display", - "pixpath/f/$icon\" height=16 width=16 border=0 alt=\"file\">", - 480, 640); - echo ""; - link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640); - echo "
"; - echo "
"; - - if (empty($wdir)) { - $wdir = "/"; - } - - echo ""; - echo ""; - echo ""; - echo "
"; - echo ""; - echo " "; - $options = array ( - "move" => "$strmovetoanotherfolder", - "delete" => "$strdeletecompletely", - "zip" => "$strcreateziparchive" - ); - if (!empty($count)) { - choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()"); - } - - echo ""; - echo ""; - if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - } - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - -} - -?> diff --git a/mod/scorm/mod.html b/mod/scorm/mod.html index 8ad46718451..841e6fc3d65 100755 --- a/mod/scorm/mod.html +++ b/mod/scorm/mod.html @@ -33,7 +33,7 @@ reference\"> "; - button_to_popup_window ("/mod/scorm/coursefiles.php?id=$course->id", + button_to_popup_window ("/files/index.php?id=$course->id&choose=form.reference", "coursefiles", $strchooseafile, 500, 750, $strchooseafile); ?> diff --git a/mod/scorm/version.php b/mod/scorm/version.php index f665e38b57a..410d7522d2d 100755 --- a/mod/scorm/version.php +++ b/mod/scorm/version.php @@ -5,8 +5,8 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2004071900; // The (date) version of this module -$module->requires = 2004052505; // The version of Moodle that is required +$module->version = 2004083123; // The (date) version of this module +$module->requires = 2004083123; // The version of Moodle that is required $module->cron = 0; // How often should cron check this module (seconds)? ?> diff --git a/mod/wiki/mod.html b/mod/wiki/mod.html index cdd42908faf..fd3e216c510 100644 --- a/mod/wiki/mod.html +++ b/mod/wiki/mod.html @@ -197,7 +197,7 @@ else { $strchooseafile = get_string("chooseafile", "wiki"); echo "initialcontent\"> "; - button_to_popup_window ("/mod/wiki/wikifiles.php?id=$course->id", + button_to_popup_window ("/files/index.php?choose=form.initialcontent&id=$course->id", "wikifiles", $strchooseafile, 500, 750, $strchooseafile); } ?> diff --git a/mod/wiki/version.php b/mod/wiki/version.php index 18279c01d9c..6328af030fe 100644 --- a/mod/wiki/version.php +++ b/mod/wiki/version.php @@ -5,8 +5,8 @@ /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2004082303; // The current module version (Date: YYYYMMDDXX) -$module->requires = 2004082300; // Requires this Moodle version +$module->version = 2004083123; // The current module version (Date: YYYYMMDDXX) +$module->requires = 2004083123; // Requires this Moodle version $module->cron = 0; // Period for cron to check this module (secs) ?> diff --git a/mod/wiki/wikifiles.php b/mod/wiki/wikifiles.php deleted file mode 100755 index 6f92843fda5..00000000000 --- a/mod/wiki/wikifiles.php +++ /dev/null @@ -1,802 +0,0 @@ -id); - - if (! isteacher($course->id) ) { - error("Only teachers can edit files"); - } - - function html_footer() { - echo ""; - } - - function html_header($course, $wdir, $formfield=""){ - - global $CFG, $THEME, $ME; - - if (! $site = get_site()) { - error("Invalid site!"); - } - - if ($course->id == $site->id) { - $strfiles = get_string("sitefiles"); - } else { - $strfiles = get_string("files"); - } - - if ($wdir == "/") { - $fullnav = "$strfiles"; - } else { - $dirs = explode("/", $wdir); - $numdirs = count($dirs); - $link = ""; - $navigation = ""; - for ($i=1; $i<$numdirs; $i++) { - $navigation .= " -> "; - $link .= "/".urlencode($dirs[$i]); - $navigation .= "id&wdir=$link\">".$dirs[$i].""; - } - $fullnav = "id&wdir=/\">$strfiles $navigation"; - } - - print_header(); - ?> - - '; - echo ''; - echo ''; - echo ''."$course->shortname -> $fullnav".''; - echo ''; - echo ''; - echo ''; - - if ($course->id == $site->id) { - print_heading(get_string("publicsitefileswarning"), "center", 2); - } - - echo ""; - echo ""; - echo "\n"; -} - -function displaydir ($wdir) { -// $wdir == / or /a or /a/b/c/d etc - - global $basedir; - global $id; - global $USER, $CFG; - - $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); - - $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"); - $strlist = get_string("list"); - $strchoose = get_string("choose"); - - - echo ""; - echo "
"; - } - - if (! $basedir = make_upload_directory("$course->id")) { - error("The site administrator needs to fix the file permissions"); - } - - $baseweb = $CFG->wwwroot; - -// End of configuration and access control - - - $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": - html_header($course, $wdir); - - 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")); - } else { - $userfile_name = clean_filename($userfile['name']); - if ($userfile_name) { - $newfile = "$basedir$wdir/$userfile_name"; - if (move_uploaded_file($userfile['tmp_name'], $newfile)) { - chmod($newfile, 0666); - $a = NULL; - $a->file = "$userfile_name (".$userfile['type'].")"; - $a->directory = $wdir; - print_string("uploadedfileto", "", $a); - } else { - notify(get_string("uploadproblem", "", $userfile_name)); - } - } - } - displaydir($wdir); - - } else { - $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes); - $filesize = display_size($upload_max_filesize); - - $struploadafile = get_string("uploadafile"); - $struploadthisfile = get_string("uploadthisfile"); - $strmaxsize = get_string("maxsize", "", $filesize); - $strcancel = get_string("cancel"); - - echo "

$struploadafile ($strmaxsize) --> $wdir"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "delete": - if (!empty($confirm)) { - html_header($course, $wdir); - foreach ($USER->filelist as $file) { - $fullfile = $basedir.$file; - if (! fulldelete($fullfile)) { - echo "
Error: Could not delete: $fullfile"; - } - } - clearfilelist(); - displaydir($wdir); - html_footer(); - - } else { - html_header($course, $wdir); - if (setfilelist($_POST)) { - echo "

".get_string("deletecheckwarning").":

"; - print_simple_box_start("center"); - printfilelist($USER->filelist); - print_simple_box_end(); - echo "
"; - notice_yesno (get_string("deletecheckfiles"), - "".basename($ME)."?id=$id&wdir=$wdir&action=delete&confirm=1", - "".basename($ME)."?id=$id&wdir=$wdir&action=cancel"); - } else { - displaydir($wdir); - } - html_footer(); - } - break; - - case "move": - html_header($course, $wdir); - if ($count = setfilelist($_POST)) { - $USER->fileop = $action; - $USER->filesource = $wdir; - echo "

"; - print_string("selectednowmove", "moodle", $count); - echo "

"; - } - displaydir($wdir); - html_footer(); - break; - - case "paste": - html_header($course, $wdir); - if (isset($USER->fileop) and $USER->fileop == "move") { - foreach ($USER->filelist as $file) { - $shortfile = basename($file); - $oldfile = $basedir.$file; - $newfile = $basedir.$wdir."/".$shortfile; - if (!rename($oldfile, $newfile)) { - echo "

Error: $shortfile not moved"; - } - } - } - clearfilelist(); - displaydir($wdir); - html_footer(); - break; - - case "rename": - if (!empty($name)) { - html_header($course, $wdir); - $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 { - $strrename = get_string("rename"); - $strcancel = get_string("cancel"); - $strrenamefileto = get_string("renamefileto", "moodle", $file); - html_header($course, $wdir, "form.name"); - echo "

$strrenamefileto:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "mkdir": - if (!empty($name)) { - html_header($course, $wdir); - $name = clean_filename($name); - if (file_exists("$basedir$wdir/$name")) { - echo "Error: $name already exists!"; - } else if (! make_upload_directory("$course->id/$wdir/$name")) { - echo "Error: could not create $name"; - } - displaydir($wdir); - - } else { - $strcreate = get_string("create"); - $strcancel = get_string("cancel"); - $strcreatefolder = get_string("createfolder", "moodle", $wdir); - html_header($course, $wdir, "form.name"); - echo "

$strcreatefolder:"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } - html_footer(); - break; - - case "edit": - html_header($course, $wdir); - if (isset($text)) { - $fileptr = fopen($basedir.$file,"w"); - fputs($fileptr, stripslashes($text)); - fclose($fileptr); - displaydir($wdir); - - } else { - $streditfile = get_string("edit", "", "$file"); - $fileptr = fopen($basedir.$file, "r"); - $contents = fread($fileptr, filesize($basedir.$file)); - fclose($fileptr); - - if (mimeinfo("type", $file) == "text/html") { - $usehtmleditor = can_use_html_editor(); - } else { - $usehtmleditor = false; - } - - print_heading("$streditfile"); - - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - print_textarea($usehtmleditor, 25, 80, 680, 400, "text", $contents); - echo "
"; - echo " "; - echo ""; - echo ""; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - - if ($usehtmleditor) { - use_html_editor(); - } - - } - html_footer(); - break; - - case "zip": - if (!empty($name)) { - html_header($course, $wdir); - $name = clean_filename($name); - - $files = array(); - foreach ($USER->filelist as $file) { - $files[] = "$basedir/$file"; - } - - if (!zip_files($files,"$basedir/$wdir/$name")) { - error(get_string("zipfileserror","error")); - } - - clearfilelist(); - displaydir($wdir); - - } else { - html_header($course, $wdir, "form.name"); - - if (setfilelist($_POST)) { - echo "

".get_string("youareabouttocreatezip").":

"; - print_simple_box_start("center"); - printfilelist($USER->filelist); - print_simple_box_end(); - echo "
"; - echo "

".get_string("whattocallzip"); - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - clearfilelist(); - } - } - html_footer(); - break; - - case "unzip": - html_header($course, $wdir); - if (!empty($file)) { - $strok = get_string("ok"); - $strunpacking = get_string("unpacking", "", $file); - - echo "

$strunpacking:

"; - - $file = basename($file); - - if (!unzip_file("$basedir/$wdir/$file")) { - error(get_string("unzipfileserror","error")); - } - - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - } - html_footer(); - break; - - 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 "

$strlistfiles:

"; - $file = basename($file); - - include_once($CFG->libdir.'/pclzip/pclzip.lib.php'); - $archive = new PclZip("$basedir/$wdir/$file"); - if (!$list = $archive->listContent("$basedir/$wdir")) { - notify($archive->errorInfo(true)); - - } else { - echo ""; - echo ""; - foreach ($list as $item) { - echo ""; - print_cell("left", $item['filename']); - if (! $item['folder']) { - print_cell("right", display_size($item['size'])); - } else { - echo ""; - } - $filedate = userdate($item['mtime'], get_string("strftimedatetime")); - print_cell("right", $filedate); - echo ""; - } - echo "
$strname$strsize$strmodified
 
"; - } - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - } else { - displaydir($wdir); - } - html_footer(); - break; - - case "torte": - if($_POST) - { - while(list($key, $val) = each($_POST)) - { - if(ereg("file([0-9]+)", $key, $regs)) - { - $file = $val; - } - } - if(@filetype($CFG->dataroot ."/". $course->id . $file) == "file") - { - if(mimeinfo("icon", $file) == "image.gif") - { - $url = $CFG->wwwroot ."/file.php?file=/" .$course->id . $file; - runjavascript($url); - } - else - { - print "File is not a image!"; - } - } - else - { - print "You cannot insert FOLDER into richtext editor!!!"; - } - } - break; - case "cancel"; - clearfilelist(); - - default: - html_header($course, $wdir); - 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, $CFG; - - foreach ($filelist as $file) { - if (is_dir($basedir.$file)) { - echo "pixpath/f/folder.gif\" height=16 width=16> $file
"; - $subfilelist = array(); - $currdir = opendir($basedir.$file); - while ($subfile = readdir($currdir)) { - if ($subfile <> ".." && $subfile <> ".") { - $subfilelist[] = $file."/".$subfile; - } - } - printfilelist($subfilelist); - - } else { - $icon = mimeinfo("icon", $file); - echo "pixpath/f/$icon\" height=16 width=16> $file
"; - } - } -} - - -function print_cell($alignment="center", $text=" ") { - echo "
"; - echo ""; - echo "$text"; - echo ""; - echo "
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - - if ($wdir == "/") { - $wdir = ""; - } - - $count = 0; - - if (!empty($dirlist)) { - asort($dirlist); - foreach ($dirlist as $dir) { - - $count++; - - $filename = $fullpath."/".$dir; - $fileurl = rawurlencode($wdir."/".$dir); - $filesafe = rawurlencode($dir); - $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); - - echo ""; - - print_cell("center", ""); - print_cell("left", "pixpath/f/folder.gif\" HEIGHT=16 WIDTH=16 BORDER=0 ALT=\"Folder\">".htmlspecialchars($dir).""); - print_cell("right", "-"); - print_cell("right", $filedate); - print_cell("right", "$strrename"); - - echo ""; - } - } - - - if (!empty($filelist)) { - asort($filelist); - foreach ($filelist as $file) { - - $icon = mimeinfo("icon", $file); - - $count++; - $filename = "$fullpath/$file"; - $fileurl = "$wdir/$file"; - $filesafe = rawurlencode($file); - $fileurlsafe = rawurlencode($fileurl); - $filedate = userdate(filectime($filename), "%d %b %Y, %I:%M %p"); - - if (substr($fileurl,0,1) == '/') { - $selectfile = substr($fileurl,1); - } else { - $selectfile = $fileurl; - } - if ($CFG->slasharguments) { - $ffurl = "/file.php/$id$fileurl"; - } else { - $ffurl = "/file.php?file=/$id$fileurl"; - } - - echo ""; - - print_cell("center", ""); - - echo ""; - - $file_size = filesize($filename); - print_cell("right", display_size($file_size)); - print_cell("right", $filedate); - - $edittext = "$strchoose "; - - if ($icon == "text.gif" || $icon == "html.gif") { - $edittext .= "$stredit"; - } else if ($icon == "zip.gif") { - $edittext .= "$strunzip "; - $edittext .= "$strlist "; - } - - print_cell("right", "$edittext $strrename"); - - echo ""; - } - } - echo "
$strname$strsize$strmodified$straction
"; - link_to_popup_window ($ffurl, "display", - "pixpath/f/$icon\" height=16 width=16 border=0 alt=\"file\">", - 480, 640); - echo ""; - link_to_popup_window ($ffurl, "display", htmlspecialchars($file), 480, 640); - echo "
"; - echo "
"; - - if (empty($wdir)) { - $wdir = "/"; - } - - echo ""; - echo ""; - echo ""; - echo "
"; - echo ""; - echo " "; - $options = array ( - "move" => "$strmovetoanotherfolder", - "delete" => "$strdeletecompletely", - "zip" => "$strcreateziparchive" - ); - if (!empty($count)) { - choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()"); - } - - echo ""; - echo ""; - if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) { - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - } - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - echo " "; - echo " "; - echo " "; - echo " "; - echo "
"; - echo "
"; - echo "
"; - -} - -?> diff --git a/version.php b/version.php index 831cea4324a..311d55679f5 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2004083122; // YYYYMMDD = date of first major branch release 1.4 + $version = 2004083123; // YYYYMMDD = date of first major branch release 1.4 // X = point release version 1,2,3 etc // Y = increments between point releases