Add Ckeditor codesnippet when creating documents toolbar - refs #2794

pull/3944/head
Angel Fernando Quiroz Campos 7 years ago
parent 7224521c0c
commit a48055c13f
  1. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/CkEditor.php
  2. 1
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  3. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php
  4. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/LearningPathDocuments.php

@ -72,6 +72,9 @@ class CkEditor extends Editor
$style = api_get_css_asset('bootstrap/dist/css/bootstrap.min.css'); $style = api_get_css_asset('bootstrap/dist/css/bootstrap.min.css');
$style .= api_get_css_asset('fontawesome/css/font-awesome.min.css'); $style .= api_get_css_asset('fontawesome/css/font-awesome.min.css');
$style .= api_get_css(ChamiloApi::getEditorDocStylePath()); $style .= api_get_css(ChamiloApi::getEditorDocStylePath());
$style .= api_get_css_asset('ckeditor/plugins/codesnippet/lib/highlight/styles/default.css');
$style .= api_get_asset('ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js');
$style .= '<script>hljs.initHighlightingOnLoad();</script>';
} }
$html = '<textarea id="'.$this->getTextareaId().'" name="'.$this->getName().'" class="ckeditor"> $html = '<textarea id="'.$this->getTextareaId().'" name="'.$this->getName().'" class="ckeditor">

@ -64,6 +64,7 @@ class Basic extends Toolbar
'inserthtml', 'inserthtml',
'xml', 'xml',
'qmarkersrolls', 'qmarkersrolls',
'codesnippet',
]; ];
/** /**

@ -67,6 +67,7 @@ class Documents extends Basic
'Audio', 'Audio',
'Asciimath', 'Asciimath',
'Asciisvg', 'Asciisvg',
'CodeSnippet',
], ],
['Table', 'SpecialChar'], ['Table', 'SpecialChar'],
[ [
@ -115,6 +116,7 @@ class Documents extends Basic
'SpecialChar', 'SpecialChar',
'Asciimath', 'Asciimath',
'Asciisvg', 'Asciisvg',
'CodeSnippet',
], ],
'/', '/',
['Table', '-', 'CreateDiv'], ['Table', '-', 'CreateDiv'],
@ -163,6 +165,7 @@ class Documents extends Basic
'Table', 'Table',
'Asciimath', 'Asciimath',
'Asciisvg', 'Asciisvg',
'CodeSnippet',
], ],
['BulletedList', 'NumberedList', 'HorizontalRule'], ['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight'],

@ -55,6 +55,7 @@ class LearningPathDocuments extends Basic
'SpecialChar', 'SpecialChar',
'Asciimath', 'Asciimath',
'Asciisvg', 'Asciisvg',
'CodeSnippet',
], ],
'/', '/',
['Table', '-', 'CreateDiv'], ['Table', '-', 'CreateDiv'],
@ -90,6 +91,7 @@ class LearningPathDocuments extends Basic
'Asciisvg', 'Asciisvg',
'Table', 'Table',
'SpecialChar', 'SpecialChar',
'CodeSnippet',
], ],
[ [
'Outdent', 'Outdent',
@ -120,6 +122,7 @@ class LearningPathDocuments extends Basic
array_merge(['Save'], $this->getNewPageBlock()), array_merge(['Save'], $this->getNewPageBlock()),
['Undo', 'Redo'], ['Undo', 'Redo'],
['Link', 'Image', 'Video', 'Youtube', 'VimeoEmbed', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'], ['Link', 'Image', 'Video', 'Youtube', 'VimeoEmbed', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['CodeSnippet'],
['BulletedList', 'NumberedList', 'HorizontalRule'], ['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Toolbarswitch'], ['Toolbarswitch'],

Loading…
Cancel
Save