Fix CKEditor toolbar for text proposed answer - refs #7705

1.10.x
Angel Fernando Quiroz Campos 9 years ago
parent 4e117d530e
commit 4b59b00689
  1. 92
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestProposedAnswer.php

@ -16,32 +16,8 @@ class TestProposedAnswer extends Basic
*/
public function getConfig()
{
$config['toolbarGroups'] = array(
array('name' => 'document'),
array(
'name' => 'clipboard',
'groups' => array('clipboard', 'undo',)
),
array(
'name' => 'basicstyles',
'groups' => array('basicstyles', 'cleanup',)
),
array(
'name' => 'paragraph',
'groups' => array('list', 'indent', 'blocks', 'align')
),
array('name' => 'links'),
array('name' => 'insert'),
'/',
array('name' => 'styles'),
array('name' => 'colors'),
array('name' => 'mode'),
array('name' => 'others')
);
$config['toolbarCanCollapse'] = true;
$config['toolbarStartupExpanded'] = false;
$config['extraPlugins'] = $this->getPluginsToString();
//$config['width'] = '100';
//$config['height'] = '200';
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -54,54 +30,13 @@ class TestProposedAnswer extends Basic
return $config;
}
/**
* @return array
*/
public function getConditionalPlugins()
{
$plugins = array();
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
$plugins[] = 'glossary';
}
return $plugins;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
['NewPage', 'Templates', '-', 'Preview', 'Print'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
['Undo', 'Redo', '-', 'SelectAll', 'Find', '-', 'RemoveFormat'],
['Link', 'Unlink', 'Anchor', 'Glossary'],
[
'Image',
'Mapping',
'Video',
'Flash',
'Youtube',
'Oembed',
'Audio',
'leaflet',
'Smiley',
'SpecialChar',
'Asciimath',
'Asciisvg'
],
'/',
['Table', '-', 'CreateDiv'],
['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'TextColor', 'BGColor'],
[api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : ''],
['Styles', 'Format', 'Font', 'FontSize'],
['PageBreak', 'ShowBlocks', 'Source'],
['Toolbarswitch'],
];
return $this->getNormalToolbar();
}
/**
@ -111,18 +46,9 @@ class TestProposedAnswer extends Basic
protected function getNormalToolbar()
{
return [
[
'Maximize',
'Bold',
'Image',
'Link',
'PasteFromWord',
'Audio',
'Table',
'Subscript',
'Superscript',
'Source'
]
['Bold', 'Subscript', 'Superscript'],
['Image', 'Link', 'Audio', 'Table', 'PasteFromWord'],
['Maximize', 'Source'],
];
}
@ -132,14 +58,6 @@ class TestProposedAnswer extends Basic
*/
protected function getMinimizedToolbar()
{
return [
['Templates'],
['PasteFromWord'],
['Link'],
['Image', 'Video', 'Flash', 'Audio', 'Asciimath', 'Asciisvg'],
['Table'],
['Bold'],
['Source', 'Toolbarswitch']
];
return $this->getNormalToolbar();
}
}

Loading…
Cancel
Save