2016-06-03 10:51:02 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Readonly field equivalent for literal HTML
|
|
|
|
*
|
|
|
|
* Unlike HTMLEditorField_Readonly, does not processs shortcodes
|
|
|
|
*/
|
|
|
|
class HTMLReadonlyField extends ReadonlyField {
|
|
|
|
private static $casting = [
|
2016-07-14 04:43:53 +02:00
|
|
|
'Value' => 'HTMLFragment',
|
|
|
|
'ValueEntities' => 'HTMLFragment',
|
2016-06-03 10:51:02 +02:00
|
|
|
];
|
2016-07-14 04:43:53 +02:00
|
|
|
|
2016-08-16 00:50:41 +02:00
|
|
|
protected $schemaDataType = self::SCHEMA_DATA_TYPE_STRUCTURAL;
|
|
|
|
|
|
|
|
protected $schemaComponent = 'HtmlReadonlyField';
|
|
|
|
|
2016-07-14 04:43:53 +02:00
|
|
|
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');
|
|
|
|
}
|
2016-06-03 10:51:02 +02:00
|
|
|
}
|