Skip to content

Commit

Permalink
blocks/html MDL-19844 Very minimal fixes to make HTML work. Files sti…
Browse files Browse the repository at this point in the history
…ll not working properly, see MDL-19844
  • Loading branch information
moodler committed Apr 26, 2010
1 parent 9f6e1e7 commit 94ee9ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion blocks/html/block_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ function get_content() {
}

$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

Expand Down
8 changes: 5 additions & 3 deletions blocks/html/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ protected function specific_definition($mform) {
$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
}
}
}

0 comments on commit 94ee9ae

Please sign in to comment.