- fixed call of constructor of LetoDMS_DMS

- output of file size and modification time in GetDir()
This commit is contained in:
steinm 2011-05-16 06:47:06 +00:00
parent 2d02f7c6bf
commit 6587ae9aeb
2 changed files with 14 additions and 3 deletions

View File

@ -9,7 +9,7 @@ $db = new LetoDMS_Core_DatabaseAccess($g_config['type'], $g_config['hostname'],
$db->connect() or die ("Could not connect to db-server \"" . $g_config['hostname'] . "\"");
$db->_conn->Execute("set names 'utf8'");
$dms = new LetoDMS_Core_DMS($db, $g_config['contentDir'], $g_config['contentOffsetDir']);
$dms = new LetoDMS_Core_DMS($db, $g_config['contentDir'].$g_config['contentOffsetDir']);
$log = Log::factory('file', $g_config['logfile']);

View File

@ -410,12 +410,23 @@ class HTTP_WebDAV_Server_LetoDMS extends HTTP_WebDAV_Server
if(get_class($obj) == 'LetoDMS_Core_Folder') {
$fullpath .= '/';
$filename .= '/';
$filesize = 0;
$mtime = $obj->getDate();
} else {
$content = $obj->getLatestContent();
$mimetype = $content->getMimeType();
$mtime = $content->getDate();
$fspath = $this->dms->contentDir.'/'.$content->getPath();
$filesize = filesize($fspath);
}
// $name = htmlspecialchars($filename);
$name = $filename;
printf($format,
number_format(1000),
strftime("%Y-%m-%d %H:%M:%S", time()),
number_format($filesize),
strftime("%Y-%m-%d %H:%M:%S", $mtime),
"<a href='".$_SERVER['SCRIPT_NAME'].$fullpath."'>$name</a>");
}