... when it's a modal
provides modal access to the media manager for insertion of images with upload for users with appropriate permissions.
Provides an input field for files
provides a drop down list of files from a specified directory.
[https://docs.joomla.org/Standard_form_field_types]
##So what's the problem? There is NO way to have a field that allows you to browse ALL the media on the site.
- 1. media is for images only
- 2. file is for upload in a preselected folder only - no browse or select existing files (not available in com_fields)
- 3. filelist is for selecting from a preselected folder only - no upload (not available in com_fields)
##Why does this matter? There is no field that allows you to view the entire Media Manager and all the files that it supports. This prevents you from using fields to create a field such as a file attachment (eg. pdf or zip)
##Why does this happen?
The media field does not access the full media manager - the modal used is opened with the following paramater in the layout index.php?option=com_media&view=images&tmpl=component&
It is hardcoded to only display images in the code (and also in the strings used).
This is a serious limitation of the fields api and the resulting com_fields
##What can be done?
- add a new fieldtype mediafiles which is a clone of the existing media field but for non-images
- or - Completely remove the hardcoded restriction on the media field to only use images
- or - Deprecate the media field and introduce a new field allmedia which provides full access to com_media and every filetype it supports
- or ALL of the above
A quick look shows that we have the code to populate the list of files displayed in list.php - public function getDocuments() we just need to use it in the modal (and presumably update the js as well)