BlockManager::getAreasForTheme PHP Method

getAreasForTheme() public method

Gets an array of all areas defined for the current theme.
public getAreasForTheme ( string $theme = null, boolean $keyAsValue = true ) : array
$theme string
$keyAsValue boolean
return array $areas
    public function getAreasForTheme($theme = null, $keyAsValue = true)
    {
        $theme = $theme ? $theme : $this->getTheme();
        if (!$theme) {
            return false;
        }
        $config = $this->config()->get('themes');
        if (!isset($config[$theme]['areas'])) {
            return false;
        }
        $areas = $config[$theme]['areas'];
        $areas = $keyAsValue ? ArrayLib::valuekey(array_keys($areas)) : $areas;
        if (count($areas)) {
            foreach ($areas as $k => $v) {
                $areas[$k] = $keyAsValue ? FormField::name_to_label($k) : $v;
            }
        }
        return $areas;
    }