Minor - Add missing IntroductionSection toolbar

pull/3173/head
Julio Montoya 7 years ago
parent 97d0ca8a05
commit a7b7ec466a
  1. 135
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/IntroductionSection.php

@ -0,0 +1,135 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
/**
* Documents toolbar configuration.
*
* @package Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar
*/
class IntroductionSection extends Basic
{
public $plugins = [];
/**
* Get the toolbar config.
*
* @return array
*/
public function getConfig()
{
$config = [];
if (api_get_setting('more_buttons_maximized_mode') !== 'true') {
$config['toolbar'] = $this->getNormalToolbar();
} else {
$config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
}
$config['extraPlugins'] = $this->getPluginsToString();
$config['fullPage'] = true;
return $config;
}
/**
* @return array
*/
public function getConditionalPlugins()
{
$plugins = [];
if (api_get_setting('show_glossary_in_documents') === 'ismanual') {
$plugins[] = 'glossary';
}
return $plugins;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false.
*
* @return array
*/
protected function getNormalToolbar()
{
return [
['Maximize', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Link', 'Unlink', 'Anchor', 'inserthtml', 'Glossary'],
[
'Image',
'Video',
'Flash',
'Oembed',
'Youtube',
'Audio',
'Asciimath',
'Asciisvg',
],
['Table', 'SpecialChar'],
[
'Outdent',
'Indent',
'-',
'TextColor',
'BGColor',
'-',
'NumberedList',
'BulletedList',
'-',
api_get_configuration_value('translate_html') ? 'Language' : '',
api_get_setting('allow_spellcheck') === 'true' ? 'Scayt' : '',
],
'/',
['Styles', 'Format', 'Font', 'FontSize'],
['Bold', 'Italic', 'Underline'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
api_get_setting('enabled_wiris') === 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
['Source'],
];
}
/**
* Get the toolbar configuration when CKEditor is minimized.
*
* @return array
*/
protected function getMinimizedToolbar()
{
return [
$this->getNewPageBlock(),
['Undo', 'Redo'],
[
'Link',
'Image',
'Video',
'Flash',
'Youtube',
'Audio',
'Table',
'Asciimath',
'Asciisvg',
],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
['Styles',
'Format',
'Font',
'FontSize',
'Bold',
'Italic',
'Underline',
'TextColor',
'BGColor',
],
[
'Language',
'ShowBlocks',
'Source',
],
api_get_setting('enabled_wiris') === 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
['Toolbarswitch'],
];
}
}
Loading…
Cancel
Save