mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #108 from AshKyd/master
Added a check to avoid printing empty labels on EditableLiteralFields
This commit is contained in:
commit
6504db285c
@ -35,9 +35,12 @@ class EditableLiteralField extends EditableFormField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getFormField() {
|
public function getFormField() {
|
||||||
|
$label = $this->Title ? "<label class='left'>$this->Title</label>":"";
|
||||||
|
$classes = $this->Title ? "" : " nolabel";
|
||||||
|
|
||||||
return new LiteralField("LiteralField[$this->ID]",
|
return new LiteralField("LiteralField[$this->ID]",
|
||||||
"<div id='$this->Name' class='field text'>
|
"<div id='$this->Name' class='field text$classes'>
|
||||||
<label class='left'>$this->Title</label>
|
$label
|
||||||
<div class='middleColumn literalFieldArea'>". $this->getSetting('Content') ."</div>".
|
<div class='middleColumn literalFieldArea'>". $this->getSetting('Content') ."</div>".
|
||||||
"</div>"
|
"</div>"
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user