Skip to content

Commit

Permalink
Fixed #1231 - Export - offline themes not working correctly and missi…
Browse files Browse the repository at this point in the history
…ng files on other exports
  • Loading branch information
torinfo committed Jul 3, 2023
1 parent b161d61 commit 4720d36
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
11 changes: 10 additions & 1 deletion modules/xerte/export.php
Expand Up @@ -240,9 +240,14 @@ function create_offline_file($varname, $sourcefile, $destfile)
$offline_includes .= " <script type=\"text/javascript\" src=\"common_html5/js/timeline/timeline3.js\"></script>\n";


// Offline theme js file
// Offline theme
$offline_includes .= " <!-- theme file, normally loaded dynamically -->\n";
$offline_includes .= " <script type=\"text/javascript\" src=\"themes/" . $row['parent_template'] . "/" . $xml->getTheme() . "/" . $xml->getTheme() . ".js\"></script>\n";

create_offline_file("themeinfo", "themes/" . $row['parent_template'] . "/" . $xml->getTheme() . "/" . $xml->getTheme() . ".info", "offline/offline_themeinfo.js");
$offline_includes .= " <!-- Offline theme info -->\n";
$offline_includes .= " <script type=\"text/javascript\" src=\"offline/offline_themeinfo.js\"></script>\n";
$offline_includes .= "\n";
}
else {
foreach ($models as $model) {
Expand Down Expand Up @@ -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) {
/*
Expand Down
Expand Up @@ -758,8 +758,19 @@ 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<temp.length; i++) {
if (temp[i].split(':').length > 1) {
themeInfo[temp[i].split(':')[0]] = temp[i].split(':')[1].trim();
}
}

x_setUpThemeBtns(themeInfo, themeChg);

} else {
$.ajax({
type: "GET",
Expand Down

0 comments on commit 4720d36

Please sign in to comment.