protected function keepPluginsOrThemes($themesOnly, $plugins)
{
$pluginsFiltered = array();
foreach ($plugins as $name => $thisPlugin) {
$isTheme = false;
if (!empty($thisPlugin['info']['theme'])) {
$isTheme = (bool) $thisPlugin['info']['theme'];
}
if ($themesOnly && $isTheme || !$themesOnly && !$isTheme) {
$pluginsFiltered[$name] = $thisPlugin;
}
}
return $pluginsFiltered;
}