From facf2f2cd4bc3663aa97e45459759b574b1b47c9 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Fri, 15 Sep 2023 15:55:34 +0200 Subject: [PATCH] cleanup css loading --- action.php | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/action.php b/action.php index 7a90b55..1fde3bf 100644 --- a/action.php +++ b/action.php @@ -542,7 +542,7 @@ protected function generatePDF($cachefile, $event) $body_end .= ''; - $mpdf->WriteHTML($body_end, 2, false, true); // finish body html + $mpdf->WriteHTML($body_end, 2, false); // finish body html if ($isDebug) { $html .= $body_end; $html .= ''; @@ -765,6 +765,8 @@ public function replaceDate($match) /** * Load all the style sheets and apply the needed replacements + * + * @return string css styles */ protected function loadCSS() { @@ -794,26 +796,19 @@ protected function loadCSS() $css .= css_loadfile($file, $location); } - if (function_exists('css_parseless')) { - // apply pattern replacements - if (function_exists('css_styleini')) { - // compatiblity layer for pre-Greebo releases of DokuWiki - $styleini = css_styleini($conf['template']); - } else { - // Greebo functionality - $styleUtils = new StyleUtils(); - $styleini = $styleUtils->cssStyleini($conf['template']); // older versions need still the template - } - $css = css_applystyle($css, $styleini['replacements']); - - // parse less - $css = css_parseless($css); + // apply pattern replacements + if (function_exists('css_styleini')) { + // compatiblity layer for pre-Greebo releases of DokuWiki + $styleini = css_styleini($conf['template']); } else { - // @deprecated 2013-12-19: fix backward compatibility - $css = css_applystyle($css, DOKU_INC . 'lib/tpl/' . $conf['template'] . '/'); + // Greebo functionality + $styleUtils = new StyleUtils(); + $styleini = $styleUtils->cssStyleini($conf['template']); // older versions need still the template } + $css = css_applystyle($css, $styleini['replacements']); - return $css; + // parse less + return css_parseless($css); } /**