Skip to content

Commit

Permalink
Partly fix for #1194 - critical error in develop after latest changes
Browse files Browse the repository at this point in the history
 - Check if plugins folder exists

The other part of this issue is fixed by RonM
  • Loading branch information
torinfo committed Feb 22, 2023
1 parent 5e721af commit 2d7ffec
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions modules/xerte/play.php
Expand Up @@ -122,23 +122,24 @@ function show_template_page($row, $datafile="", $xapi_enabled = false)
}

// Get plugins
$pluginfiles = scandir($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($template_path . "plugins/" . $pluginfile);
}
if ($plugininfo['extension'] == 'css') {
$plugins[$plugininfo['filename']]->css = file_get_contents($template_path . "plugins/" . $pluginfile);
if (file_exists($template_path . "plugins")) {
$pluginfiles = scandir($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($template_path . "plugins/" . $pluginfile);
}
if ($plugininfo['extension'] == 'css') {
$plugins[$plugininfo['filename']]->css = file_get_contents($template_path . "plugins/" . $pluginfile);
}
}
}
$rlo_object_file = "rloObject.htm";
Expand Down

0 comments on commit 2d7ffec

Please sign in to comment.