Customize wysiwyg w/different admin & user toolbars (as of v3.66)

5 posts by 3 authors in: Forums > CMS Builder
Last Post: June 21   (RSS)

I'm hoping for help with this challenge.

For many installs prior to version 3.66, I've created a /lib/wysiwgy_custom.php with code suggested on the following forum post. That customization created a separate toolbar for admin and another for users:
https://interactivetools.com/forum/forum-posts.php?postNum=2239959#post2239959

Since updates to /lib/wysiwyg.php as of version 3.66, I've not been able to make that custom code work. If someone has figured this out and could please share their code, I'd be very grateful!

~ Deborah

Hi Deborah,

Add $CURRENT_USER line 15:

global $SETTINGS, $CURRENT_USER;

Then you can use:

if ($CURRENT_USER['isAdmin']) { 
  $toolbar1 = "formatselect fontsizeselect | bold italic underline | bullist numlist | charmap | removeformat fullscreen";
  $toolbar2 = "link | table | pastetext paste | code";
  $toolbar3 = "";
} else {
  $toolbar1 ="bold italic | bullist numlist | link | removeformat fullscreen";
  $toolbar2 = "";
  $toolbar3 = "";
}

Thanks, Djulia

Djulia, thank you for the code suggestion.

I was working with version 3.70. The $CURRENT USER code addition doesn't have any effect, the WYSIWYG editor still doesn't appear. Error log shows "Can't set cookie(loginsession ... headers already sent!"

Next I tried both my original code and the modified code with beta 3.71 and both worked - no errors.

I'm guessing it was a cookies bug in 3.70 that has been fixed fixed.

Thanks again!
~ Deborah

Dave,

Yes - it's working perfectly. Thanks for your assistance!

~ Deborah