mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-51179 Atto: Extend autosave fix to cover text changes
Added new functions to editor api - set/get_text so the original form text can be determined from an editor. When calling use_editor() you should first call set_text() with the text that will be inserted in the form element. There is also a new scheduled task for cleaning Atto autosave drafts.
This commit is contained in:
parent
6f0dfdd969
commit
988592c556
15 changed files with 162 additions and 3 deletions
|
@ -1003,6 +1003,7 @@ function print_textarea($unused, $rows, $cols, $width, $height, $name, $value=''
|
|||
|
||||
editors_head_setup();
|
||||
$editor = editors_get_preferred_editor(FORMAT_HTML);
|
||||
$editor->set_text($value);
|
||||
$editor->use_editor($id, array('legacy'=>true));
|
||||
|
||||
$str .= "\n".'<textarea class="form-textarea" id="'. $id .'" name="'. $name .'" rows="'. $rows .'" cols="'. $cols .'" spellcheck="true">'."\n";
|
||||
|
@ -2378,4 +2379,4 @@ function get_referer($stripquery = true) {
|
|||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue