// selectively add uncomplicated optional elements
foreach (array('updated', 'published') as $field) {
if ($this->{$field}) {
- // TODO get the proper date format
- $entry->appendChild($dom->createElement($field, $this->{$field}));
+ $date = date(DATE_ATOM, $this->{$field});
+ $entry->appendChild($dom->createElement($field, $date));
}
}
// deal with referenced files first since it's simple
$leapwriter->add_entry($selection);
$leapwriter->make_selection($selection, $ids, 'Grouping');
$content = $leapwriter->to_xml();
- $name = $this->exporter->get('format')->manifest_name();
+ $name = $this->get('exporter')->get('format')->manifest_name();
}
$this->get('exporter')->write_new_file($content, $name, $manifest);
*/
private function prepare_post_leap2a(portfolio_format_leap2a_writer $leapwriter, $post, $posthtml) {
$entry = new portfolio_format_leap2a_entry('forumpost' . $post->id, $post->subject, 'resource', $posthtml);
+ $entry->published = $post->created;
+ $entry->updated = $post->modified;
+ $entry->author = $post->author;
if (is_array($this->keyedfiles) && array_key_exists($post->id, $this->keyedfiles) && is_array($this->keyedfiles[$post->id])) {
foreach ($this->keyedfiles[$post->id] as $file) {
// copying the file into the package area is handled elsewhere
if (!array_key_exists($post->userid, $users)) {
$users[$post->userid] = $DB->get_record('user', array('id' => $post->userid));
}
+ // add the user object on to the post so we can pass it to the leap writer if necessary
+ $post->author = $users[$post->userid];
$viewfullnames = true;
// format the post body
$options = new object();