From b4a4b389ce0dc3f8cd5000a70d239033a2d131c9 Mon Sep 17 00:00:00 2001 From: Tom Reijnders Date: Mon, 3 Jul 2023 21:44:03 +0200 Subject: [PATCH] Fixed #1231 - Export - offline themes not working correctly and missing files on other exports --- modules/xerte/export.php | 11 ++++++++++- .../Nottingham/common_html5/js/xenith.js | 13 ++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/xerte/export.php b/modules/xerte/export.php index 4965f12b6..ff7a08cbf 100644 --- a/modules/xerte/export.php +++ b/modules/xerte/export.php @@ -240,9 +240,14 @@ function create_offline_file($varname, $sourcefile, $destfile) $offline_includes .= " \n"; - // Offline theme js file + // Offline theme $offline_includes .= " \n"; $offline_includes .= " \n"; + + create_offline_file("themeinfo", "themes/" . $row['parent_template'] . "/" . $xml->getTheme() . "/" . $xml->getTheme() . ".info", "offline/offline_themeinfo.js"); + $offline_includes .= " \n"; + $offline_includes .= " \n"; + $offline_includes .= "\n"; } else { foreach ($models as $model) { @@ -318,6 +323,10 @@ function create_offline_file($varname, $sourcefile, $destfile) export_folder_loop($xerte_toolkits_site->root_file_path . 'themes/' . $row['parent_template'] . '/highcontrast/'); copy_extra_files(); +// Add default theme +export_folder_loop($xerte_toolkits_site->root_file_path . 'themes/' . $row['parent_template'] . '/default/'); +copy_extra_files(); + if ($export_flash) { /* diff --git a/modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js b/modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js index f833cdf71..b8637fbb0 100644 --- a/modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js +++ b/modules/xerte/parent_templates/Nottingham/common_html5/js/xenith.js @@ -758,7 +758,18 @@ function x_getThemeInfo(thisTheme, themeChg) { // these themes should have imgbtns: true in the theme info file if (thisTheme == undefined || thisTheme == "default") { x_params.theme = "default"; - x_setUpThemeBtns({ imgbtns: 'true' }, themeChg); + x_setUpThemeBtns({imgbtns: 'true'}, themeChg); + } else if (xot_offline) { + const temp = themeinfo.split('\n'), + themeInfo = {}; + + for (let i=0; i 1) { + themeInfo[temp[i].split(':')[0]] = temp[i].split(':')[1].trim(); + } + } + + x_setUpThemeBtns(themeInfo, themeChg); } else { $.ajax({