Author Topic: Editor config based on userid  (Read 2930 times)

Offline marathoner

  • Posts: 495
Editor config based on userid
« on: January 06, 2008, 04:28:36 PM »
I'd like to offer my users the ability to modify WYSIWYG pages but with only limited functionality (so that they don't go overboard with different fonts styles/bolding/sizing that they seem to like to do). I know that it's easy to modify the FCKEditor 'fckeditor/wb_config/wb_fckconfig.js' file to alter the toolbars which does exactly what I want it to. However, I'd like to not limit my (admin) FCKEditor capabilities.

So, I guess what I'd like to do is to have the FCKEditor configuration different based on the WB userid. I think that I can do this by modifying 'fckeditor/include.php' line 73 to use one config.js file if the WB userid is admin otherwise use different config.js file.

Has anyone tried this? Is there a better approach to have a limit WYSIWYG editor for my users?

doc

  • Guest
Re: Editor config based on userid
« Reply #1 on: January 06, 2008, 04:50:54 PM »
Hello,

your approach should work (this is the way I would do it). WB 3.0 will offer the choice so the user can define its custom editor.

Regards Christian

Offline macsmet

  • Posts: 253
Re: Editor config based on userid
« Reply #2 on: January 07, 2008, 09:16:19 AM »
@Marathoner: I am very interested in your idea and solution. Can you post it?
Thanks.

greetings,

MacSmet

doc

  • Guest
Re: Editor config based on userid
« Reply #3 on: January 08, 2008, 03:32:28 PM »
Hello,

for the FCKEditor, open the file include.php and search for the line
Code:
Only registered users can see contents. Please click here to Register or Login.
Replace this line by the following code: (without starting <?php and ending ?>)
Code:
Only registered users can see contents. Please click here to Register or Login.
Then simply create a copy of the config file /fckeditor/wb_config/wb_fckconfig.js for each group you want to support and rename it as follows: wb_fckconfigGROUP_ID.js (where GROUP_ID is a numeric group_id; 1:=administrators).

If you want to test it for different groups, remember to delete the browser cache and to clear sessions before login into the WB backend with the new group_id.

Note: If you want to have a custom configuration file for each user_id, simply replace:
Code:
Only registered users can see contents. Please click here to Register or Login.
Regards Christian
« Last Edit: January 08, 2008, 03:44:31 PM by doc »

Offline marathoner

  • Posts: 495
Re: Editor config based on userid
« Reply #4 on: January 08, 2008, 06:03:34 PM »
Works like a charm! Thanks so much!