MDL-61674 usertours: Allow rich text (atto) editing of step content

This commit is contained in:
Nadav Kavalerchik
2021-10-13 10:23:57 +02:00
committed by Amaia Anabitarte
parent 9145d80b0b
commit de978747a8
8 changed files with 124 additions and 9 deletions
+9 -2
View File
@@ -26,6 +26,8 @@ namespace tool_usertours\output;
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . "/filelib.php");
use tool_usertours\step as stepsource;
/**
@@ -60,6 +62,11 @@ class step implements \renderable {
global $PAGE;
$step = $this->step;
$content = $step->get_content();
$systemcontext = \context_system::instance();
$content = file_rewrite_pluginfile_urls($content, 'pluginfile.php', $systemcontext->id,
'tool_usertours', 'stepcontent', $step->get_id());
$result = (object) [
'stepid' => $step->get_id(),
'title' => external_format_text(
@@ -69,8 +76,8 @@ class step implements \renderable {
'tool_usertours'
)[0],
'content' => external_format_text(
stepsource::get_string_from_input($step->get_content()),
FORMAT_HTML,
stepsource::get_string_from_input($content),
$step->get_contentformat(),
$PAGE->context->id,
'tool_usertours'
)[0],