21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 726 Views |
-
_config.php Permission::check

22 March 2011 at 11:58pm
Hi,
does anybody know, how to set a permission check in _config.php to give different settings to different groups?
Permission::check doesn't work?if(Permission::check('administrators')) {
HtmlEditorConfig::get('cms')->enablePlugins('safari','spellchecker','pagebreak','style','layer','table',
'save','advhr','advimage','advlink','emotions','iespell','inlinepopups','insertdatetime','preview','media',
'searchreplace','print','contextmenu','paste','directionality','fullscreen','noneditable','visualchars',
'nonbreaking','xhtmlxtras','template');
} else {}
Greetings, Carsten
-
Re: _config.php Permission::check

23 March 2011 at 6:11am
Well, if it's just the HTMLEditorConfig.
There is a "HTML Editor Configuration" field in the permission tab in security to select the config for this group.... if you specified another HTMLEditorConfig in your _config.php:
// default config
HTMLEditorConfig::get('cms')->setOption('language','de');
// config for group editors
HTMLEditorConfig::get('reduced')->setOption('friendly_name','reduced');
HTMLEditorConfig::get('reduced')->setButtonsForLine(1,'bold'); -
Re: _config.php Permission::check

23 March 2011 at 10:52am
Perfekto! Works great. But you have to be careful to enable the required plugins again.
// config for group editors
HtmlEditorConfig::get('reduced')->setOption('language', 'de');
HtmlEditorConfig::get('reduced')->setOptions(array(
'friendly_name' => 'Simple CMS',
'priority' => '50',
'mode' => 'none',
'content_css' => 'themes/xxx/css/editor.css, '.(SSViewer::current_theme() ? THEMES_DIR . "/" . SSViewer::current_theme() : project()) . "/css/editor.css",
'body_class' => 'content'
));
HtmlEditorConfig::get('reduced')->enablePlugins(array('ssbuttons' => '../../../cms/javascript/tinymce_ssbuttons/editor_plugin_src.js'));
HTMLEditorConfig::get('reduced')->setOption('friendly_name','reduced');
HtmlEditorConfig::get('reduced')->disablePlugins('safari','spellchecker','pagebreak','style','layer','table','save','advhr','advimage','emotions','iespell','inlinepopups','insertdatetime','preview','media','searchreplace','print','contextmenu','paste','directionality','fullscreen','noneditable','visualchars','nonbreaking','xhtmlxtras','template');
HTMLEditorConfig::get('reduced')->setButtonsForLine(1,'save','bold','separator','cut','copy','paste','pastetext','pasteword','separator','bullist','numlist','separator','sslink','unlink','anchor');
HtmlEditorConfig::get('reduced')->setButtonsForLine(2,'');
Thanks a lot Devlin!
| 726 Views | ||
|
Page:
1
|
Go to Top |


