mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +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
|
@ -201,6 +201,28 @@ abstract class texteditor {
|
|||
*/
|
||||
public abstract function supports_repositories();
|
||||
|
||||
/**
|
||||
* @var string $text The text set to the editor in the form.
|
||||
* @since 2.8.8, 2.9.2, 3.0
|
||||
*/
|
||||
protected $text = '';
|
||||
|
||||
/**
|
||||
* Set the text set for this form field. Will be called before "use_editor".
|
||||
* @param string $text The text for the form field.
|
||||
*/
|
||||
public function set_text($text) {
|
||||
$this->text = $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the text set for this form field. Can be called from "use_editor".
|
||||
* @return string
|
||||
*/
|
||||
public function get_text() {
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add required JS needed for editor
|
||||
* @param string $elementid id of text area to be converted to editor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue