Render form alignment

[MAILPOET-2809]
This commit is contained in:
Pavel Dohnal
2020-04-21 10:23:47 +02:00
committed by Veljko V
parent 9628463477
commit 2317412f88
5 changed files with 35 additions and 3 deletions

View File

@ -130,6 +130,19 @@ class BlockRendererHelper {
return $rules ? 'style="' . implode("", $rules) . '"' : '';
}
public function renderBlockAlignment(array $formSettings) {
$rules = [];
if (isset($formSettings['alignment'])) {
if ($formSettings['alignment'] === 'right') {
$rules[] = 'margin: 0 0 0 auto';
}
if ($formSettings['alignment'] === 'center') {
$rules[] = 'margin: 0 auto';
}
}
return $rules ? 'style="' . implode("", $rules) . '"' : '';
}
public function renderInputPlaceholder(array $block): string {
$html = '';
// if the label is displayed as a placeholder,