Browse Source

Add translate html config js for exercise descriptions see BT#15641

Julio Montoya 5 years ago
parent
commit
8265d22a19

+ 3 - 0
main/exercise/exercise_submit.php

@@ -51,6 +51,9 @@ if ($showGlossary) {
     $htmlHeadXtra[] = api_get_js('jquery.highlight.js');
 }
 
+$js = '<script>'.api_get_language_translate_html().'</script>';
+$htmlHeadXtra[] = $js;
+
 $htmlHeadXtra[] = api_get_js('jqueryui-touch-punch/jquery.ui.touch-punch.min.js');
 $htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');
 $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');

+ 3 - 0
main/exercise/overview.php

@@ -22,6 +22,9 @@ Session::erase('duration_time');
 
 $this_section = SECTION_COURSES;
 
+$js = '<script>'.api_get_language_translate_html().'</script>';
+$htmlHeadXtra[] = $js;
+
 // Notice for unauthorized people.
 api_protect_course_script(true);
 $sessionId = api_get_session_id();

+ 1 - 1
src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/IntroductionSection.php

@@ -126,10 +126,10 @@ class IntroductionSection extends Basic
             [
                 'Language',
                 'ShowBlocks',
-                'Source',
             ],
             api_get_setting('enabled_wiris') === 'true' ? ['ckeditor_wiris_formulaEditor', 'ckeditor_wiris_CAS'] : [''],
             ['Toolbarswitch'],
+            ['Source'],
         ];
     }
 }

+ 43 - 7
src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestQuestionDescription.php

@@ -40,7 +40,6 @@ class TestQuestionDescription extends Basic
             $config['toolbar'] = $this->getNormalToolbar();
         } else {
             $config['toolbar_minToolbar'] = $this->getMinimizedToolbar();
-
             $config['toolbar_maxToolbar'] = $this->getMaximizedToolbar();
         }
 
@@ -53,7 +52,7 @@ class TestQuestionDescription extends Basic
     public function getConditionalPlugins()
     {
         $plugins = [];
-        if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
+        if (api_get_setting('show_glossary_in_documents') === 'ismanual') {
             $plugins[] = 'glossary';
         }
 
@@ -90,11 +89,24 @@ class TestQuestionDescription extends Basic
             ['Table', '-', 'CreateDiv'],
             ['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'],
             ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
-            ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'TextColor', 'BGColor'],
+            [
+                'Bold',
+                'Italic',
+                'Underline',
+                'Strike',
+                '-',
+                'Subscript',
+                'Superscript',
+                '-',
+                'TextColor',
+                'BGColor',
+                api_get_configuration_value('translate_html') ? 'Language' : '',
+            ],
             [api_get_setting('allow_spellcheck') == 'true' ? 'Scayt' : ''],
             ['Styles', 'Format', 'Font', 'FontSize'],
-            ['PageBreak', 'ShowBlocks', 'Source'],
+            ['PageBreak', 'ShowBlocks'],
             ['Toolbarswitch'],
+            ['Source']
         ];
     }
 
@@ -110,11 +122,23 @@ class TestQuestionDescription extends Basic
             ['Link', 'Unlink'],
             ['Image', 'Video', 'Flash', 'Oembed', 'Youtube', 'Audio'],
             ['Table', 'SpecialChar'],
-            ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'TextColor', 'BGColor', '-', 'Source'],
+            [
+                'NumberedList',
+                'BulletedList',
+                '-',
+                'Outdent',
+                'Indent',
+                '-',
+                'TextColor',
+                'BGColor',
+                '-',
+                api_get_configuration_value('translate_html') ? 'Language' : '',
+            ],
             '/',
             ['Styles', 'Format', 'Font', 'FontSize'],
             ['Bold', 'Italic', 'Underline'],
             ['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
+            ['Source']
         ];
     }
 
@@ -131,8 +155,20 @@ class TestQuestionDescription extends Basic
             ['Link', 'Unlink', 'Image', 'Video', 'Flash', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
             ['BulletedList', 'NumberedList', 'HorizontalRule'],
             ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
-            ['Styles', 'Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor'],
-            ['Source', 'Toolbarswitch'],
+            [
+                'Styles',
+                'Format',
+                'Font',
+                'FontSize',
+                'Bold',
+                'Italic',
+                'Underline',
+                'TextColor',
+                'BGColor',
+                api_get_configuration_value('translate_html') ? 'Language' : '',
+            ],
+            ['Toolbarswitch'],
+            ['Source']
         ];
     }
 }