2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* It's a LiteralField ... with a Label
|
2008-09-12 05:48:13 +02:00
|
|
|
*
|
2008-01-09 05:18:36 +01:00
|
|
|
* @package forms
|
|
|
|
* @subpackage fields-dataless
|
2008-09-12 05:48:13 +02:00
|
|
|
*
|
|
|
|
* @deprecated If you need to have a label for your literal field, just put the
|
|
|
|
* HTML into a LiteralField, or use a custom form template to separate your
|
|
|
|
* presentation/content from the data fields.
|
|
|
|
* {@see http://doc.silverstripe.com/doku.php?id=form#using_a_custom_template}
|
2007-07-19 12:40:28 +02:00
|
|
|
*/
|
|
|
|
class LabelledLiteralField extends LiteralField {
|
|
|
|
|
|
|
|
function __construct( $name, $title, $content ) {
|
2008-09-12 05:48:13 +02:00
|
|
|
parent::__construct($name, $content);
|
|
|
|
user_error('LabelledLiteralField is deprecated. Please see the @deprecated note in LabelledLiteralField.php', E_USER_NOTICE);
|
2007-11-01 03:30:13 +01:00
|
|
|
$this->setTitle( $title );
|
2007-07-19 12:40:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function FieldHolder() {
|
|
|
|
return FormField::FieldHolder();
|
|
|
|
}
|
|
|
|
|
|
|
|
function Field() {
|
|
|
|
return is_object($this->content) ? $this->content->forTemplate() : $this->content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|