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
|
|
|
|
|
|
|
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
|
|
|
}
|