Skip to content

Commit

Permalink
cleanup css loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Klap-in committed Sep 15, 2023
1 parent f4acdfe commit facf2f2
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ protected function generatePDF($cachefile, $event)

$body_end .= '</div>';

$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 .= '</body>';
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit facf2f2

Please sign in to comment.