1 | <?php |
||
10 | class ReadonlyField extends FormField { |
||
11 | |||
12 | protected $readonly = true; |
||
13 | |||
14 | /** |
||
15 | * Include a hidden field in the HTML for the readonly field |
||
16 | * @var boolean |
||
17 | */ |
||
18 | protected $includeHiddenField = false; |
||
19 | |||
20 | /** |
||
21 | * If true, a hidden field will be included in the HTML for the readonly field. |
||
22 | * |
||
23 | * This can be useful if you need to pass the data through on the form submission, as |
||
24 | * long as it's okay than an attacker could change the data before it's submitted. |
||
25 | * |
||
26 | * This is disabled by default as it can introduce security holes if the data is not |
||
27 | * allowed to be modified by the user. |
||
28 | * |
||
29 | * @param boolean $includeHiddenField |
||
30 | */ |
||
31 | public function setIncludeHiddenField($includeHiddenField) { |
||
34 | |||
35 | public function performReadonlyTransformation() { |
||
38 | |||
39 | /** |
||
40 | * @param array $properties |
||
41 | * @return HTMLText |
||
42 | */ |
||
43 | public function Field($properties = array()) { |
||
54 | |||
55 | public function Value() { |
||
59 | |||
60 | /** |
||
61 | * This is a legacy fix to ensure that the `dontEscape` flag has an impact on readonly fields |
||
62 | * now that we've moved to casting template values more rigidly |
||
63 | * |
||
64 | * @param string $field |
||
65 | * @return string |
||
66 | */ |
||
67 | public function castingHelper($field) { |
||
77 | |||
78 | public function getAttributes() { |
||
87 | |||
88 | public function Type() { |
||
91 | |||
92 | } |
||
93 |