addListener('hook_civicrm_themes', function ($e) use ($mixInfo) { // When deactivating on a polyfill/pre-mixin system, listeners may not cleanup automatically. if (!$mixInfo->isActive()) { return; } $files = (array) glob($mixInfo->getPath('*.theme.php')); foreach ($files as $file) { $themeMeta = include $file; if (empty($themeMeta['name'])) { $themeMeta['name'] = preg_replace(':\.theme\.php$:', '', basename($file)); } if (empty($themeMeta['ext'])) { $themeMeta['ext'] = $mixInfo->longName; } $e->themes[$themeMeta['name']] = $themeMeta; } }); };