only adds the Events file from addons which are actually active and refactors the Lv Information into its own component

This commit is contained in:
SimonGschnell
2024-10-28 14:15:45 +01:00
parent b801401d2b
commit fbf0417269
5 changed files with 66 additions and 61 deletions
+10 -1
View File
@@ -47,10 +47,19 @@ class CI3_Events
*/
require_once(APPPATH.'config/Events.php');
$active_addons_array = explode(";", ACTIVE_ADDONS);
foreach (scandir(APPPATH.'config/extensions') as $dir)
if ($dir[0] != '.' && file_exists(APPPATH.'config/extensions/'.$dir.'/Events.php'))
require_once APPPATH.'config/extensions/'.$dir.'/Events.php';
foreach (scandir(FHCPATH.'addons') as $dir)
if ($dir[0] != '.' && file_exists(FHCPATH.'addons/'.$dir.'/Events.php'))
require_once FHCPATH.'addons/'.$dir.'/Events.php';
{
// only includes the Events of the addon if the addon is one of the active addons in the cis config
if(in_array($dir,$active_addons_array))
{
require_once FHCPATH . 'addons/' . $dir . '/Events.php';
}
}