Commit 33e99561 authored by Johan Cwiklinski's avatar Johan Cwiklinski

Factorize, log message if file has not been found; fixes #3843

parent 4bc1e15b
......@@ -5748,15 +5748,14 @@ class Html {
foreach ($PLUGIN_HOOKS["add_javascript"] as $plugin => $files) {
$version = Plugin::getInfo($plugin, 'version');
if (is_array($files)) {
foreach ($files as $file) {
if (file_exists(GLPI_ROOT."/plugins/$plugin/$file")) {
echo Html::script("plugins/$plugin/$file", ['version' => $version]);
}
}
} else {
if (file_exists(GLPI_ROOT."/plugins/$plugin/$files")) {
echo Html::script("plugins/$plugin/$files", ['version' => $version]);
if (!is_array($files)) {
$files = [$files];
}
foreach ($files as $file) {
if (file_exists(GLPI_ROOT."/plugins/$plugin/$file")) {
echo Html::script("plugins/$plugin/$file", ['version' => $version]);
} else {
Toolbox::logDebug("$file file not found from plugin $plugin!");
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment