N°7534 - Request to Improve the Display of an Inline Attachment (#664)

This commit is contained in:
Benjamin Dalsass
2024-08-19 11:03:06 +02:00
committed by GitHub
parent e8d059fa77
commit 1d3c71fd10
7 changed files with 221 additions and 54 deletions

View File

@@ -30,6 +30,11 @@ class FileUploadField extends AbstractSimpleField
{
/** @var bool DEFAULT_ALLOW_DELETE */
const DEFAULT_ALLOW_DELETE = true;
/**
* @var bool DEFAULT_DISPLAY_OPENED
* @since 3.2.1 N°7534
*/
const DEFAULT_DISPLAY_OPENED = false;
/** @var string|null $sTransactionId */
protected $sTransactionId;
@@ -39,8 +44,18 @@ class FileUploadField extends AbstractSimpleField
protected $sUploadEndpoint;
/** @var string|null $sDownloadEndpoint */
protected $sDownloadEndpoint;
/**
* @var string|null $sViewEndpoint
* @since 3.2.1 N°7534
*/
protected ?string $sDisplayEndpoint;
/** @var bool $bAllowDelete */
protected $bAllowDelete;
/**
* @var bool $bDisplayOpened
* @since 3.2.1 N°7534
*/
protected bool $bDisplayOpened;
/**
* @inheritDoc
@@ -51,7 +66,9 @@ class FileUploadField extends AbstractSimpleField
$this->oObject = null;
$this->sUploadEndpoint = null;
$this->sDownloadEndpoint = null;
$this->sDisplayEndpoint = null;
$this->bAllowDelete = static::DEFAULT_ALLOW_DELETE;
$this->bDisplayOpened = static::DEFAULT_DISPLAY_OPENED;
parent::__construct($sId, $onFinalizeCallback);
}
@@ -134,6 +151,27 @@ class FileUploadField extends AbstractSimpleField
return $this;
}
/**
* @return string|null
* @since 3.2.1 N°7534
*/
public function GetDisplayEndpoint(): ?string
{
return $this->sDisplayEndpoint;
}
/**
* @param string $sDisplayEndpoint
*
* @return FileUploadField
* @since 3.2.1 N°7534
*/
public function SetDisplayEndpoint(string $sDisplayEndpoint): FileUploadField
{
$this->sDisplayEndpoint = $sDisplayEndpoint;
return $this;
}
/**
* @return bool
*/
@@ -153,4 +191,29 @@ class FileUploadField extends AbstractSimpleField
return $this;
}
/**
* Sets if the field should be displayed opened on initialization
*
* @param bool $bDisplayOpened
*
* @return FileUploadField
* @since 3.2.1 N°7534
*/
public function SetDisplayOpened(bool $bDisplayOpened) : FileUploadField
{
$this->bDisplayOpened = $bDisplayOpened;
return $this;
}
/**
* Returns if the field should be displayed opened on initialization
*
* @return boolean
* @since 3.2.1 N°7534
*/
public function GetDisplayOpened() : bool
{
return $this->bDisplayOpened;
}
}