Commit 0303452c authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractBuildForm.php: remove $htmlImage of fabric element and specify...

AbstractBuildForm.php: remove $htmlImage of fabric element and specify background image in 'fabric' elemente via class 'data-backgroun-image'.
parent 471d3b75
......@@ -2912,22 +2912,20 @@ abstract class AbstractBuildForm {
*/
public function buildAnnotate(array $formElement, $htmlFormElementName, $value, array &$json, $mode = FORM_LOAD) {
$htmlImage = '';
if ($mode == FORM_LOAD && !empty($formElement[FE_IMAGE_SOURCE])) {
if (!is_readable($formElement[FE_IMAGE_SOURCE])) {
throw new UserFormException("Error reading file: " . $formElement[FE_IMAGE_SOURCE], ERROR_IO_READ_FILE);
}
}
$attributeImage = Support::doAttribute('id', 'qfq-fabric-image-1');
// $attributeImage .= Support::doAttribute('src', $formElement[FE_IMAGE_SOURCE]);
$attributeImage .= Support::doAttribute('src', $this->fileToSipUrl($formElement[FE_IMAGE_SOURCE]));
$attributeImage .= Support::doAttribute('class', 'qfq-fabric-image');
$htmlImage = Support::wrapTag('<img ' . $attributeImage . '>', '', false);
// $attributeImage = Support::doAttribute('id', 'qfq-fabric-image-1');
// $attributeImage .= Support::doAttribute('src', $this->fileToSipUrl($formElement[FE_IMAGE_SOURCE]));
// $attributeImage .= Support::doAttribute('class', 'qfq-fabric-image');
// $htmlImage = Support::wrapTag('<img ' . $attributeImage . '>', '', false);
// $attributeFabric = Support::doAttribute('id', 'fabric');
$attributeFabric = Support::doAttribute('class', FABRIC_CSS_CLASS);
$attributeFabric .= Support::doAttribute('data-background-image', $this->fileToSipUrl($formElement[FE_IMAGE_SOURCE]));
$attributeFabric .= Support::doAttribute('data-control-name', $formElement[FE_HTML_ID]);
$attributeFabric .= Support::doAttribute('data-buttons', 'typo3conf/ext/qfq/Resources/Public/Json/fabric.buttons.json');
$attributeFabric .= Support::doAttribute('data-emojis', 'typo3conf/ext/qfq/Resources/Public/Json/qfq.emoji.json');
......@@ -2941,7 +2939,7 @@ abstract class AbstractBuildForm {
$htmlInput = Support::wrapTag('<input ' . $attributeInput . ' >', '', false);
$html = $htmlImage . $htmlFabric . $htmlInput . $this->getHelpBlock();
$html = $htmlFabric . $htmlInput . $this->getHelpBlock();
// $json = $this->getFormElementForJson($htmlFormElementName, $value, $formElement);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment