Set correctly ckeditor config

pull/2487/head
jmontoyaa 9 years ago
parent 9bae4ead33
commit 823c8232fa
  1. 2
      main/inc/lib/formvalidator/FormValidator.class.php
  2. 7
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  3. 2
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  4. 2
      src/Chamilo/CoreBundle/Component/Editor/Editor.php
  5. 5
      src/Chamilo/CoreBundle/Component/Editor/Toolbar.php

@ -905,7 +905,7 @@ EOT;
$attributes['cols-size'] = isset($config['cols-size']) ? $config['cols-size'] : [];
$attributes['class'] = isset($config['class']) ? $config['class'] : [];
$this->addElement('html_editor', $name, $label, $attributes);
$this->addElement('html_editor', $name, $label, $attributes, $config);
$this->applyFilter($name, 'trim');
if ($required) {
$this->addRule($name, get_lang('ThisFieldIsRequired'), 'required');

@ -78,10 +78,13 @@ class CkEditor extends Editor
*/
public function editorReplace()
{
$toolbar = new Toolbar\Basic($this->toolbarSet, $this->config, 'CkEditor');
$toolbar = new Toolbar\Basic(
$this->toolbarSet,
$this->config,
'CkEditor'
);
$toolbar->setLanguage($this->getLocale());
$config = $toolbar->getConfig();
$javascript = $this->toJavascript($config);
$html = "<script>

@ -174,7 +174,7 @@ class Basic extends Toolbar
);*/
$config['skin'] = 'bootstrapck,'.api_get_path(WEB_LIBRARY_JS_PATH).'ckeditor/skins/bootstrapck/';
//$config['skin'] = 'moono';
//$config['skin'] = 'moono-lisa';
if (isset($this->config)) {
$this->config = array_merge($config, $this->config);

@ -201,9 +201,11 @@ class Editor
case 'Config':
$this->processConfig($value);
break;
case 'width':
case 'Width':
$this->setConfigAttribute('width', $value);
break;
case 'height':
case 'Height':
$this->setConfigAttribute('height', $value);
break;

@ -23,12 +23,13 @@ class Toolbar
*/
public function __construct(
$toolbar = null,
$config = array(),
$config = [],
$prefix = null
) {
if (!empty($toolbar)) {
$class = __NAMESPACE__."\\".$prefix."\\Toolbar\\".$toolbar;
if (class_exists($class)) {
$this->setConfig($config);
$toolbarObj = new $class();
$config = $toolbarObj->getConfig();
@ -47,7 +48,7 @@ class Toolbar
}
}
$this->setConfig($config);
$this->updateConfig($config);
}
}

Loading…
Cancel
Save