<?php
/* +----------------------------------------------------------------------+
| Netautor Professional Application Server |
+----------------------------------------------------------------------+
| Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net> |
+----------------------------------------------------------------------+
| This file is subject to license, that is bundled with this package |
| in the file LICENSE.TXT, and is available at through the |
| world-wide-web at http://www.netautor.com/license/ |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| hide@address.com so we can mail you a copy. |
+----------------------------------------------------------------------+
| Authors: Stefan Rottensteiner <hide@address.com> |
| Marek Kadziela <hide@address.com> |
| Gregor Wollner |
| Christian Unger |
| Helli Kleinhans |
+----------------------------------------------------------------------+
| @version $Revision: 1.11 $ |
+----------------------------------------------------------------------+*/
/**
* Show directory content
*/
require_once('../../include/init.inc');
if(!$GLOBALS['USER']->check_feature('Admin') && $GLOBALS['USER']->ID > 100 )
{
$GLOBALS['USER']->login_call();
}
includeNaPro('array,file,form,string');
$GLOBALS['LOCALE']->textdomain('index');
/**
*
*/
function searchForIndizes($basedir,$max_depth=1,$match_file='.',$timeformat="d.m.Y H:i:s")
{
$result='';
$params= array ( 'timeformat' =>$timeformat,
'match_file' =>$match_file,
'reallist' =>true
);
$DirContent = File_readDirectory($basedir,$max_depth,$params);
reset($DirContent);
while(List($Index,$Entry)=each($DirContent))
{
$farbe = ($farbe=='#e6e6e6' ? '#F6F6F6': '#e6e6e6');
$result.='<tr bgcolor="'.$farbe.'"><td class="text" ';
$result.=repeat_string('>»</td><td class="text" ',$Entry['level']);
$result.=( $Entry['level']<2 ? ' colspan="'.(3-$Entry['level']).'"> ' : "> ");
if (isset($Entry['size']))
{
// File
$name= str_replace("\\","\\\\",$Entry['url'].$Entry['name']);
$result.="<a class='link' href='#funz' onclick='showFileInfo(\"$name\");return false;'>".$Entry['name']."</a></td>";
}
else
{
// Directory
$name= rawurlencode($Entry['url'].$Entry['name']);
$result.="<img src='../../grafik/pfrechts.gif' width='5' height='10' border='0' alt=''>";
$result.="<a class='link' href='dirdetail.php?basedir=$name&timeformat=".rawurlencode($timeformat)."&match_file=".rawurlencode($match_file)."'><b>".$Entry['name']."</b></a></td>";
}
$result.="</tr>\r\n";
}
return $result;
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//DE">
<html>
<head>
<title>digiconcept/netautor/directory details</title>
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta name ="robots" content="noindex">
<link href="../../include/netautor.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript">
<!--
var fd = null;
function showFileInfo(Name)
{
fd=window.open("filedetail.php?file="+escape(Name),"FileDetails","screenX=100,screenX=100,top=100,left=100,width=520,height=240,dependent=yes,scrollbars=yes,resizable=yes,menubar=no,locationbar=no");
fd.focus();
}
//-->
</script>
<body bgcolor="#ffffff" class="blue" onLoad="window.focus();" >
<?php
if (empty($feature) || empty($pool))
{
$feature = '';
}
else
{
$FeatureValue = $GLOBALS['USER']->FEATURE['value'][$feature];
if (is_array($FeatureValue))
{
reset($FeatureValue);
while (List($Key,$Value)=each($FeatureValue))
{
List($basedirName,$basedir)=explode('=',$Value);
if ($basedirName==$pool) break;
}
}
else
{
List($basedirName,$basedir)=explode('=',$FetureValue);
}
}
if (empty($max_depth)) $max_depth=3;
if (empty($timeformat)) $timeformat='d.m.Y H:i:s';
if (empty($basedir)) $basedir='';
if (empty($match_file)) $match_file='.';
?>
<table widht="100%" align="center">
<tr>
<td align="left" valign="top" class="head">
<?php echo $GLOBALS['LOCALE']->gettext('directory',array('<br>'.$basedir)); ?><br>
</td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="50%">
<?php
echo(searchForIndizes($basedir,$max_depth,$match_file,$timeformat));
?>
</table>
<center>
<a class="link" href="#znuf" onclick="window.close();">Close window</a>
<center>
</body>
</html>