Merge pull request #108 from AshKyd/master

Added a check to avoid printing empty labels on EditableLiteralFields
This commit is contained in:
Will Rossiter 2013-04-02 19:41:07 -07:00
commit 6504db285c

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>"
);