17 include_once (
"FREEDOM/freedom_import_tar.php");
24 $analyze = GetHttpVars(
"analyze",
"Y");
26 $dirid = GetHttpVars(
"dirid");
31 if ($handle = opendir(
$ldir)) {
32 while (
false !== (
$file = readdir($handle))) {
33 if (
$file[0] !=
".") {
46 $ttar[0][
"selected"] =
"selected";
47 $selfile = $ttar[0][
"filename"];
50 foreach ($ttar as $k => $v) {
52 $ttar[$k][
"filename"] = $v[
"filename"];
54 $action->lay->setBlockData(
"SELECTFILE", $ttar);
58 if (!is_dir($untardir)) {
61 $tar = $uploaddir . $selfile;
64 $action->AddWarningMsg(sprintf(_(
"cannot extract archive file %s: %s") , $selfile,
$err));
70 if ($nbdoc > 0) $action->lay->SetBlockData(
"ANALYZE", array(
76 $action->lay->
Set(
"selfile", urlencode($selfile));
78 $action->lay->set(
"huge", ($action->
Read(
"navigator",
"") ==
"EXPLORER") ?
"" :
"huge");
80 $action->lay->eSet(
"dirid",
$dirid);
81 $action->lay->
Set(
"nbdoc",
"$nbdoc");
87 if ($level == 0) $tfile = array();
89 $handle = opendir(
$ldir);
90 while (
false !== (
$file = readdir($handle))) {
92 if (
$file[0] !=
".") {
93 $afile =
"$ldir/$file";
96 if (!
isUTF8($sfile)) $sfile = utf8_encode($sfile);
97 if (is_file($afile)) {
100 "level" => $level * 20,
103 }
else if (is_dir($afile)) {
106 "level" => $level * 20,
117 $action->lay->setBlockData(
"DIR", $tfile);
118 return count($tfile);
getTarExtractDir(Action &$action, $tar)
see_directory(&$action, $ldir, &$tfile, $level=0)
getTarUploadDir(Action &$action)
extractTar($tar, $untardir, $mime="")
freedom_view_tar(Action &$action)
if($file) if($subject==""&&$file) if($subject=="") $err