add load css style combox Style BT#10982

ofaj
Alex Aragon 10 years ago
parent 91e0d411d7
commit 82df8ef120
  1. 6
      app/Resources/public/css/editor.css
  2. 10
      main/inc/lib/template.lib.php
  3. 1
      main/template/default/javascript/editor/ckeditor/config_js.tpl
  4. 6
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  5. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php

@ -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{

@ -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 <head> section
* @return void

@ -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'}}';
};

@ -56,11 +56,11 @@ class CkEditor extends Editor
{
$style = '';
if (trim($this->value) == '<html><head><title></title></head><body></body></html>') {
$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 = '<link href="'.$cssFile.'" rel="stylesheet" media="screen" type="text/css" />';
}

@ -51,7 +51,7 @@ class Basic extends Toolbar
'showblocks',
'smiley',
'sourcedialog',
/* 'stylesheetparser', css default*/
'stylesheetparser',
'tableresize',
'templates',
'uicolor',

Loading…
Cancel
Save