Skip to content

Commit

Permalink
Fix export of xot template
Browse files Browse the repository at this point in the history
 - error if plugins folder does not exist,
 - wrong parameter order form deployment and archive exports
  • Loading branch information
torinfo committed Mar 5, 2023
1 parent 828ddda commit 3f65216
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions modules/xerte/export.php
Expand Up @@ -445,27 +445,27 @@ function create_offline_file($varname, $sourcefile, $destfile)


// Get plugins
$pluginfiles = scandir($parent_template_path . "plugins/");
$plugins = array();
foreach($pluginfiles as $pluginfile) {
// get base name of plugin
$plugininfo = pathinfo($pluginfile);
if ($plugininfo['basename'] == '.' || $plugininfo['basename'] == '..') {
continue;
}
if (!isset($plugins[$plugininfo['filename']]))
{
$plugins[$plugininfo['filename']] = new stdClass();
}
if ($plugininfo['extension'] == 'js') {
$plugins[$plugininfo['filename']]->script = file_get_contents($parent_template_path . "plugins/" . $pluginfile);
}
if ($plugininfo['extension'] == 'css') {
$plugins[$plugininfo['filename']]->css = file_get_contents($parent_template_path . "plugins/" . $pluginfile);
if (file_exists($parent_template_path . "plugins")) {
$pluginfiles = scandir($parent_template_path . "plugins/");
foreach ($pluginfiles as $pluginfile) {
// get base name of plugin
$plugininfo = pathinfo($pluginfile);
if ($plugininfo['basename'] == '.' || $plugininfo['basename'] == '..') {
continue;
}
if (!isset($plugins[$plugininfo['filename']])) {
$plugins[$plugininfo['filename']] = new stdClass();
}
if ($plugininfo['extension'] == 'js') {
$plugins[$plugininfo['filename']]->script = file_get_contents($parent_template_path . "plugins/" . $pluginfile);
}
if ($plugininfo['extension'] == 'css') {
$plugins[$plugininfo['filename']]->css = file_get_contents($parent_template_path . "plugins/" . $pluginfile);
}
}
}


/*
* Create scorm manifests or a basic HTML page
*/
Expand Down Expand Up @@ -512,7 +512,7 @@ function create_offline_file($varname, $sourcefile, $destfile)
basic_html_page_create($_GET['template_id'], $row['template_name'], $row['template_framework'], $rlo_file, $lo_name);
}
if ($export_html5) {
basic_html5_page_create($_GET['template_id'], $row['template_framework'], $row['parent_template'],$lo_name, $row['date_modified'], $row['date_created'], $tsugi, $export_offline, $offline_includes, $need_download_url, $export_logo, $plugins);
basic_html5_page_create($_GET['template_id'], $row['template_framework'], $row['parent_template'],$lo_name, $row['date_modified'], $row['date_created'], $tsugi, $export_offline, $offline_includes, $need_download_url, $export_logo, '', $plugins);
}
}

Expand Down

0 comments on commit 3f65216

Please sign in to comment.