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 | public function Field($properties = array()) { |
||
50 | |||
51 | public function Value() { |
||
55 | |||
56 | /** |
||
57 | * This is a legacy fix to ensure that the `dontEscape` flag has an impact on readonly fields |
||
58 | * now that we've moved to casting template values more rigidly |
||
59 | * |
||
60 | * @param string $field |
||
61 | * @return string |
||
62 | */ |
||
63 | public function castingHelper($field) { |
||
73 | |||
74 | public function getAttributes() { |
||
83 | |||
84 | public function Type() { |
||
87 | } |
||
88 |