src/Charcoal/Admin/Template/ElfinderTemplate.php
public function elfinderConfigAsJson()
    {
        $property = $this->formProperty();
        $settings = [];

        if ($this->elfinderConfig['client']) {
            $settings = $this->elfinderConfig['client'];
        }

        $settings['lang'] = $this->translator()->getLocale();

        if ($property) {
            $mimeTypes = filter_input(INPUT_GET, 'filetype', FILTER_SANITIZE_STRING);

            if ($mimeTypes) {
                if ($mimeTypes === 'file') {
                    $mimeTypes = [];
                }

                $settings['onlyMimes'] = (array)$mimeTypes;
            } elseif ($property instanceof FileProperty) {
                $settings['onlyMimes'] = $property->acceptedMimetypes();
            }

            $settings['rememberLastDir'] = !($property instanceof FileProperty);
        }

        return json_encode($settings, (JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
    }
public function elfinderConfigAsJson()
    {
        $property = $this->formProperty();
        $settings = [];

        if ($this->elfinderConfig['client']) {
            $settings = $this->elfinderConfig['client'];
        }

        $settings['lang'] = $this->translator()->getLocale();

        if ($property) {
            $mimeTypes = filter_input(INPUT_GET, 'filetype', FILTER_SANITIZE_STRING);

            if ($mimeTypes) {
                if ($mimeTypes === 'file') {
                    $mimeTypes = [];
                }

                $settings['onlyMimes'] = (array)$mimeTypes;
            } elseif ($property instanceof FileProperty) {
                $settings['onlyMimes'] = $property->acceptedMimetypes();
            }

            $settings['rememberLastDir'] = !($property instanceof FileProperty);
        }

        return json_encode($settings, (JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
    }
public function elfinderConfigAsJson ( ) { $ property = $ this -> formProperty ( ) ; $ settings = [ ] ; if ( $ this -> elfinderConfig [ 'client' ] ) { $ settings = $ this -> elfinderConfig [ 'client' ] ; } $ settings [ 'lang' ] = $ this -> translator ( ) -> getLocale ( ) ; if ( $ property ) { $ mimeTypes = filter_input ( INPUT_GET , 'filetype' , FILTER_SANITIZE_STRING ) ; if ( $ mimeTypes ) { if ( $ mimeTypes === 'file' ) { $ mimeTypes = [ ] ; } $ settings [ 'onlyMimes' ] = ( array ) $ mimeTypes ; } elseif ( $ property instanceof FileProperty ) { $ settings [ 'onlyMimes' ] = $ property -> acceptedMimetypes ( ) ; } $ settings [ 'rememberLastDir' ] = ! ( $ property instanceof FileProperty ) ; } return json_encode ( $ settings , ( JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) ) ; }
Retrieve the current property's client-side settings for elFinder.

@return string Returns data serialized with {@see json_encode()}.
Retrieve the current property s client - side settings for elFinder .