- $output .= ($in_use || not -T $phys_path)
- ? '<span style="color:#C0C0C0">Edit</span>'
- : "<a href=\"$script?command=beginedit&file=$virt_path\">Edit</a>";
+ $output .= (-w $phys_path && -r $phys_path && -T $phys_path && not $in_use)
+ ? "<a href=\"$script?command=beginedit&file=$virt_path\">Edit</a>"
+ : '<span style="color:#C0C0C0">Edit</span>';