allow to additionally use just a name for which content array contains a path to upload pictures

This commit is contained in:
Ralf Becker 2017-01-31 10:05:13 +01:00
parent 28febe25f7
commit 1cafbd14cb
2 changed files with 4 additions and 3 deletions

View File

@ -49,7 +49,7 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2
'type':'boolean',
'description': 'Have the toolbar expanded (visible)'
},
'base_href': {
'base_href': { // seems not to be used anymore
'name': 'Image base path',
'default': et2_no_init,
'type': 'string',
@ -71,7 +71,7 @@ var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2
},
imageUpload: {
name: "imageUpload",
description: "Url to upload images dragged in or id of link_to widget to it's vfs upload",
description: "Url to upload images dragged in or id of link_to widget to it's vfs upload. Can also be just a name for which content array contains a path to upload the picture.",
type: "string",
default: null
}

View File

@ -143,7 +143,8 @@ class Vfs extends File
else
{
$data = self::$request->content[$widget_id];
$path = self::store_file($path = self::get_vfs_path($data['to_app'].':'.$data['to_id']).'/', $_FILES['upload']);
$path = self::store_file($path = (!is_array($data) && $data[0] == '/' ? $data :
self::get_vfs_path($data['to_app'].':'.$data['to_id'])).'/', $_FILES['upload']);
// store temp. vfs-path like links to be able to move it to correct location after entry is stored
if (!$data['to_id'] || is_array($data['to_id']))