Post details: Upgrading the P4A FCKEditor File Manager

10/12/09

Permalink 01:42:01 pm, by admin Email , 218 words, 4195 views   English (UK)
Categories: PHP

Upgrading the P4A FCKEditor File Manager

I use P4A a lot. One thing I've found though is that the default File Manager which comes with it's implementation of FCKEditor is a bit basic for my customers.

As a result, I now use TinyBrowser as a replacement. This article outlines how to implement it.

First off, download the latest TinyBrowser from http://www.lunarvis.com, currently this is v1.41.

Extract the contents of the TinyBrowser download into
./themes/default/widgets/rich_textarea/editor/filemanager/browser/tinybrowser

Edit ./themes/default/widgets/rich_textarea/rich_textarea.php and place the following code inside the first PHP code block:


// Introduced by Fear of Mice to support tinybrowser
$mydir = P4A_UPLOADS_DIR. '/' . $this->getUploadSubpath(); //set
$prep = false;
if (substr($mydir, 0, 7) == 'http://' || substr($mydir, 0, 8) == 'https://') { //Strip_Slashes
$prep = TRUE;
}
$mydir = str_replace('https://','',$mydir);
$mydir = str_replace('http://','',$mydir);
$mydir = preg_replace('|(/)+|','/',$mydir);
if($prep === TRUE) {
$mydir = prep_url($mydir);
}
$mydir=base64_encode($mydir); //encode it

then replace:

rte.Config['LinkBrowserURL'] = rte.BasePath + 'editor/filemanager/browser/default/browser.html?Connector=<?php echo $connector ?>';

with

rte.Config['LinkBrowserURL'] = rte.BasePath + "editor/filemanager/browser/tinybrowser/tinybrowser.php?path=<?php echo $mydir ?>";

That's it. You should now have a nice File Manager which supports multiple uploads and thumbnails.

Trackback address for this post:

http://www.fearofmice.co.uk/blog/htsrv/trackback.php?tb_id=42

Comments, Trackbacks, Pingbacks:

No Comments/Trackbacks/Pingbacks for this post yet...

Comments are not allowed from anonymous visitors.

fear of mice

This is the official blog of

We aim to post comments (and possibly solutions) to some of the more interesting IT Support issues we come across in our daily travels around the South Hams of Devon.

September 2010
Mon Tue Wed Thu Fri Sat Sun
<< <     
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Search

Categories

Misc

XML Feeds

What is RSS?

Who's Online?

  • Guest Users: 4

powered by
b2evolution