mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Break out merge share creation so it can be overridden
This commit is contained in:
parent
2d644d930e
commit
66d6a6c883
@ -485,26 +485,7 @@ abstract class Merge
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get or create the share
|
// Get or create the share
|
||||||
// Check if some other process created the share (with custom options)
|
$share = $this->create_share($app, $id, $content);
|
||||||
// and put it in the session cache for us
|
|
||||||
$path = "$app::$id";
|
|
||||||
$session = \EGroupware\Api\Cache::getSession(Api\Sharing::class, $path);
|
|
||||||
if($session && $session['share_path'] == $path)
|
|
||||||
{
|
|
||||||
$share = $session;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Need to create the share here.
|
|
||||||
// No way to know here if it should be writable, or who it's going to
|
|
||||||
$mode = /* ? ? Sharing::WRITABLE :*/ Api\Sharing::READONLY;
|
|
||||||
$recipients = array();
|
|
||||||
$extra = array();
|
|
||||||
|
|
||||||
//$extra['share_writable'] |= ($mode == Sharing::WRITABLE ? 1 : 0);
|
|
||||||
|
|
||||||
$share = \EGroupware\Stylite\Link\Sharing::create($path, $mode, NULL, $recipients, $extra);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($share)
|
if($share)
|
||||||
{
|
{
|
||||||
@ -514,6 +495,37 @@ abstract class Merge
|
|||||||
return $replacements;
|
return $replacements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a share for an entry
|
||||||
|
*
|
||||||
|
* @param string $app
|
||||||
|
* @param string $id
|
||||||
|
* @param string $path
|
||||||
|
* @param type $content
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
|
protected function create_share($app, $id, &$content)
|
||||||
|
{
|
||||||
|
// Check if some other process created the share (with custom options)
|
||||||
|
// and put it in the session cache for us
|
||||||
|
$path = "$app::$id";
|
||||||
|
$session = \EGroupware\Api\Cache::getSession(Api\Sharing::class, $path);
|
||||||
|
if($session && $session['share_path'] == $path)
|
||||||
|
{
|
||||||
|
return $session;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Need to create the share here.
|
||||||
|
// No way to know here if it should be writable, or who it's going to
|
||||||
|
$mode = /* ? ? Sharing::WRITABLE :*/ Api\Sharing::READONLY;
|
||||||
|
$recipients = array();
|
||||||
|
$extra = array();
|
||||||
|
|
||||||
|
//$extra['share_writable'] |= ($mode == Sharing::WRITABLE ? 1 : 0);
|
||||||
|
|
||||||
|
return \EGroupware\Stylite\Link\Sharing::create($path, $mode, NULL, $recipients, $extra);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format a datetime
|
* Format a datetime
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user