mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
8dd644d25d
Namespace all templates Move difflib and BBCodeParser2 to thirdparty Remove deprecated API marked for removal in 4.0
37 lines
771 B
PHP
37 lines
771 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Forms;
|
|
|
|
/**
|
|
* Readonly field equivalent for literal HTML
|
|
*
|
|
* Unlike HTMLEditorField_Readonly, does not processs shortcodes
|
|
*/
|
|
class HTMLReadonlyField extends ReadonlyField {
|
|
private static $casting = [
|
|
'Value' => 'HTMLFragment',
|
|
'ValueEntities' => 'HTMLFragment',
|
|
];
|
|
|
|
protected $schemaDataType = self::SCHEMA_DATA_TYPE_STRUCTURAL;
|
|
|
|
/**
|
|
* @skipUpgrade
|
|
* @var string
|
|
*/
|
|
protected $schemaComponent = 'HtmlReadonlyField';
|
|
|
|
public function Field($properties = array()) {
|
|
return $this->renderWith($this->getTemplates());
|
|
}
|
|
|
|
/**
|
|
* Return value with all values encoded in html entities
|
|
*
|
|
* @return string Raw HTML
|
|
*/
|
|
public function ValueEntities() {
|
|
return htmlentities($this->Value(), ENT_COMPAT, 'UTF-8');
|
|
}
|
|
}
|