modxcms/revolution — pull request #11545 by exside (2014-06-19 19:25:29+00:00)
Title: Enhancement propertyset fileinput

This PR adresses https://github.com/modxcms/revolution/issues/11238

With the proposed changes it is possible to define a property field as a file input to select a file from the media browser like it is known from file/image TVs.

Before (Chunk -> Property Sets Edit View):
![bildschirmfoto 2014-06-19 um 20 41 19](https://cloud.githubusercontent.com/assets/445501/3332356/76992264-f7e6-11e3-973f-5ea16edb376d.png)

Before (Chunk -> Property Sets Edit View):
![bildschirmfoto 2014-06-19 um 20 44 49](https://cloud.githubusercontent.com/assets/445501/3332360/8f79b8d4-f7e6-11e3-8694-9d99041fb733.png)

This is possible with the new combo-box entry "File" as can be seen here:
![bildschirmfoto 2014-06-19 um 20 44 35](https://cloud.githubusercontent.com/assets/445501/3332365/9d07c8a6-f7e6-11e3-867f-571ff1b9d5cd.png)

Behavior before changes:
![modx propertyset drop old](https://cloud.githubusercontent.com/assets/445501/3332372/b2cd28d4-f7e6-11e3-8ae0-99837adc95b5.gif)

Bahavior and demo with the proposed changes:
![modx propertyset drop new](https://cloud.githubusercontent.com/assets/445501/3332376/bdaf2ab8-f7e6-11e3-8818-cbfb5c6e1dcc.gif)

This is tested with MODX 2.2.14pl advanced and MODX 2.3dev (git build from 19.6.2014), it works with different media sources as specified in the "default_media_source" system/context setting depending on the context the currently edited resource is in (to which the element is dropped). Also tested with multiple property sets.

I increased the width of the property set combo to be 300px as it cuts of already the default property set name in german for example. Additionally I added a little JS to auto load the property sets combo as it just shows a "0" when initially dropped, this is not very helpful/informative and often confuses clients/editors, so now the real name, e.g. "Default", of the currently displayed property set.

To make this thing work I had to add getValue() methods to the file TV render (also added it to image TV render, as it is basically the same). This method could also be convenient in other scenarios I think...