Newscoop\Service\Implementation\ThemeManagementServiceLocal::filterThemesConfigPathsInSameFolder PHP Method

filterThemesConfigPathsInSameFolder() protected method

For instance if the config is in a publication folder than this method will return all the configs for that publicatio.
protected filterThemesConfigPathsInSameFolder ( string $config, array $allConfigs ) : array
$config string The config path to be searched for, not null.
$allConfigs array
return array The array containing as key the id of the theme config (index) and as a value the relative path of the theme configuration XML file for all configurations that are iun the same folder, not null can be empty.
    protected function filterThemesConfigPathsInSameFolder($config, array $allConfigs)
    {
        // First we extract the relative path for the 'theme.xml' config file
        $rPath = $this->extractRelativePathFrom($config);
        // Now we extract the relative path of the theme folder.
        $rPath = $this->extractRelativePathFrom(substr($rPath, 0, -1));
        $inFolder = array();
        $length = strlen($rPath);
        foreach ($allConfigs as $id => $cnf) {
            if (strncmp($cnf, $rPath, $length) == 0) {
                $inFolder[$id] = $cnf;
            }
        }
        return $inFolder;
    }