Does anyone know if it's possible to create a dynamic toolbarSet.
If you have 3 users and not every of them is allowed to to access the filemanager or spellchecker, I can't create a toolbar for every possible combination of toolbar items.
Any ideas?
Thanks
jenzener
If you have 3 users and not every of them is allowed to to access the filemanager or spellchecker, I can't create a toolbar for every possible combination of toolbar items.
Any ideas?
Thanks
jenzener
RE: dynamic toolbar constellation
I create a hidden form field containing all Buttons the specific user is allowed to use.
I added a function to my fckconfig.js. The function compares all entries in the selected toolbarSet with the list of all allowed buttons. If there is an entry in the toolbarSet not listed in the allowed list, it's been rmoved from the toolbar-array.
RE: dynamic toolbar constellation
Cheers,
Stephan
RE: dynamic toolbar constellation
I ended up creating multiple toolbars and using CF to generate the JS at runtime that would call the proper one depending on server-side applications parameters.
Cheers,
Stephan
RE: dynamic toolbar constellation
I agree, it would have been easier to use server-side application - in my case also cf. but when a new version of fck comes out, I have to redo all my mods.
RE: dynamic toolbar constellation
Lol jenzener - I know what you mean... I have hacked up most of the code base for the editor, including a completely different file browser, and most of the screens modified... .which mean that every release I have to redo all the changes... I'm therefore in no hurry to upgrade
Cheers,
Stephan.
RE: dynamic toolbar constellation
In my fckeditor.cfc I modified the function showHTMLEditor:
I added a formfield:
<input type="hidden" id="#this.instanceName#___Options" value="#GetOptionsString()#" />
then I've created the function GetOptionsString()
In this function I use a list containing all available ToolbarItems which is compared with the allowed ToolbarItems. Not allowed Items will be removed.
In my personal fckconfig.js I added the following function which removes all unused ToolbarItems of the selected ToolbarSet:
function cleanToolbarSet(userToolbar,allowedElements){
for(i=0;i<FCKConfig.ToolbarSets[userToolbar].length;i++){
if(FCKConfig.ToolbarSets[userToolbar][i].length){
for(k=0;k<FCKConfig.ToolbarSets[userToolbar][i].length; k++){
if(allowedElements.indexOf(FCKConfig.ToolbarSets[userToolbar][i][k]) == -1 && FCKConfig.ToolbarSets[userToolbar][i][k] != "-"){
FCKConfig.ToolbarSets[userToolbar][i].splice(k,1);
}
}
}
}
}
The arguments:
userToolbar: name of the used Toolbar:
allowedElements: the list located in the formfield at to top
hope this helps
cheers
jenzener
RE: dynamic toolbar constellation
Baby steps here with ColdFusion. Need to ask you to bear with me and give a few more hints on your "cleanTooBarSet":
Where should I locate the function <cffunction name="GetOptionString" ...
The "list" inside GetOptionsString refers to a variable initialized somewhere else?
How do I fire the function cleanToolBarSet()
... and any other hint you deem necessary to a real newbe.
Thanks very much.
ContiW