concrete/src/Application/Service/FileManager.php
private function fileOfType($type, $inputID, $inputName, $chooseText, $preselectedFile = null, $args = [])
    {
        if (!is_array($args)) {
            $args = [];
        }
        if (!isset($args['filters']) || !is_array($args['filters'])) {
            $args['filters'] = [];
        }
        $args['filters'] = array_merge(
            [
                [
                    'field' => 'type',
                    'type' => (int) $type,
                ],
            ],
            $args['filters']
        );

        return $this->file($inputID, $inputName, $chooseText, $preselectedFile, $args);
    }
private function fileOfType($type, $inputID, $inputName, $chooseText, $preselectedFile = null, $args = [])
    {
        if (!is_array($args)) {
            $args = [];
        }
        if (!isset($args['filters']) || !is_array($args['filters'])) {
            $args['filters'] = [];
        }
        $args['filters'] = array_merge(
            [
                [
                    'field' => 'type',
                    'type' => (int) $type,
                ],
            ],
            $args['filters']
        );

        return $this->file($inputID, $inputName, $chooseText, $preselectedFile, $args);
    }
private function fileOfType ( $ type , $ inputID , $ inputName , $ chooseText , $ preselectedFile = null , $ args = [ ] ) { if ( ! is_array ( $ args ) ) { $ args = [ ] ; } if ( ! isset ( $ args [ 'filters' ] ) || ! is_array ( $ args [ 'filters' ] ) ) { $ args [ 'filters' ] = [ ] ; } $ args [ 'filters' ] = array_merge ( [ [ 'field' => 'type' , 'type' => ( int ) $ type , ] , ] , $ args [ 'filters' ] ) ; return $ this -> file ( $ inputID , $ inputName , $ chooseText , $ preselectedFile , $ args ) ; }
Sets up a form field to let users pick a file of a specific type.

@param int $type One of the \Concrete\Core\File\Type\Type::T_... constants.
@param string $inputID The ID of your form field
@param string $inputName The name of the form field (the selected file ID will be posted with this name)
@param string $chooseText The text to be used to tell users "Choose a File"
@param \Concrete\Core\Entity\File\File|\Concrete\Core\Entity\File\Version|int|null $preselectedFile the pre-selected file (or its ID)
@param array $args See the $args description of the <code>file</code> method

@return string

@see \Concrete\Core\Application\Service\FileManager::file()
Sets up a form field to let users pick a file of a specific type .