Customize wysiwyg w/different admin & user toolbars (as of v3.66)
5 posts by 3 authors in: Forums > CMS Builder
Last Post: June 21, 2024 (RSS)
By Deborah - June 15, 2024
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
By Djulia - June 16, 2024
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
By Deborah - June 17, 2024
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
By Dave - June 20, 2024
Hi Deborah,
Can you try the attached file? Let me know if it works for you.
interactivetools.com
By Deborah - June 21, 2024
Dave,
Yes - it's working perfectly. Thanks for your assistance!
~ Deborah