GetSimple Support Forum

Full Version: Basic file browser script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings, I present to you a simple solution for inserting links and images to pages from CKEditor. It is modified upload.php script and features file and image selection modes, browsing subdirectories. It was tested and works on latest GetSimple 3.0 development versions (r325).
I was unable to make a plugin (problems with overriding CKEditor settings after it is initialized), so you'll need to modify one system file.

Installation instructions:
1. Extract and upload filebrowser.php to your GetSimple installation /admin/ directory.
2. Modify edit.php and replace following settings (on line 325):
Code:
filebrowserBrowseUrl : 'filebrowser.php',
filebrowserImageBrowseUrl : 'filebrowser.php?type=images',
filebrowserWindowWidth : '640', //optional
filebrowserWindowHeight : '480' // optional

Usage instructions:
In CKEditor select "Link" or "Image" and "Browse Server". After clicking on file name or image thumbnail link will be inserted.

I think simple file browser is more than enough in CKEditor. Let's leave all the heavy lifting (file upload, copy, paste, delete, new directory etc. file management tasks) for "Files" page.
Nice. If you change line 24 to...
Code:
$type = isset($_GET['type']) ? $_GET['type'] : "";
...it removes a warning when in Debug mode and browsing for non-images, and the two uses of '@' to supress errors around line 70 could be eliminated, though I'm still fiddling with that section.
This is awsome. I was very disapointed with the mess of CK editor file upload. And that is because the file browser was inserting the large version of the picture, and I had to manualy modify the link to thumbnail.

This script should become Get Simple Core. I know taht filebrowser.php, or is CKeditor file, but all major CMS use customized versions of the WYGWYS editors.
This is not exactly on topic, but is somehow related.

In CKeditor, when inserting an image, if we set align propery on image, or add some css, CKeditor will fail to edit the image. It opens an empty dialog, and we have to set the image all over again.
tazmandev Wrote:This script should become Get Simple Core.
already way ahead of you... this will be core for the next release, replacing the temporary version that was put in place a couple weeks ago.