MDL-19844 Fixed one little glitch on new blocks

This commit is contained in:
Martin Dougiamas 2010-05-03 16:45:56 +00:00
parent 63eee7b4b7
commit 00ab45e7a3

View file

@ -45,7 +45,12 @@ class block_html_edit_form extends block_edit_form {
function set_data($defaults) {
$block = $this->block;
$draftid_editor = file_get_submitted_draft_itemid('config_text');
$block->config->text['text'] = file_prepare_draft_area($draftid_editor, $block->context->id, 'block_html', $block->instance->id, array('subdirs'=>true), $block->config->text['text']);
if (empty($block->config->text['text'])) {
$currenttext = '';
} else {
$currenttext = $block->config->text['text'];
}
$block->config->text['text'] = file_prepare_draft_area($draftid_editor, $block->context->id, 'block_html', $block->instance->id, array('subdirs'=>true), $currenttext);
$block->config->text['itemid'] = $draftid_editor;
parent::set_data($defaults);
}