diff --git a/libraries/classes/Display/Export.php b/libraries/classes/Display/Export.php index f0166fb7f1..8d9e3cec2a 100644 --- a/libraries/classes/Display/Export.php +++ b/libraries/classes/Display/Export.php @@ -431,52 +431,29 @@ class Export { global $cfg; if (isset($_GET['compression'])) { - $selected_compression = $_GET['compression']; + $selectedCompression = $_GET['compression']; } elseif (isset($cfg['Export']['compression'])) { - $selected_compression = $cfg['Export']['compression']; + $selectedCompression = $cfg['Export']['compression']; } else { - $selected_compression = "none"; + $selectedCompression = 'none'; } // Since separate files export works with ZIP only if (isset($cfg['Export']['as_separate_files']) && $cfg['Export']['as_separate_files'] ) { - $selected_compression = "zip"; + $selectedCompression = 'zip'; } - $html = ""; // zip and gzip encode features - $is_zip = ($cfg['ZipDump'] && @function_exists('gzcompress')); - $is_gzip = ($cfg['GZipDump'] && @function_exists('gzencode')); - if ($is_zip || $is_gzip) { - $html .= '
  • '; - $html .= ''; - $html .= ''; - $html .= '
  • '; - } else { - $html .= ''; - } + $isZip = ($cfg['ZipDump'] && @function_exists('gzcompress')); + $isGzip = ($cfg['GZipDump'] && @function_exists('gzencode')); - return $html; + return Template::get('display/export/options_output_compression')->render([ + 'is_zip' => $isZip, + 'is_gzip' => $isGzip, + 'selected_compression' => $selectedCompression, + ]); } /** diff --git a/templates/display/export/options_output_compression.twig b/templates/display/export/options_output_compression.twig new file mode 100644 index 0000000000..19059811ca --- /dev/null +++ b/templates/display/export/options_output_compression.twig @@ -0,0 +1,24 @@ +{% if is_zip or is_gzip %} +
  • + + +
  • +{% else %} + +{% endif %}