N°5298 - Fix HTML attribute name always empty in RichText block

This commit is contained in:
Molkobain
2024-05-24 09:30:02 +02:00
parent f87b4f6154
commit 4764553e08

View File

@@ -28,6 +28,11 @@ class RichText extends UIBlock
'js/highlight/styles/obsidian.min.css',
];
/**
* @var string|null
* @since 3.2.0
*/
protected $sName;
/** @var string|null */
protected $sValue;
/** @var array Configuration parameters for the CKEditor instance used with Richtext block */
@@ -37,18 +42,30 @@ class RichText extends UIBlock
* RichText constructor.
*
* @param string|null $sId
* @param string|null $sName
*/
public function __construct(?string $sId = null)
public function __construct(?string $sId = null, ?string $sName = null)
{
parent::__construct($sId);
$this->sName = $sName;
$this->sValue = null;
$this->aConfig = CKEditorHelper::GetCkeditorPref();
// add CKEditor translations resource
// Add CKEditor translations resource
$sLanguage = strtolower(explode(' ', Dict::GetUserLanguage())[0]);
$this->AddJsFileRelPath('js/ckeditor/build/translations/' . $sLanguage . '.js');
}
/**
* @see static::$sName
* @return string|null
* @since 3.2.0
*/
public function GetName(): ?string
{
return $this->sName;
}
/**
* @see static::$sValue
* @return string|null