src/Filter/Setting/Simple.php
protected function prepareFrontendFilterOptions($arrWidget, $arrFilterUrl, $arrJumpTo, $blnAutoSubmit)
    {
        $arrOptions = array();
        if (!isset($arrWidget['options'])) {
            return $arrOptions;
        }

        $filterUrl = new FilterUrl($arrJumpTo);
        foreach ($arrFilterUrl as $name => $value) {
            if (is_array($value)) {
                $value = implode(',', array_filter($value));
            }

            $filterUrl->setSlug($name, (string) $value);
        }
        $parameterName = $arrWidget['eval']['urlparam'];

        if ($arrWidget['eval']['includeBlankOption']) {
            $blnActive = $this->isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, '');

            $arrOptions[] = array
            (
                'key'    => '',
                'value'  => (
                $arrWidget['eval']['blankOptionLabel']
                    ? $arrWidget['eval']['blankOptionLabel']
                    : $GLOBALS['TL_LANG']['metamodels_frontendfilter']['do_not_filter']
                ),
                'href'   => $this->filterUrlBuilder->generate($filterUrl->clone()->setSlug($parameterName, '')),
                'active' => $blnActive,
                'class'  => 'doNotFilter'.($blnActive ? ' active' : ''),
            );
        }

        foreach ($arrWidget['options'] as $strKeyOption => $strOption) {
            $strValue  = $this->getFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption);
            $blnActive = $this->isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption);

            $arrOptions[] = array
            (
                'key'    => $strKeyOption,
                'value'  => $strOption,
                'href'   => $this->filterUrlBuilder->generate($filterUrl->clone()->setSlug($parameterName, $strValue)),
                'active' => $blnActive,
                'class'  => StringUtil::standardize($strKeyOption) . ($blnActive ? ' active' : '')
            );
        }
        return $arrOptions;
    }
protected function prepareFrontendFilterOptions($arrWidget, $arrFilterUrl, $arrJumpTo, $blnAutoSubmit)
    {
        $arrOptions = array();
        if (!isset($arrWidget['options'])) {
            return $arrOptions;
        }

        $filterUrl = new FilterUrl($arrJumpTo);
        foreach ($arrFilterUrl as $name => $value) {
            if (is_array($value)) {
                $value = implode(',', array_filter($value));
            }

            $filterUrl->setSlug($name, (string) $value);
        }
        $parameterName = $arrWidget['eval']['urlparam'];

        if ($arrWidget['eval']['includeBlankOption']) {
            $blnActive = $this->isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, '');

            $arrOptions[] = array
            (
                'key'    => '',
                'value'  => (
                $arrWidget['eval']['blankOptionLabel']
                    ? $arrWidget['eval']['blankOptionLabel']
                    : $GLOBALS['TL_LANG']['metamodels_frontendfilter']['do_not_filter']
                ),
                'href'   => $this->filterUrlBuilder->generate($filterUrl->clone()->setSlug($parameterName, '')),
                'active' => $blnActive,
                'class'  => 'doNotFilter'.($blnActive ? ' active' : ''),
            );
        }

        foreach ($arrWidget['options'] as $strKeyOption => $strOption) {
            $strValue  = $this->getFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption);
            $blnActive = $this->isActiveFrontendFilterValue($arrWidget, $arrFilterUrl, $strKeyOption);

            $arrOptions[] = array
            (
                'key'    => $strKeyOption,
                'value'  => $strOption,
                'href'   => $this->filterUrlBuilder->generate($filterUrl->clone()->setSlug($parameterName, $strValue)),
                'active' => $blnActive,
                'class'  => StringUtil::standardize($strKeyOption) . ($blnActive ? ' active' : '')
            );
        }
        return $arrOptions;
    }
Generate the options for the frontend widget as the frontend templates expect them.

The returning array will be made of option arrays containing the following fields:
* key    The option value as raw key from the options array in the given widget information.
* value  The value to show as option label.
* href   The URL to use to activate this value in the filter.
* active Boolean determining if this value is the current active option in the widget.
* class  The CSS class to use. Contains active if the option is active or is empty otherwise.

@param array $arrWidget     The widget information to use for value generating.

@param array $arrFilterUrl  The filter url parameters to use.

@param array $arrJumpTo     The jumpTo page to use for URL generating - if empty, the current
frontend page will get used.

@param bool  $blnAutoSubmit Determines if the generated options/widgets shall perform auto submitting
or not.

@return array The filter option values to use in the mm_filteritem_* templates.

@SuppressWarnings(PHPMD.UnusedFormalParameter)
@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
@SuppressWarnings(PHPMD.CyclomaticComplexity)
@SuppressWarnings(PHPMD.NPathComplexity)