Merge branch 'MDL-75909-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE

This commit is contained in:
Jun Pataleta
2022-10-10 18:08:20 +08:00
+6 -4
View File
@@ -178,8 +178,10 @@ if (($mode === 'csstemplate') || ($mode === 'jstemplate')) {
$usehtmleditor = data_get_config($data, "editor_{$mode}", true);
}
$datafieldtype = '';
if ($usehtmleditor) {
$format = FORMAT_HTML;
$datafieldtype = ' data-fieldtype="editor" ';
} else {
$format = FORMAT_PLAIN;
}
@@ -221,7 +223,7 @@ if ($mode == 'listtemplate'){
$field = 'listtemplateheader';
$editor->set_text($data->listtemplateheader);
$editor->use_editor($field, $options);
echo '<div><textarea id="'.$field.'" name="'.$field.'" class="form-control" rows="15" cols="80">' .
echo "<div><textarea id='{$field}' {$datafieldtype} name='{$field}' class='form-control' rows='15' cols='80'>" .
s($data->listtemplateheader) . '</textarea></div>';
echo '</td>';
@@ -321,7 +323,7 @@ $field = 'template';
$editor->set_text($data->{$mode});
$editor->use_editor($field, $options);
echo '<div>';
echo '<textarea class="form-control" id="' . $field . '" ' .
echo '<textarea class="form-control" id="' . $field . '" ' . $datafieldtype .
'name="' . $field . '" rows="15" cols="80">' . s($data->{$mode}) . '</textarea>';
echo '</div>';
echo '</td>';
@@ -337,7 +339,7 @@ if ($mode == 'listtemplate'){
$editor->set_text($data->listtemplatefooter);
$editor->use_editor($field, $options);
echo '<div>';
echo '<textarea id="' . $field . '" class="form-control" ' .
echo '<textarea id="' . $field . '" class="form-control" ' . $datafieldtype .
'name="' . $field . '" rows="15" cols="80">' . s($data->listtemplatefooter) . '</textarea>';
echo '</div>';
echo '</td>';
@@ -354,7 +356,7 @@ if ($mode == 'listtemplate'){
$editor->set_text($data->rsstitletemplate);
$editor->use_editor($field, $options);
echo '<div>';
echo '<textarea id="' . $field . '" name="' . $field . '" ' .
echo '<textarea id="' . $field . '" name="' . $field . '" ' . $datafieldtype .
'class="form-control" rows="15" cols="80">' . s($data->rsstitletemplate) . '</textarea>';
echo '</div>';
echo '</td>';