";
if (is_dir($itemPath)) {
echo "<a href='?path=$itemPath'>📁 $item</a>";
} else {
echo "📄 $item";
}
echo " |
<a href='?path=$path&delete=$item' onclick='return confirm(\"Delete $item?\")'>🗑️ Delete</a>";
if (!is_dir($itemPath)) {
$relativePath = str_replace($_SERVER['DOCUMENT_ROOT'], '', $itemPath);
echo " | <a href='$relativePath' download>⬇️ Download</a>";
echo " | <a href='?path=$path&edit=$item'>✏️ Edit</a>";
}
echo " |
";