From 94ee9ae0079d00ff824e26dcd224f5e82c848c63 Mon Sep 17 00:00:00 2001 From: Martin Dougiamas Date: Mon, 26 Apr 2010 07:56:23 +0000 Subject: [PATCH] blocks/html MDL-19844 Very minimal fixes to make HTML work. Files still not working properly, see MDL-19844 --- blocks/html/block_html.php | 6 +++++- blocks/html/edit_form.php | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/blocks/html/block_html.php b/blocks/html/block_html.php index 5cfe4fe0db3..19f789e5048 100755 --- a/blocks/html/block_html.php +++ b/blocks/html/block_html.php @@ -33,8 +33,12 @@ class block_html extends block_base { } $this->content = new stdClass; - $this->content->text = isset($this->config->text) ? format_text($this->config->text, FORMAT_HTML, $filteropt) : ''; $this->content->footer = ''; + if (isset($this->config->text)) { + $this->content->text = format_text($this->config->text['text'], $this->config->text['format'], $filteropt); + } else { + $this->content->text = ''; + } unset($filteropt); // memory footprint diff --git a/blocks/html/edit_form.php b/blocks/html/edit_form.php index efc0af221b9..db00638ded3 100644 --- a/blocks/html/edit_form.php +++ b/blocks/html/edit_form.php @@ -37,8 +37,10 @@ class block_html_edit_form extends block_edit_form { $mform->addElement('text', 'config_title', get_string('configtitle', 'block_html')); $mform->setType('config_title', PARAM_MULTILANG); - // TODO MDL-19844 should use the new editor field type. - $mform->addElement('htmleditor', 'config_text', get_string('configcontent', 'block_html')); + // TODO MDL-19844 still needs to be fixed to support files properly + + $editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'trusttext'=>true, 'context'=>$this->block->context); + $mform->addElement('editor', 'config_text', get_string('configcontent', 'block_html'), null, $editoroptions); $mform->setType('config_text', PARAM_RAW); // no XSS prevention here, users must be trusted } -} \ No newline at end of file +}