Skip to content

Commit

Permalink
NOMDL Workshop: File API in mod_form fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Jul 19, 2010
1 parent 82af55d commit 6a0d85a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mod/workshop/mod_form.php
Expand Up @@ -192,27 +192,27 @@ function data_preprocessing(&$data) {
// editing an existing workshop - let us prepare the added editor elements (intro done automatically)
$draftitemid = file_get_submitted_draft_itemid('instructauthors');
$data['instructauthorseditor']['text'] = file_prepare_draft_area($draftitemid, $this->context->id,
'mod_workshop', 'instructauthors', false,
'mod_workshop', 'instructauthors', 0,
workshop::instruction_editors_options($this->context),
$data['instructauthors']);
$data['instructauthorseditor']['format'] = $data['instructauthorsformat'];
$data['instructauthorseditor']['itemid'] = $draftitemid;

$draftitemid = file_get_submitted_draft_itemid('instructreviewers');
$data['instructreviewerseditor']['text'] = file_prepare_draft_area($draftitemid, $this->context->id,
'mod_workshop', 'instructreviewers', false,
'mod_workshop', 'instructreviewers', 0,
workshop::instruction_editors_options($this->context),
$data['instructreviewers']);
$data['instructreviewerseditor']['format'] = $data['instructreviewersformat'];
$data['instructreviewerseditor']['itemid'] = $draftitemid;
} else {
// adding a new workshop instance
$draftitemid = file_get_submitted_draft_itemid('instructauthors');
file_prepare_draft_area($draftitemid, null, null, null); // no context, no filearea yet
file_prepare_draft_area($draftitemid, null, 'mod_workshop', 'instructauthors', 0); // no context yet, itemid not used
$data['instructauthorseditor'] = array('text' => '', 'format' => FORMAT_HTML, 'itemid' => $draftitemid);

$draftitemid = file_get_submitted_draft_itemid('instructreviewers');
file_prepare_draft_area($draftitemid, null, null, null); // no context, no filearea yet
file_prepare_draft_area($draftitemid, null, 'mod_workshop', 'instructreviewers', 0); // no context yet, itemid not used
$data['instructreviewerseditor'] = array('text' => '', 'format' => FORMAT_HTML, 'itemid' => $draftitemid);
}
}
Expand Down

0 comments on commit 6a0d85a

Please sign in to comment.