Api - Allow sharing to use Collabora to open files instead of downloading

This commit is contained in:
nathangray 2018-03-07 11:29:00 -07:00
parent 3891cb4064
commit 223b55d631

View File

@ -331,6 +331,19 @@ class Sharing
!file_exists(__DIR__.'/../../../filemanager/inc/class.filemanager_ui.inc.php'));
}
/**
* Check if we should use Collabora UI
*
* Only for files, if URL says so, and Collabora & Stylite apps are installed
*/
public function use_collabora()
{
return !Vfs::is_dir($this->share['share_root']) &&
array_key_exists('edit', $_REQUEST) &&
array_key_exists('collabora', $GLOBALS['egw_info']['apps']) &&
array_key_exists('stylite', $GLOBALS['egw_info']['apps']);
}
/**
* Server a request on a share specified in REQUEST_URI
*/
@ -352,8 +365,13 @@ class Sharing
$this->share['share_path'] => 1
));
}
if($this->use_collabora())
{
$ui = new \EGroupware\Collabora\Ui();
return $ui->editor($this->share['share_path']);
}
// use pure WebDAV for everything but GET requests to directories
if (!$this->use_filemanager())
else if (!$this->use_filemanager())
{
// send a content-disposition header, so browser knows how to name downloaded file
if (!Vfs::is_dir($this->share['share_root']))