示例#1
0
    }
} else {
    //this should be an additional file generated by the preview process (libreoffice)
    $f = realpath($filesPreviewDir . $filename);
    if (file_exists($f)) {
        $finfo = finfo_open(FILEINFO_MIME_TYPE);
        header('Content-type: ' . finfo_file($finfo, $f));
        echo file_get_contents($f);
    }
    exit(0);
}
if (!is_numeric($id)) {
    exit(0);
}
$toolbarItems = array('<a href="' . $coreUrl . '?locate=' . $id . '">' . L\get('OpenInCasebox') . '</a>');
$obj = Objects::getCachedObject($id);
$objData = $obj->getData();
$objType = $obj->getType();
// if external window then print the toolbar
if (empty($_GET['i'])) {
    echo '<html><head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="/css/tasks.css" /></head>
        <body>
    ';
    if ($objType == 'file') {
        $toolbarItems[] = '<a href="' . $coreUrl . 'download/' . $id . '/">' . L\get('Download') . '</a>';
    }
    echo '<table border="0" cellspacing="12" cellpading="12"><tr><td>' . implode('</td><td>', $toolbarItems) . '</td></tr></table>';
}
$preview = array();