mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Bug #6097 - HTML editor and brackets - fixes lesson problems; merged from MOODLE_16_STABLE
This commit is contained in:
parent
9f76a845ff
commit
250f78be94
1 changed files with 5 additions and 4 deletions
|
@ -3314,16 +3314,17 @@ function print_richedit_javascript($form, $name, $source='no') {
|
||||||
* @param string $name Form element to replace with HTMl editor by name
|
* @param string $name Form element to replace with HTMl editor by name
|
||||||
*/
|
*/
|
||||||
function use_html_editor($name='', $editorhidebuttons='') {
|
function use_html_editor($name='', $editorhidebuttons='') {
|
||||||
|
$editor = 'editor_'.md5($name); //name might contain illegal characters
|
||||||
echo '<script language="javascript" type="text/javascript" defer="defer">'."\n";
|
echo '<script language="javascript" type="text/javascript" defer="defer">'."\n";
|
||||||
echo "edit_$name = new HTMLArea('edit-$name');\n";
|
echo "$editor = new HTMLArea('edit-$name');\n";
|
||||||
echo "var config = edit_$name.config;\n";
|
echo "var config = $editor.config;\n";
|
||||||
|
|
||||||
echo print_editor_config($editorhidebuttons);
|
echo print_editor_config($editorhidebuttons);
|
||||||
|
|
||||||
if (empty($name)) {
|
if (empty($name)) {
|
||||||
echo "\nHTMLArea.replaceAll(edit_$name.config);\n";
|
echo "\nHTMLArea.replaceAll($editor.config);\n";
|
||||||
} else {
|
} else {
|
||||||
echo "\nedit_$name.generate();\n";
|
echo "\n$editor.generate();\n";
|
||||||
}
|
}
|
||||||
echo '</script>'."\n";
|
echo '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue