User tests: Successful: Unsuccessful:
The Media field form type was extended with two attributes and a new functionality:
component - The component can be defined from which the default image path is retrieved.
Example: component="com_example"
The default image path can then be defined in the manifest file of the extension. The name value to use is image_path.
mode - If the mode is strict and the user does not have upload rights, then a notice instead of the select button is loaded. This is useful to limit the access of the user only for a specific folder if he has upload rights (new com_media has to be modified to check for the used mode).
Example: mode="strict"
Placeholders for upload path
The path in the directory parameter can now contain the following placeholders:
{PLACEHOLDER}
username - The user name of the logged-in user.
userid - The ID of the logged-in user.
date() format characters - Default value transformation (see list here: http://php.net/manual/en/function.date.php)
Example: {username}, {userid}, {Y} or {Ymd}
Complete example:
<field name="image-upload" type="media" directory="{d}-{m}-{Y}/{username}-{userid}" component="com_example" mode="strict" />
In this example the upload path would consist of the date (day-month-year) and the username plus id (user-42). The default image path will be loaded from com_example (if available, else com_media) and the mode is set to strict which means that users without upload permission right will not be possible to load the modal window.
Small changed behavior: If the the selected folder does not exist, then this folder ist still used and not the root folder. This is necessary with the addtion of placeholders which create dynamic paths.
| Status | New | ⇒ | Pending |
| Labels |
Added:
?
?
|
||
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-12-09 13:33:50 |
| Closed_By | ⇒ | roland-d |
TODO