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
|
|
|
|
2009-05-15 00:54:42 +02:00
|
|
|
function getFieldConfiguration() {
|
2009-05-06 05:34:40 +02:00
|
|
|
return new FieldSet(
|
2011-12-05 09:38:10 +01:00
|
|
|
new TextareaField(
|
2012-04-14 08:36:50 +02:00
|
|
|
$this->getSettingName('Content'),
|
2011-12-05 09:38:10 +01:00
|
|
|
"HTML", 4, 20, $this->getSetting('Content')
|
|
|
|
),
|
|
|
|
new CheckboxField(
|
2012-04-14 08:36:50 +02:00
|
|
|
$this->getSettingName('HideFromReports'),
|
2011-12-05 09:38:10 +01:00
|
|
|
_t('EditableLiteralField.HIDEFROMREPORT', 'Hide from reports?'),
|
|
|
|
$this->getSetting('HideFromReports')
|
|
|
|
)
|
2009-05-06 05:34:40 +02:00
|
|
|
);
|
2009-03-25 04:37:49 +01:00
|
|
|
}
|
2009-04-27 06:01:06 +02:00
|
|
|
|
|
|
|
function getFormField() {
|
2009-03-25 04:37:49 +01:00
|
|
|
return new LiteralField("LiteralField[$this->ID]",
|
2011-12-05 09:38:10 +01:00
|
|
|
"<div id='$this->Name' class='field text'>
|
|
|
|
<label class='left'>$this->Title</label>
|
|
|
|
<div class='middleColumn literalFieldArea'>". $this->getSetting('Content') ."</div>".
|
|
|
|
"</div>"
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
function showInReports() {
|
2012-04-14 08:36:50 +02:00
|
|
|
return (!$this->getSetting('HideFromReports'));
|
2009-03-25 04:37:49 +01:00
|
|
|
}
|
2009-12-07 03:04:20 +01:00
|
|
|
}
|