Skip to content

Commit

Permalink
Fix export function
Browse files Browse the repository at this point in the history
  • Loading branch information
gvollbach committed Sep 26, 2023
1 parent e9f6206 commit 3467b31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Modules/Forum/classes/class.ilForumExportGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ public function exportHTML(): void
'thread_ids',
$this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
);
} else {
$obj_id = $this->ilObjDataCache->lookupObjId($this->ref_id);
$topics = ilForum::getSortedThreadSubjects($obj_id);
if(count($topics) > 0) {
$thread_ids = array_keys($topics);
}
}
array_walk($thread_ids, function (int $threadId) use (&$threads, $isModerator): void {
$thread = new ilForumTopic($threadId, $isModerator);
Expand Down
10 changes: 10 additions & 0 deletions Modules/Forum/classes/class.ilObjForumGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,16 @@ public function executeCommand(): void
$this->tabs_gui->activateTab('export');
$exp = new ilExportGUI($this);
$exp->addFormat('xml');
$exp->addFormat('html');
if($cmd === 'createExportFile') {
if($this->http->wrapper()->post()->has('format')) {
$format = $this->http->wrapper()->post()->retrieve('format', $this->refinery->kindlyTo()->string());
if($format === 'html') {
$fex_gui = new ilForumExportGUI();
$fex_gui->exportHTML();
}
}
}
$this->ctrl->forwardCommand($exp);
break;

Expand Down

0 comments on commit 3467b31

Please sign in to comment.