コード例 #1
0
ファイル: pafm.php プロジェクト: net32/pafm
function getFiles($path)
{
    global $dirContents, $pathURL, $codeMirrorModes, $token;
    $filePath = $path == '.' ? '/' : '/' . $path . '/';
    if (!count($dirContents['files'])) {
        return;
    }
    natcasesort($dirContents['files']);
    $codeMirrorExists = (int) is_dir(CODEMIRROR_PATH);
    $zipSupport = zipSupport();
    foreach ($dirContents['files'] as $dirItem) {
        $dirItemURL = escape($dirItem);
        $dirItemHTML = htmlspecialchars($dirItem);
        $fullPath = $path . '/' . $dirItem;
        $mtime = filemtime($fullPath);
        $mod = getMod($fullPath);
        $ext = getExt($dirItem);
        $cmSupport = in_array($ext, $codeMirrorModes) ? 'cp ' : '';
        echo '  <li title="' . $dirItemHTML . '">' . "\n\t" . '<a href="' . escape(ROOT . $filePath . $dirItem) . '" title="' . $dirItemHTML . '" class="file">' . $dirItemHTML . '</a>' . "\n\t" . '<span class="fs"  title="file size">' . getfs($path . '/' . $dirItem) . '</span>' . "\n\t" . '<span class="extension" title="file extension">' . $ext . '</span>' . "\n\t" . '<span class="filemtime" title="' . date('c', $mtime) . '">' . date('y-m-d | H:i:s', $mtime) . '</span>' . "\n\t" . '<span class="mode" title="mode">' . $mod . '</span>' . ($zipSupport && $ext == 'zip' ? "\n\t" . '<a href="?do=extract&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;token=' . $token . '" title="Extract ' . $dirItemHTML . '" class="extract b"></a>' : '') . (filesize($fullPath) <= 1048576 * MaxEditableSize ? "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $ext . '\', ' . $codeMirrorExists . '); return false;" class="edit ' . $cmSupport . 'b"></a>' : '') . "\n\t" . '<a href="#" title="Chmod ' . $dirItemHTML . '" onclick="fOp.chmod(\'' . $pathURL . '\', \'' . $dirItemURL . '\', \'' . $mod . '\'); return false;" class="chmod b"></a>' . "\n\t" . '<a href="#" title="Move ' . $dirItemHTML . '" onclick="fOp.moveList(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="move b"></a>' . "\n\t" . '<a href="#" title="Copy ' . $dirItemHTML . '" onclick="fOp.copy(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="copy b"></a>' . "\n\t" . '<a href="#" title="Rename ' . $dirItemHTML . '" onclick="fOp.rename(\'' . $dirItemHTML . '\', \'' . $pathURL . '\'); return false;" class="rename b"></a>' . "\n\t" . '<a href="?do=delete&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;token=' . $token . '" title="Delete ' . $dirItemHTML . '" onclick="return confirm(\'Are you sure you want to delete ' . removeQuotes($dirItem) . '?\');" class="del b"></a>' . "\n  </li>\n";
    }
}
コード例 #2
0
function getFiles($path)
{
    global $dirContents, $pathURL, $codeMirrorModes, $nonce, $tz_offset;
    $filePath = $path == '.' ? '/' : '/' . $path . '/';
    if (!count($dirContents['files'])) {
        return;
    }
    natcasesort($dirContents['files']);
    $codeMirrorExists = (int) is_dir(CODEMIRROR_PATH);
    $zipSupport = zipSupport();
    //tt edition
    $correctpath = str_ireplace(separator__WFMB($_SERVER['DOCUMENT_ROOT']), '', separator__WFMB(ROOT));
    $correctpath = str_ireplace('\\', '/', $correctpath);
    foreach ($dirContents['files'] as $dirItem) {
        $dirItemURL = escape($dirItem);
        $dirItemHTML = htmlspecialchars($dirItem);
        $fullPath = $path . '/' . $dirItem;
        $mtime = filemtime($fullPath);
        $mod = getMod($fullPath);
        $ext = getExt($dirItem);
        $cmSupport = in_array($ext, $codeMirrorModes) ? 'cp ' : '';
        echo '  <li title="' . $dirItemHTML . '">' . "\n\t" . '<a href="' . escape($correctpath . $filePath . $dirItem) . '" title="' . $dirItemHTML . '" class="file" id="' . $dirItemHTML . '" target="_blank">' . $dirItemHTML . '</a>' . (pathinfo($dirItem, PATHINFO_EXTENSION) == 'sql' ? ' &nbsp;&nbsp;(<a href="javascript:export_import_db(\'importt\',\'' . $dirItemHTML . '\')">RESTORE INTO DATABASE</a>)' : '') . "\n\t" . '<span class="fs"  title="file size">' . getfs($path . '/' . $dirItem) . '</span>' . "\n\t" . '<span class="extension" title="file extension">' . $ext . '</span>' . "\n\t" . '<span class="filemtime" title="' . date('c', $mtime) . '">' . date('y-m-d | H:i:s', $mtime + $tz_offset) . '</span>' . "\n\t" . '<span class="mode" title="mode">' . $mod . '</span>' . ($zipSupport && $ext == 'zip' ? "\n\t" . '<a href="?do=extract&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;nonce=' . $nonce . '" title="Extract ' . $dirItemHTML . '" class="extract b"></a>' : '') . (filesize($fullPath) <= 1048576 * MaxEditableSize ? "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $ext . '\', ' . $codeMirrorExists . '); return false;" class="edit ' . $cmSupport . 'b"></a>' : '') . "\n\t" . '<a href="#" title="Chmod ' . $dirItemHTML . '" onclick="fOp.chmod(\'' . $pathURL . '\', \'' . $dirItemURL . '\', \'' . $mod . '\'); return false;" class="chmod b"></a>' . "\n\t" . '<a href="#" title="Move ' . $dirItemHTML . '" onclick="fOp.moveList(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="move b"></a>' . "\n\t" . '<a href="#" title="Copy ' . $dirItemHTML . '" onclick="fOp.copy(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="copy b"></a>' . "\n\t" . '<a href="#" title="Rename ' . $dirItemHTML . '" onclick="fOp.rename(\'' . $dirItemHTML . '\', \'' . $pathURL . '\'); return false;" class="rename b"></a>' . "\n\t" . '<a href="?do=delete&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;nonce=' . $nonce . '" title="Delete ' . $dirItemHTML . '" onclick="return confirm(\'Are you sure you want to delete ' . removeQuotes($dirItem) . '?\');" class="del b"></a>' . "\n  </li>\n";
    }
}
コード例 #3
0
function getFiles($path)
{
    global $dirContents, $pathURL, $cpExts, $denyAccess;
    $filePath = $path == '.' ? '/' : '/' . $path . '/';
    for ($i = 0, $l = count($dirContents['files']); $i < $l; $i++) {
        $dirItem = $dirContents['files'][$i];
        $dirItemURL = escape($dirItem);
        $dirItemHTML = htmlspecialchars($dirItem);
        $fullPath = $path . '/' . $dirItem;
        $ext = getext($dirItem);
        $mod = getmod($fullPath);
        echo '  <li title="' . $dirItemHTML . '">' . "\n\t" . '<a href="' . escape(ROOT . $filePath . $dirItem) . '" title="' . $dirItemHTML . '" class="file">' . $dirItemHTML . '</a><!-- ' . $dirItemHTML . " -->" . "\n\t" . '<span class="fs"  title="file size">' . getfs($path . '/' . $dirItem) . '</span>' . "\n\t" . '<span class="extension" title="file extension">' . $ext . '</span>' . "\n\t" . '<span class="mode" title="mode">' . $mod . '</span>' . (zipSupport() && $ext == 'zip' ? "\n\t" . '<a href="?do=extract&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '" title="Extract ' . $dirItemHTML . '" class="extract b"></a><!-- Extract ' . $dirItemHTML . " -->" : null) . (filesize($fullPath) <= 1048576 * MaxEditableSize ? in_array($ext, $cpExts) ? "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . getext($dirItem) . '\'); return false;" class="edit cp b"></a><!-- Edit ' . $dirItemHTML . " -->" : "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', null); return false;" class="edit b"></a><!-- Edit ' . $dirItemHTML . " -->" : null) . "\n\t" . '<a href="#" title="Chmod ' . $dirItemHTML . '" onclick="fOp.chmod(\'' . $pathURL . '\', \'' . $dirItemURL . '\', \'' . $mod . '\'); return false;" class="chmod b"></a><!-- Chmod ' . $dirItemHTML . " -->" . "\n\t" . '<a href="#" title="Move ' . $dirItemHTML . '" onclick="fOp.moveList(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="move b"></a><!-- Move ' . $dirItemHTML . " -->" . "\n\t" . '<a href="#" title="Rename ' . $dirItemHTML . '" onclick="fOp.rename(\'' . $dirItemURL . '\', \'' . $pathURL . '\'); return false;" class="rename b"></a><!-- Rename ' . $dirItemHTML . ' -->' . "\n\t" . '<a href="?do=delete&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '" title="Delete ' . $dirItemHTML . '" onclick="return confirm(\'Are you sure you want to delete ' . removeQuotes($dirItem) . '?\');" class="del b"></a><!-- Delete ' . $dirItemHTML . " -->" . "\n  </li>\n";
    }
}