Hi,
i have written a plugin for fckeditor and i need to put this plugin in a seperate folder outside from fckeditor.
I have a php class that uses the php class of fckeditor. In my class i make the following:
If i load the fckeditor now i get the following error in my firefox:
FCKLang is not defined
My fckplugin.js has the following content:
So what could be wrong here? Or how is the best way to load plugins from a seperate folder?
Thanks for any hints.
Frank
i have written a plugin for fckeditor and i need to put this plugin in a seperate folder outside from fckeditor.
I have a php class that uses the php class of fckeditor. In my class i make the following:
$this->editor = new FCKEditor($this->InstanceName);
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "index.php" ) );
if($sBasePath == "" || $sBasePath == "/") {
$sBasePath = "./extension/fckeditor/fckeditor/";
} else {
$sBasePath = $sBasePath . "/extension/fckeditor/fckeditor/";
}
// set default config
$this->Config['AutoDetectLanguage'] = true;
$this->Config['DefaultLanguage'] = "en";
$this->Config['SkinPath'] = "skins/" . $this->Skin . "/";
$this->Config['CustomConfigurationsPath'] = substr( $_SERVER['PHP_SELF'], 0, strpos( $_SERVER['PHP_SELF'], "index.php" ) )."extension/fckeditor/plugins/krootlink/fckplugin.js";
$this->Config['AutoDetectLanguage'] = true;
$this->Config['DefaultLanguage'] = 'en';
$this->ToolbarSet = 'Default';
$this->BasePath = $sBasePath . "editor/";
If i load the fckeditor now i get the following error in my firefox:
FCKLang is not defined
My fckplugin.js has the following content:
FCKCommands.RegisterCommand( 'krootlink', new FCKDialogCommand( 'krootlink', FCKLang.KrootLinkDlgTitle,
FCKPlugins.Items['krootlink'].Path + 'fck_krootlink.php', 380, 440 ) ) ;
// Create the toolbar button.
// FCKToolbarButton takes the following arguments: CommandName, Button Caption
var oKrootLinkItem = new FCKToolbarButton( 'krootlink', FCKLang.KrootLinkBtn ) ;
oKrootLinkItem.IconPath = FCKPlugins.Items['krootlink'].Path + 'krootlink.gif' ;
FCKToolbarItems.RegisterItem( 'krootlink', oKrootLinkItem ) ;
// The object used for all KrootLink operations.
var FCKKrootLink = new Object() ;
// Add a new KrootLink at the actual selection.
// This function will be called from the HTML file when the user clicks the OK button.
// This function receives the values from the Dialog
FCKKrootLink.Add = function( linkname, caption )
{
FCK.InsertHtml("<a href='"+linkname+"'>"+caption+"</a>") ;
So what could be wrong here? Or how is the best way to load plugins from a seperate folder?
Thanks for any hints.
Frank
