Hi all...
I need to add a button to the toolbar that allows document deletion (next to save and new buttons). What is the best way to do that?
Thanks
Jaime
I need to add a button to the toolbar that allows document deletion (next to save and new buttons). What is the best way to do that?
Thanks
Jaime
RE: How to add a button to the toolbar
Hi jstuardo !

There is a mini how-to code plugins in the fckeditor wiki : wiki.fckeditor.net, check it out
if you read french, here's a kind of how-to of mine :
SOMMAIRE:
---------
L'écriture d'un plugin pour FCKEditor :
1) Crée un repertoir qui contiendra les fichiers du plugin. Le nom choisi pour le repertoir doit etre le meme que le nom du plugin lui meme;
2) Ecrire le plugin en javascript, le nom du fichier doit etre fckplugin.js. Il doit être placé dans le répertoir crée en 1);
3) Il y a le fichier skins/CCI.fr.config.js à modifier;
DETAILS:
--------
1) Création du repertoir :
Choisir le meme nom que celui qu'on donnera au plugin.
2) Ecriture du plugin :
Pour un plugin avec popup :
command = FCKCommand(nom, new FCKDialogCommand(nom1,nom2,page_html_à_appeler));
Pour un plugin sans popup :
command = function (args){
commandes d'init;
}
command.prototype.Execute = function () {
commmandes à executer quand on clique sur le bouton correspondant au plugin dans la toolbar;
}
Dans les deux cas (avec ou sans popup) :
//créer un bouton dans la toolbar
oitem = FCKToolBarButton(nom,description);
//Ajouter le bouton à la toolbar
FCKToolBarItems.RegisterItem(nom,oitem);
3) Modifier le fichier de configuration utilisé par l'éditeur, custom.config.js :
Ajouter le plugins dans la barre d'outils :
FCKConfig.ToolbarSets['CustomToolBar'] = [
['Style','Bold','Italic','Underline' ... 'MON_PLUGIN_ICI' ]
];)
Puis charger le plugin :
FCKConfig.Plugins.Add( 'MyPlugin',null,sPluginPath ) ;
Y.Chaouche
RE: How to add a button to the toolbar
Using the same concept, I think I can modify the behaviour of a button, couldn't I? For example, I need to take some action when a new content button is pressed. It actually clears content window, but I need also to clear some hidden fields.
Jaime
RE: How to add a button to the toolbar
Hello !
.
I am glad i could help you
I do not know if you can change the behaviour of an alerady exisiting button in fckeditor, unless you modify the source code for this button, but you can make some walkarounds. For example, some weeks ago i had to change the behaviour of the link button. I decided to rewrite it as a plugin, copying all necessary files and modifying those who needed to be, and adding some others to add new features to the link button.
That way, all i had to do is to remove the classic link button from the toolbar, and replace it with my new button.
Y.Chaouche.