1 | <?php |
||
23 | class UploadField extends FormField |
||
24 | { |
||
25 | use FileUploadReceiver; |
||
26 | |||
27 | /** |
||
28 | * @config |
||
29 | * @var int |
||
30 | */ |
||
31 | private static $thumbnail_width = 60; |
||
|
|||
32 | |||
33 | /** |
||
34 | * @config |
||
35 | * @var int |
||
36 | */ |
||
37 | private static $thumbnail_height = 60; |
||
38 | |||
39 | protected $schemaDataType = FormField::SCHEMA_DATA_TYPE_CUSTOM; |
||
40 | |||
41 | protected $schemaComponent = 'UploadField'; |
||
42 | |||
43 | /** |
||
44 | * @var bool|null |
||
45 | */ |
||
46 | protected $multiUpload = null; |
||
47 | |||
48 | /** |
||
49 | * Create a new file field. |
||
50 | * |
||
51 | * @param string $name The internal field name, passed to forms. |
||
52 | * @param string $title The field label. |
||
53 | * @param SS_List $items Items assigned to this field |
||
54 | */ |
||
55 | public function __construct($name, $title = null, SS_List $items = null) |
||
63 | |||
64 | public function getSchemaDataDefaults() |
||
77 | |||
78 | /** |
||
79 | * Get ID of target parent folder |
||
80 | * |
||
81 | * @return int |
||
82 | */ |
||
83 | protected function getFolderID() |
||
92 | |||
93 | public function getSchemaStateDefaults() |
||
100 | |||
101 | /** |
||
102 | * Encode selected values for react |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | protected function getEncodedItems() |
||
115 | |||
116 | /** |
||
117 | * Check if allowed to upload more than one file |
||
118 | * |
||
119 | * @return bool |
||
120 | */ |
||
121 | public function getIsMultiUpload() |
||
136 | |||
137 | /** |
||
138 | * Set upload type to multi / single |
||
139 | * |
||
140 | * @param $multi |
||
141 | * @return $this |
||
142 | */ |
||
143 | public function setIsMultiUpload($multi) |
||
148 | |||
149 | public function getAttributes() |
||
166 | |||
167 | public function Type() |
||
171 | } |
||
172 |
This check marks private properties in classes that are never used. Those properties can be removed.