Hi,
I've been frustrated a number of times forgetting to make snippet files editable. Here's a short addition which adds a 'not writable' comment to filenames in the drop-down list.
Add this line into 'includes/shared.lib.php', in the fileDropDown() function, after the line '$snippet_found = true;'
if (!is_writable($myfile)){ $myfile = "$myfile (Cannot Save)"; }
The dropdown will now add '(Cannot Save)' to filenames that aren't writable, but it causes a problem when trying to open the file since the filename is now incorrect. The best solution is to then fix the permission problem.
If you still want to load these files, even though you cannot save them, then the following line needs to be changed in the extractInfo() function. Near the start of the function, replace this:
if(!file_exists($path)) $this->returnError("The file located at \"$path\" does not exist<br>FUNC: extractInfo()");
with:
if(!file_exists($path)) { $path = preg_replace('/ \(.*\)$/', '', $path); if(!file_exists($path)) { $this->returnError("The file located at \"$path\" does not exist<br>FUNC: extractInfo()");} }
If a file doesn't exist it will check if the filename without comments (enclosed in brackets) exists, and will use that if it can.
Handy?