1 ckeditor.module | _ckeditor_theme_css($theme = NULL) |
Retrieves the default theme's CKEditor stylesheets defined in the .info file.
Themes may specify iframe-specific CSS files for use with CKEditor by including a "ckeditor_stylesheets" key in the theme .info file.
ckeditor_stylesheets[] = css/ckeditor-iframe.css
Parameters
string $theme: The theme name from which the "ckeditor_stylesheets" property should be read in the .info files. This theme and all its parent themes will be checked. Defaults to the current front-end theme.
Return value
array: An array of all CSS to be added by the theme within the CKEditor.
File
- core/
modules/ ckeditor/ ckeditor.module, line 767 - Provides integration with the CKEditor 4 WYSIWYG editor.
Code
function _ckeditor_theme_css($theme = NULL) {
$css = array();
if (!isset($theme)) {
$theme = config_get('system.core', 'theme_default');
}
if ($theme_path = backdrop_get_path('theme', $theme)) {
$info = system_get_info('theme', $theme);
if (isset($info['ckeditor_stylesheets'])) {
$css = $info['ckeditor_stylesheets'];
foreach ($css as $key => $path) {
$css[$key] = $theme_path . '/' . $path;
}
}
if (isset($info['base theme'])) {
$css = array_merge($css, _ckeditor_theme_css($info['base theme']));
}
}
return $css;
}