acsineaston Posted April 11, 2016 Share Posted April 11, 2016 I would like to be able to allow superusers access to the full capabilities of CKEditor (the default as shipped with CubeCart), but only allow non-superuser administrators to use a very small subset of those capabilities (e.g., preset Basic). Has anyone attempted this? Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 11, 2016 Share Posted April 11, 2016 Welcome acsineaston! Glad to see you made it to the forums. I am not aware of anyone attempting this. I'll give it some thought and have some advice shortly. Quote Link to comment Share on other sites More sharing options...
acsineaston Posted April 13, 2016 Author Share Posted April 13, 2016 In acp.class.php - function SetTemplate I added: if(Admin::getInstance()->superUser()) { $GLOBALS['smarty']->assign('ADMIN_IS_SUPER', 'true'); } to give me an easy way to test in template products.index.php My thought is to use the /includes/ckeditor directory to provide the CKEditor for a superuser, and another directory (/includes/ckeditor-basic) to provide the CKEditor for non-superusers. Not sure if this makes sense, or how I would go about changing the path to the correct directory. Quote Link to comment Share on other sites More sharing options...
acsineaston Posted April 13, 2016 Author Share Posted April 13, 2016 Turns out I don't have to deal with template products.index.php at all, but rather template main.php Changed: <!-- Include CKEditor --> <script type="text/javascript" src="includes/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="includes/ckeditor/adapters/jquery.js"></script> To: <!-- Include CKEditor --> {if isset($ADMIN_IS_SUPER)} <script type="text/javascript" src="includes/ckeditor/ckeditor.js"></script> {else} <script type="text/javascript" src="includes/ckeditor-basic/ckeditor.js"></script> {/if} <script type="text/javascript" src="includes/ckeditor/adapters/jquery.js"></script> Works like a champ!!! Quote Link to comment Share on other sites More sharing options...
bsmither Posted April 13, 2016 Share Posted April 13, 2016 Sorry for dropping the ball on this. In CC6010 and earlier, CKEditor 3 is used. In CC6011, CKEditor 4 is used. From what I've seen so far, these two major versions have different approaches to declaring the toolbar set available. (But I'll have to dig deeper.) CC6010 establishes the toolbar configuration in /includes/ckeditor/config.js (CKEditor calls for this itself). CC6011 (I haven't found it) does not declare a toolbar set. I believe a "FULL" CKEditor 4 package is being used by CC6011. But adding a custom config should still be possible. Installing distinct variants of CKEditor works but may have unforeseen consequences. Just personally, I would choose custom toolbar sets. It gives me more granularity on a per-admin basis. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.