mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
extract data-preparation from Etemplate\Widget\Vfs::beforeSendToClient() to use it to send the data to client-side in an AJAX call
This commit is contained in:
parent
1c053ade4c
commit
10d61dd4c7
@ -71,8 +71,21 @@ class Vfs extends File
|
|||||||
$path = Api\Link::vfs_path($app, $id, '', true);
|
$path = Api\Link::vfs_path($app, $id, '', true);
|
||||||
if (!empty($relpath)) $path .= '/' . $relpath;
|
if (!empty($relpath)) $path .= '/' . $relpath;
|
||||||
|
|
||||||
if (true) $value = array();
|
$value = self::findAttachments($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all attachments, can be used to prepare the data for the widget on client-side
|
||||||
|
*
|
||||||
|
* @param string $path eg. "/apps/$app/$id/$rel_path"
|
||||||
|
* @return array
|
||||||
|
* @throws Api\Exception\AssertionFailed
|
||||||
|
*/
|
||||||
|
public static function findAttachments($path)
|
||||||
|
{
|
||||||
|
$value = [];
|
||||||
// Single file, already existing
|
// Single file, already existing
|
||||||
if (substr($path,-1) != '/' && Api\Vfs::file_exists($path) && !Api\Vfs::is_dir($path))
|
if (substr($path,-1) != '/' && Api\Vfs::file_exists($path) && !Api\Vfs::is_dir($path))
|
||||||
{
|
{
|
||||||
@ -114,8 +127,7 @@ class Vfs extends File
|
|||||||
$value[] = $file_info;
|
$value[] = $file_info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return $value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function ajax_upload()
|
public static function ajax_upload()
|
||||||
|
Loading…
Reference in New Issue
Block a user