From 0dfcee2d2db425b8d28f57db1a2159448951b01f Mon Sep 17 00:00:00 2001 From: Ron Lucke Date: Wed, 11 Mar 2026 10:24:46 +0100 Subject: pdf export --- lib/models/Courseware/StructuralElement.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/models/Courseware/StructuralElement.php b/lib/models/Courseware/StructuralElement.php index 4bbaad8..d4d5b72 100644 --- a/lib/models/Courseware/StructuralElement.php +++ b/lib/models/Courseware/StructuralElement.php @@ -1166,10 +1166,17 @@ SQL; if (!$this->canVisit($user)) { return ''; } + + $element = $this; + + if ($this->is_link) { + $element = $this->find($this->target_id); + } + $doc->addPage(); - $doc->Bookmark($this->title, $depth, 0, '', '', array(128,0,0)); - $html = "

" . htmlReady($this->title) . "

"; - $html .= $this->getContainerPdfExport(); + $doc->Bookmark($element->title, $depth, 0, '', '', array(128,0,0)); + $html = "

" . htmlReady($element->title) . "

"; + $html .= $element->getContainerPdfExport(); $doc->writeHTML($html); if ($with_children) { -- cgit v1.0