Fix: Loading of boxes from external modules

This commit is contained in:
Laurent Destailleur 2013-06-03 11:33:13 +02:00
parent 6cf1d25529
commit 4b3413c84c

View File

@ -87,7 +87,7 @@ class InfoBox
{ {
if (preg_match('/^([^@]+)@([^@]+)$/i',$obj->file,$regs)) if (preg_match('/^([^@]+)@([^@]+)$/i',$obj->file,$regs))
{ {
$boxname = $regs[1]; $boxname = preg_replace('/.php$/i','',$regs[1]);
$module = $regs[2]; $module = $regs[2];
$relsourcefile = "/".$module."/core/boxes/".$boxname.".php"; $relsourcefile = "/".$module."/core/boxes/".$boxname.".php";
} }
@ -135,7 +135,8 @@ class InfoBox
foreach($box->depends as $module) foreach($box->depends as $module)
{ {
//print $boxname.'-'.$module.'<br>'; //print $boxname.'-'.$module.'<br>';
if (empty($conf->$module->enabled)) $enabled=0; $tmpmodule=preg_replace('/@[^@]+/','',$module);
if (empty($conf->$tmpmodule->enabled)) $enabled=0;
} }
} }