Update from 1.11.x

pull/2881/head
Julio Montoya 6 years ago
parent 2fc9bba087
commit 067f5556eb
  1. 1
      main/template/default/social/group_block.html.twig
  2. 1
      src/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  3. 2
      src/CoreBundle/Component/Editor/CkEditor/Toolbar/Forum.php
  4. 135
      src/CoreBundle/Component/Editor/CkEditor/Toolbar/IntroductionSection.php
  5. 40
      src/CoreBundle/Component/Utils/ChamiloApi.php
  6. 4
      src/CourseBundle/Component/CourseCopy/CourseRestorer.php
  7. 2
      src/CourseBundle/Component/CourseCopy/Resources/QuizQuestion.php

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

@ -73,7 +73,7 @@ class Forum extends Basic
['Undo', 'Redo'],
['Link', 'Image', 'Video', 'Oembed', 'Flash', 'Youtube', 'Audio', 'Table', 'Asciimath', 'Asciisvg'],
['BulletedList', 'NumberedList', 'HorizontalRule'],
['JustifyLeft', 'JustifyCenter', 'JustifyBlock'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight'],
['Format', 'Font', 'FontSize', 'Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', 'Source'],
['Toolbarswitch'],
];

@ -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'],
];
}
}

@ -355,4 +355,44 @@ class ChamiloApi
return $localMidnight;
}
/**
* Get JavaScript code necessary to load quiz markers-rolls in medialement's Markers Rolls plugin.
*
* @return string
*/
public static function getQuizMarkersRollsJS()
{
$webCodePath = api_get_path(WEB_CODE_PATH);
$colorPalette = self::getColorPalette(false, true);
return "
var \$originalNode = $(originalNode),
qMarkersRolls = \$originalNode.data('q-markersrolls') || [],
qMarkersColor = \$originalNode.data('q-markersrolls-color') || '{$colorPalette[0]}';
if (0 == qMarkersRolls.length) {
return;
}
instance.options.markersRollsColor = qMarkersColor;
instance.options.markersRollsWidth = 2;
instance.options.markersRolls = {};
qMarkersRolls.forEach(function (qMarkerRoll) {
var url = '{$webCodePath}exercise/exercise_submit.php?{{ _p.web_cid_query }}&'
+ $.param({
exerciseId: qMarkerRoll[1],
learnpath_id: 0,
learnpath_item_id: 0,
learnpath_item_view_id: 0,
origin: 'embeddable'
});
instance.options.markersRolls[qMarkerRoll[0]] = url;
});
instance.buildmarkersrolls(instance, instance.controls, instance.layers, instance.media);
";
}
}

@ -3347,7 +3347,7 @@ class CourseRestorer
$this->destination_course_info['real_id']
);
if (!empty($workData)) {
continue;
break;
}
break;
case FILE_OVERWRITE:
@ -3543,7 +3543,7 @@ class CourseRestorer
) {
switch ($this->file_option) {
case FILE_SKIP:
continue;
break;
case FILE_OVERWRITE:
copy(
$this->course->backup_path.'/'.$asset->path,

@ -110,7 +110,7 @@ class QuizQuestion extends Resource
$courseId = $courseInfo['real_id'];
$courseCode = $courseInfo['code'];
$questionId = $this->source_id;
$question = \Question::read($questionId, $courseId);
$question = \Question::read($questionId, $courseInfo);
$pictureId = $question->getPictureId();
// Add the picture document in the builder
if (!empty($pictureId)) {

Loading…
Cancel
Save