How can I manage to have two different toolbars in CKEditor for two different groups?

断了今生、忘了曾经 提交于 2019-12-11 06:54:52

问题


I am using Zikula 1.4.6 with several modulstudio generated modules. These modules do have scribite plugin activated. If I use the "full" toolbar I do see all my modules in this toolbar. But I have to create a stripped down toolbar for my normal users. There they should not have acces to all modul plugins. So I generated the "special1" toolbar accordingly. The "special2" toolbar is prepared for my advanced users named "redakteure".

Zikula offers stil the possibility to use the overwrite.yml (Scribite is an older style module where the symphony override is not working). But I do not see which file I do have to change to use the special1 or special2 depending on the permission or group situation.

Or is there a better way to do something to make some plugins only visible for some groups?

How can I manage to have two different toolbars in CKEditor for two different groups?


回答1:


You need to incorporate a permission check here: https://github.com/zikula-modules/Scribite/blob/master/plugins/CKEditor/templates/editorheader.tpl#L31

For example:

{{checkpermission component='::' instance='.*' level='ACCESS_ADMIN' assign='isAdmin'}
{{if $isAdmin}}
    toolbar: 'mySpecialToolbar',
{{else}}
    toolbar: '{{$Scribite.editorVars.barmode}}',
{{/if}}


来源:https://stackoverflow.com/questions/42225553/how-can-i-manage-to-have-two-different-toolbars-in-ckeditor-for-two-different-gr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!