From 82df8ef12045a01093979daaa6153a647d6fdfae Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Fri, 18 Mar 2016 18:48:29 -0500 Subject: [PATCH] add load css style combox Style BT#10982 --- app/Resources/public/css/{frames.css => editor.css} | 6 +++--- main/inc/lib/template.lib.php | 10 ++++++++++ .../default/javascript/editor/ckeditor/config_js.tpl | 1 + .../CoreBundle/Component/Editor/CkEditor/CkEditor.php | 6 +++--- .../Component/Editor/CkEditor/Toolbar/Basic.php | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) rename app/Resources/public/css/{frames.css => editor.css} (97%) diff --git a/app/Resources/public/css/frames.css b/app/Resources/public/css/editor.css similarity index 97% rename from app/Resources/public/css/frames.css rename to app/Resources/public/css/editor.css index 88c7408cf0..4f8cac5d11 100644 --- a/app/Resources/public/css/frames.css +++ b/app/Resources/public/css/editor.css @@ -63,13 +63,13 @@ a:hover{ max-width: 100%; height: auto; } -figure.image.alignleft{ +figure .image.alignleft{ margin: 0 20px 20px 0; } -figure.image.alignright{ +figure .image.alignright{ margin: 0 20px 0px 20px; } -figure.image{ +figure .image{ margin: 0 20px 0px 20px; } figure figcaption{ diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index f6869970ad..e43fd9b947 100755 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -155,6 +155,8 @@ class Template //Setting administrator variables $this->setAdministratorParams(); + + $this->setCSSEditor(); //header and footer are showed by default $this->set_footer($show_footer); @@ -566,6 +568,14 @@ class Template $this->assign('css_static_file_to_string', $css_file_to_string); } } + public function setCSSEditor() { + $cssEditor = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'editor.css'); + if (is_file(api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/editor.css')) { + $cssEditor = api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/editor.css'; + } + + $this->assign('cssEditor', $cssEditor); + } /** * Prepare custom CSS to be added at the very end of the section * @return void diff --git a/main/template/default/javascript/editor/ckeditor/config_js.tpl b/main/template/default/javascript/editor/ckeditor/config_js.tpl index 1b1575c72a..f245399218 100644 --- a/main/template/default/javascript/editor/ckeditor/config_js.tpl +++ b/main/template/default/javascript/editor/ckeditor/config_js.tpl @@ -50,6 +50,7 @@ CKEDITOR.editorConfig = function (config) { // Allows to use "class" attribute inside divs and spans. config.allowedContent = true; + config.contentsCss = '{{ cssEditor }}'; config.customConfig = '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/config_js.php'}}'; }; diff --git a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php index 69f1383df2..82f3323413 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php +++ b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php @@ -56,11 +56,11 @@ class CkEditor extends Editor { $style = ''; if (trim($this->value) == '') { - $cssFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/frames.css'; + $cssFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/editor.css'; if (!is_file($cssFile)) { - $cssFile = api_get_path(WEB_CSS_PATH).'frames.css'; + $cssFile = api_get_path(WEB_CSS_PATH).'editor.css'; } else { - $cssFile = api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/frames.css'; + $cssFile = api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/editor.css'; } $style = ''; } diff --git a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php index d32f269922..d502432e5f 100644 --- a/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php +++ b/src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php @@ -51,7 +51,7 @@ class Basic extends Toolbar 'showblocks', 'smiley', 'sourcedialog', - /* 'stylesheetparser', css default*/ + 'stylesheetparser', 'tableresize', 'templates', 'uicolor',