echo "<br/><br/>" . get_string('zipname', 'block_file_manager') . ": <input name=\"zipname\" value=\"zip01\"><br/><br/>"; echo "<center>"; echo "<input type=\"submit\" name=\"standardzip\" value=\"" . get_string('btnstandardzip', 'block_file_manager') . "\">"; // modifie par Dominic Villiard 5 septembre 2008 //echo " <input type=\"submit\" name=\"moodlezip\" value=\"".get_string('btnmoodlezip','block_file_manager')."\">"; echo "</center>"; print_simple_box_end(); echo "</form>"; break; case 'unzip': /*if (isset($_POST['cancel'])) { print_simple_box(get_string('msgcancelok', 'block_file_manager'), 'center'); redirect("link_manage.php?id=$id&linkid=$zipid&rootdir=$rootdir"); } else if (isset($_POST['unzip'])) {*/ if ($groupid == 0) { $zipfile = fm_get_user_link($zipid); } else { $zipfile = fm_get_group_link($zipid, $groupid); } if ($groupid == 0) { $zipfileloc = $CFG->dataroot . "/" . fm_get_user_dir_space() . fm_get_folder_path($zipfile->folder, false, $groupid) . "/" . $zipfile->link; } else { $zipfileloc = $CFG->dataroot . "/" . fm_get_group_dir_space($groupid) . fm_get_folder_path($zipfile->folder, false, $groupid) . "/" . $zipfile->link; } fm_unzip_file($zipfileloc, '', false, $zipfile->folder, $groupid); print_simple_box(get_string('msgmodificationok', 'block_file_manager'), "center", "", "#FFFFFF"); redirect("view.php?id={$id}&rootdir={$rootdir}&groupid={$groupid}"); //} /*$list = fm_view_zipped(fm_get_user_link($zipid), $groupid); $fmdir = fm_get_root_dir(); echo "<form name=\"unzipform\" method=\"post\" action=\"$CFG->wwwroot/$fmdir/zip.php?id={$id}&rootdir={$rootdir}&zipid=$zipid&what='$action'\">";
$tmplist .= "* "; } $linkshared += $tmpcount; $tmprec = get_record('fmanager_link', 'id', $c); $tmplist .= $tmprec->name; $list->thelist[] = $tmplist; } // delete confirmed if (isset($_POST['yesdel'])) { $linkshared = count_records('fmanager_shared', 'sharedlink', $c); if ($linkshared > 0) { fm_update_shared_links($c); } $linkshared = 0; if ($groupid == 0) { $file = fm_get_user_link($c); } else { $file = fm_get_group_link($c, $groupid); } if ($file->type == TYPE_FILE || $file->type == TYPE_ZIP) { $warnmsg .= fm_remove_file($file, $groupid); } } // Means that multiple types were selected (folders/links) and these are folders } else { if (substr($c, 0, 2) == 'f-') { $foldid = substr($c, 2); $tmplist = ""; if ($groupid == 0) { fm_user_owns_folder($foldid); } else {
case 'unzip': if (isset($_POST['cancel'])) { redirect("link_manage.php?id={$id}&linkid={$zipid}&rootdir={$rootdir}"); } else { if (isset($_POST['unzip'])) { if ($groupid == 0) { $zipfile = fm_get_user_link($zipid); } else { $zipfile = fm_get_group_link($zipid, $groupid); } if ($groupid == 0) { $zipfileloc = $CFG->dataroot . "/" . fm_get_user_dir_space() . fm_get_folder_path($zipfile->folder, false, $groupid) . "/" . $zipfile->link; } else { $zipfileloc = $CFG->dataroot . "/" . fm_get_group_dir_space($groupid) . fm_get_folder_path($zipfile->folder, false, $groupid) . "/" . $zipfile->link; } $list = fm_view_zipped(fm_get_user_link($zipid)); $fmdir = fm_get_root_dir(); echo "<form name=\"unzipform\" method=\"post\" action=\"{$CFG->wwwroot}/{$fmdir}/zip.php?id={$id}&rootdir={$rootdir}&zipid={$zipid}&what='{$action}'\">"; print_simple_box_start('center', '500', '#C0C0C0'); echo "<table name=\"viewziptable\" cellspacing=\"5\" align=\"center\" width=\"375\">"; echo "<tr>"; echo "<td align='center' nowrap><b><u>" . get_string("file", 'block_file_manager') . "</u></b></td>"; echo "<td align='center' nowrap><b><u>" . get_string("compressedsize", 'block_file_manager') . "</u></b></td>"; echo "<td align='center' nowrap><b><u>" . get_string("actualsize", 'block_file_manager') . "</u></b></td>"; echo "</tr>"; foreach ($list as $l) { echo "<tr>"; echo "<td align='center'>{$l->name}</td>"; echo "<td align='center'>" . fm_readable_filesize($l->compsize) . "</td>"; echo "<td align='center'>" . fm_readable_filesize($l->actualsize) . "</td>"; echo "</tr>";
if ($linkid != NULL) { // Modding existing link if ($groupid == 0) { fm_user_owns_link($linkid); } else { fm_group_owns_link($linkid, $groupid); } echo '<br/>' . print_simple_box(text_to_html(get_string('msgmodlink', 'block_file_manager')), 'center', '') . '<br/>'; } else { echo '<br/>' . print_simple_box(text_to_html(get_string('msgaddlink', 'block_file_manager')), 'center', '') . '<br/>'; } print_simple_box_start('center', '', '#C0C0C0'); $linkrec = NULL; if ($linkid != NULL) { if ($groupid == 0) { $linkrec = fm_get_user_link($linkid); } else { $linkrec = fm_get_group_link($linkid, $groupid); } $store->name = $linkrec->name; $store->category = $linkrec->category; if ($linkrec->type == TYPE_URL) { // a url link $store->url = $linkrec->link; $store->radioval = "url"; } $store->description = $linkrec->description; } $foldid = ''; include 'link_manage.html'; print_simple_box_end();