Added check for a blank title in the HTML Block/EditableLiteralField so we don't print empty labels.

This commit is contained in:
Ash Kyd 2013-04-03 12:35:02 +10:00
parent 7dc2bd9675
commit 68bc428fe2

View File

@ -35,9 +35,12 @@ class EditableLiteralField extends EditableFormField {
}
public function getFormField() {
$label = $this->Title ? "<label class='left'>$this->Title</label>":"";
$classes = $this->Title ? "" : " nolabel";
return new LiteralField("LiteralField[$this->ID]",
"<div id='$this->Name' class='field text'>
<label class='left'>$this->Title</label>
"<div id='$this->Name' class='field text$classes'>
$label
<div class='middleColumn literalFieldArea'>". $this->getSetting('Content') ."</div>".
"</div>"
);