I'm using the editor in a content managed website and need to link the image browser to my Java servlet. It's going well so far except that I need to pass an extra URL parameter through the image browser page and into my servlet. I've got it added to the call creating the fckeditor.html page, but I can't figure out the next step.
How do I pass a 'workspaceId=5' sort of thing into the 'Browser Server' button url? The number (5 or whatever) is of course dynamically changing all over my site; this isn't something I can do just once in a config file.
This might be:
1) How do I read a parameter value from within fckeditor.html ?
2) If I can read the parameter, how do I then affect the Browse Server url from that area?
Thank you if anyone can help me.
How do I pass a 'workspaceId=5' sort of thing into the 'Browser Server' button url? The number (5 or whatever) is of course dynamically changing all over my site; this isn't something I can do just once in a config file.
This might be:
1) How do I read a parameter value from within fckeditor.html ?
2) If I can read the parameter, how do I then affect the Browse Server url from that area?
Thank you if anyone can help me.
RE: Image Browser integration, extra variables
Any hope would be much appreciated.
-Jeff Kelley
RE: Image Browser integration, extra variable
In fckeditor.php add $YourURLParameter:
class FCKeditor
{
var $ToolbarSet ;
var $Value ;
var $CanUpload ;
var $CanBrowse ;
var $BasePath ;
var $URLParameter ;
function FCKeditor()
{
$this->ToolbarSet = '' ;
$this->Value = '' ;
$this->CanUpload = 'none' ;
$this->CanBrowse = 'none' ;
$this->BasePath = '/FCKeditor/' ;
$this->$URLParameter = '' ;
}
...
In fck_init.js look for:
...
// Override some configurations (Deprecated)
if (URLParams['Upload']) config.ImageUpload = config.LinkUpload = ( URLParams['Upload'] == 'true' ) ;
if (URLParams['Browse']) config.ImageBrowser = config.LinkBrowser = ( URLParams['Browse'] == 'true' ) ;
...
and below of it add:
// URLParameter Hack
if (URLParams['URLParameter'])
{
config.ImageBrowserURL = config.ImageBrowserURL + "?URLParameter=" + URLParams['URLParameter'] ;
config.LinkBrowserURL = config.LinkBrowserURL + "?URLParameter=" + URLParams['URLParameter'] ;
config.ImageUploadURL = config.ImageUploadURL + "?URLParameter=" + URLParams['URLParameter'] ;
config.LinkUploadURL = config.LinkUploadURL + "?URLParameter=" + URLParams['URLParameter'] ;
}
This adds you parameter to your browser and upload URLs.
The editor is called like usually, only with the additional URL parameter:
<?php /* create editor */ $oFCKeditor = new FCKeditor; $oFCKeditor->ToolbarSet = 'Default'; $oFCKeditor->CanUpload = true; $oFCKeditor->CanBrowse = true; $oFCKeditor->URLParameter = "$yourParameter"; $oFCKeditor->CreateFCKeditor('name', 100, 200); ?>