2009-03-25 04:37:49 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2009-04-17 04:26:40 +02:00
|
|
|
* Editable Literal Field. A literal field is just a blank slate where
|
|
|
|
* you can add your own HTML / Images / Flash
|
2009-03-25 04:37:49 +01:00
|
|
|
*
|
2009-04-17 04:26:40 +02:00
|
|
|
* @package userforms
|
2009-03-25 04:37:49 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
class EditableLiteralField extends EditableFormField {
|
|
|
|
|
2009-03-25 06:25:50 +01:00
|
|
|
static $singular_name = 'HTML Block';
|
2009-03-25 04:37:49 +01:00
|
|
|
|
2009-04-17 04:26:40 +02:00
|
|
|
static $plural_name = 'HTML Blocks';
|
2009-03-25 04:37:49 +01:00
|
|
|
|
|
|
|
function ExtraOptions() {
|
|
|
|
// eventually replace hard-coded "Fields"?
|
|
|
|
$baseName = "Fields[$this->ID]";
|
|
|
|
|
|
|
|
$extraFields = new FieldSet();
|
2009-04-27 06:01:06 +02:00
|
|
|
$extraFields->push(new TextareaField($baseName . "[CustomSettings][Content]", "Text", 4, 20, $this->getSetting('Content')));
|
2009-03-25 04:37:49 +01:00
|
|
|
|
|
|
|
return $extraFields;
|
|
|
|
}
|
2009-04-27 06:01:06 +02:00
|
|
|
|
|
|
|
function getFormField() {
|
2009-03-25 04:37:49 +01:00
|
|
|
return new LiteralField("LiteralField[$this->ID]",
|
2009-04-27 06:01:06 +02:00
|
|
|
"<div class='field text'><label class='left'>$this->Title</label><div class='middleColumn literalFieldArea'>". $this->getSetting('Content') ."</div></div>");
|
2009-03-25 04:37:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|