public function exportValue(&$submitted, $assoc = false) {

        $value = '';
        $filetypeselement = null;

        foreach ($this->_elements as $key => $element) {
            if ($element->_attributes['name'] === 'filetypes') {
                $filetypeselement = $this->_elements[$key];
            }
        }

        if ($filetypeselement) {
            $formval = $filetypeselement->exportValue($submitted[$this->getName()], false);
            if ($formval) {
                $value = $this->util->normalize_file_types($formval);
                if ($value === ['*'] && !$this->allowall) {
                    $value = [];
                }
                $value = implode(',', $value);
            }
        }

        return $this->_prepareValue($value, $assoc);
    }
public function exportValue(&$submitted, $assoc = false) {

        $value = '';
        $filetypeselement = null;

        foreach ($this->_elements as $key => $element) {
            if ($element->_attributes['name'] === 'filetypes') {
                $filetypeselement = $this->_elements[$key];
            }
        }

        if ($filetypeselement) {
            $formval = $filetypeselement->exportValue($submitted[$this->getName()], false);
            if ($formval) {
                $value = $this->util->normalize_file_types($formval);
                if ($value === ['*'] && !$this->allowall) {
                    $value = [];
                }
                $value = implode(',', $value);
            }
        }

        return $this->_prepareValue($value, $assoc);
    }
public function exportValue ( & $ submitted , $ assoc = false ) { $ value = '' ; $ filetypeselement = null ; foreach ( $ this -> _elements as $ key => $ element ) { if ( $ element -> _attributes [ 'name' ] === 'filetypes' ) { $ filetypeselement = $ this -> _elements [ $ key ] ; } } if ( $ filetypeselement ) { $ formval = $ filetypeselement -> exportValue ( $ submitted [ $ this -> getName ( ) ] , false ) ; if ( $ formval ) { $ value = $ this -> util -> normalize_file_types ( $ formval ) ; if ( $ value === [ '*' ] && ! $ this -> allowall ) { $ value = [ ] ; } $ value = implode ( ',' , $ value ) ; } } return $ this -> _prepareValue ( $ value , $ assoc ) ; }
Return the selected file types.

@param array $submitted submitted values
@param bool $assoc if true the retured value is associated array
@return array
Return the selected file types .