Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KCFinder for GetSimple 2.x
#1
Hi,

I've released a plugin to intergrate the KCFinder File Manager into Getsimple.

It adds the browse button to CKeditor as well as a seperate tab for the browser itself so you can use it as a
replacement for the internal file manager.

Just download the files, unzip and place in your plugins folder.
I've tested successfully on both Apache and Windows server and all seems to work fine.

Download the current version 1.2 plugin from here:

http://www.digimute.com/index.php?id=blo...der-plugin

Download includes a slightly modified version 1.7 of KCFinder.

Post here any problems.

More details about KCFInder can be found here: http://kcfinder.sunhater.com/


Enjoy,
Mike.
My Github Repos: Github
Website: DigiMute
Reply
#2
somehow prompts you to download pictures from another folder
and the button is sometimes not visible

admin/admin
Reply
#3
I can see the file manager on the plugins page, but there is no browse option when editing a page and opening the insert image dialog. Using GetSimple from SVN.
-- Sam
Reply
#4
Yeah seems to be a problem with the timing , removing the original Ckeditor and then reapplying settings.

Seems the first one is not always destroyed before the new one in initiated.

Some browsers are better than others.

Will have to rethink....

Unless anyone knows of a way to apply CKeditor settings on the fly....

Mike...
My Github Repos: Github
Website: DigiMute
Reply
#5
It's actually quite simple after all... just do:

Code:
function kcfinder_show() {
    echo '
    <div id="kcdemo">
    <div id="kcbrowser">
    <iframe name="kcfinder" id="kcframe" src="../plugins/kcfinder-1.7/browse.php" frameborder="0" width="100%" height="500px" marginwidth="0" marginheight="0" scrolling="yes" >
    </iframe>
    </div>
    </div> ';
}

function kcfinder_editor(){
    echo "
    <script type=\"text/javascript\">
    if(editor) {
        editor.config.filebrowserBrowseUrl = \"../plugins/kcfinder-1.7/browse.php\";
        editor.config.filebrowserWindowWidth = \"640\";
        editor.config.filebrowserWindowHeight = \"480\";
    }
    </script>";
}

However, I found that after selecting an image (e.g. by double clicking) the path is wrong (/uploads/image.jpg).
-- Sam
Reply
#6
Well, a quick fix for the image path (2 lines in 2 files needed to be changed):

class/class_browser.php line 63 change to:
Code:
$this->config['uploadURL'] = 'data';

and

tpl/tpl__header.php line 36 to:
Code:
browser.uploadURL = "<?php echo helper::js_value($this->config['uploadURL']) ?>";
Reply
#7
Close to what worked for me.

I took out $this->config['uploadDir'] and $this->config['uploadURL'] (lines 62 + 63) from class/class_browser.php since they are set in config.php and you shouldn't really alter files from a third party a library if you can help it.

Set config.php $_CONFIG array item: 'uploadURL' => "/site/data/" (because not in root of site). As a result, did not need to change tpl/tpl__header.php.
-- Sam
Reply
#8
This may also work in config.php:
Code:
'uploadURL' => "../../data",
-- Sam
Reply
#9
Great plugin! It works ok. But maybe a theme for the kcfinder would be nice so it stays in the Get Simple Ambience/Vibe. I think the power of get simple is that the backend has a certain relax ambience and when plugins are implemented but not modified by layout, it takes away the relax workspace.

Greets
Reply
#10
How this to start with, a theme with a dark background (instead of grey)?

Unzip to plugins\kcfinder-1.7\themes, it should create a folder called 'getsimple' in it, then change 'theme' => "getsimple" in \plugins\kcfinder-1.7\config.php.

Disclaimer: I am more developer than designer, so just changed the colours a bit - icons are the same as the original theme. I'm sure it can be improved on.
-- Sam
Reply
#11
And now, please, bring it all together, pack and is available for download
Reply
#12
Thanks for all the input guys.

been mad busy with my 'real' work the last few days so couldn't update...

i'll get these updates done this evening and post up the revised edition.

Also working at integrating KCFinder into the core.

Mike...
My Github Repos: Github
Website: DigiMute
Reply
#13
Version 1.2 of the plugin is now available for download at http://www.digimute.com/index.php?id=blo...der-plugin


In order to get the plugin working on both windows and Unix I've had to make 2 small changes to the KCFinder code.

o - Added a baseUrl Option to the config file
o - changed template file to reflect this.

Getsimple theme is the default and just changes the butoon colors to match GS.

Again thanks to all for input.

I'm currently testing version 2.0 of KCFinder for inclusion in the core, once its stable I'll add it to the SVN.


Enjoy..
Mike...
My Github Repos: Github
Website: DigiMute
Reply
#14
Thanks, it works....but the picture does not appear in the editor window Smile
and editing 'news-manager' references no, but it is editing 'vudu_news'
Reply
#15
Oleg, your site is in a subfolder "0" so you'll need to change the baseUrl in the
KCFinder-1.7\config.php to

"0\data" for it to work.

Mike.
My Github Repos: Github
Website: DigiMute
Reply
#16
ok, thanks
Reply
#17
cant see the uploader in ckeditor, how come??????
Reply
#18
Got KCFinder 2 working for me, all I needed to change was uploadURL in kcfinder-2.0\config.php and create an .htaccess file in the kcfinder-2.0 directory.

Download v2 of KCFinder http://kcfinder.sunhater.com/#download, extract to plugins directory.

Plugin code attached, not sure what all the extra JavaScript was for (window.KCFinder.change) and window.onload not needed (since it runs after the rich text editor has loaded), so removed
-- Sam
Reply
#19
Is there any way to get this to auto populate the image height and width fields, so its a case of just pressing ok to insert the image.

As of now, (on my install anyway), when you browse for the image, double click it and press ok it shows nothing in the text preview of the page, but it is all there in the source code.
Reply
#20
but have you tried to right click?
Reply
#21
Hi- Thanks for the plugin!

To get it to work I had to change line 64:
Code:
if ($_GET['id']!=''){

to:
Code:
if ((!isset($_GET['id'])) || ((isset($_GET['id'])) && ($_GET['id']!=''))){


as my server generates an error on _GET for a variable that doesn't exist.

-Rob A>
Reply
#22
The download link for this plugin is broken.
Is it available somewhere else?
Reply
#23
thought I had this up on extend...

I'll redo it for GS3.1 and put it up there.

KCFinder itself has had a lot of updates since I wrote this so I'll update to that version too...
My Github Repos: Github
Website: DigiMute
Reply
#24
n00dles101 Wrote:thought I had this up on extend...

I'll redo it for GS3.1 and put it up there.

That's great, Mike!
For sure it will be very useful for those who want multi-file selection, deletion, etc.
Reply




Users browsing this thread: 4 Guest(s)