src/ScContent/Service/Installation/LayoutService.php
public function getRegions($themeName)
    {
        $translator = $this->getTranslator();
        $options = $this->getModuleOptions();
        $theme = $options->getThemeByName($themeName);
        $map = [];

        if (! isset($theme['frontend']['regions'])
            || ! is_array($theme['frontend']['regions'])
            || empty($theme['frontend']['regions'])
        ) {
            return $map;
        }
        $regions = $theme['frontend']['regions'];
        $widgets = array_keys($options->getWidgets());

        foreach ($regions as $regionName => $regionOptions) {
            if (isset($regionOptions['contains'])
                && is_array($regionOptions['contains'])
            ) {
                $container = $regionOptions['contains'];
                foreach ($container as $widget) {
                    $map[$widget] = $regionName;
                }
            }
        }
        foreach ($widgets as $widget) {
            if (! array_key_exists($widget, $map)) {
                $map[$widget] = 'none';
            }
        }
        return $map;
    }
public function getRegions($themeName)
    {
        $translator = $this->getTranslator();
        $options = $this->getModuleOptions();
        $theme = $options->getThemeByName($themeName);
        $map = [];

        if (! isset($theme['frontend']['regions'])
            || ! is_array($theme['frontend']['regions'])
            || empty($theme['frontend']['regions'])
        ) {
            return $map;
        }
        $regions = $theme['frontend']['regions'];
        $widgets = array_keys($options->getWidgets());

        foreach ($regions as $regionName => $regionOptions) {
            if (isset($regionOptions['contains'])
                && is_array($regionOptions['contains'])
            ) {
                $container = $regionOptions['contains'];
                foreach ($container as $widget) {
                    $map[$widget] = $regionName;
                }
            }
        }
        foreach ($widgets as $widget) {
            if (! array_key_exists($widget, $map)) {
                $map[$widget] = 'none';
            }
        }
        return $map;
    }
public function getRegions ( $ themeName ) { $ translator = $ this -> getTranslator ( ) ; $ options = $ this -> getModuleOptions ( ) ; $ theme = $ options -> getThemeByName ( $ themeName ) ; $ map = [ ] ; if ( ! isset ( $ theme [ 'frontend' ] [ 'regions' ] ) || ! is_array ( $ theme [ 'frontend' ] [ 'regions' ] ) || empty ( $ theme [ 'frontend' ] [ 'regions' ] ) ) { return $ map ; } $ regions = $ theme [ 'frontend' ] [ 'regions' ] ; $ widgets = array_keys ( $ options -> getWidgets ( ) ) ; foreach ( $ regions as $ regionName => $ regionOptions ) { if ( isset ( $ regionOptions [ 'contains' ] ) && is_array ( $ regionOptions [ 'contains' ] ) ) { $ container = $ regionOptions [ 'contains' ] ; foreach ( $ container as $ widget ) { $ map [ $ widget ] = $ regionName ; } } } foreach ( $ widgets as $ widget ) { if ( ! array_key_exists ( $ widget , $ map ) ) { $ map [ $ widget ] = 'none' ; } } return $ map ; }
Get the existing regions from the module options.

@param  string $themeName
@return array Regions <code>string[string]</code>
<code>(string) region name [(string) widget name]</code>
Get the existing regions from the module options .