aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/forms/FileInput.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/classes/forms/FileInput.php')
-rw-r--r--lib/classes/forms/FileInput.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/classes/forms/FileInput.php b/lib/classes/forms/FileInput.php
new file mode 100644
index 0000000..5862b3c
--- /dev/null
+++ b/lib/classes/forms/FileInput.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Studip\Forms;
+
+class FileInput extends Input
+{
+
+ public function render()
+ {
+ $template = $GLOBALS['template_factory']->open('forms/file_input');
+ $template->title = $this->title;
+ $template->name = $this->name;
+ $template->folder = $this->value;
+ $template->id = md5(uniqid());
+ $template->uploadUrl = $this->attributes['upload_url'];
+ $template->multiple = $this->attributes['multiple'] ?? '';
+ $template->accept = $this->attributes['accept'] ?? '*/*';
+ $template->required = $this->attributes['required'] ?? '';
+
+ return $template->render();
+ }
+
+}