ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
with_additional_input.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
35{
36 global $DIC;
37
38 $factory = $DIC->ui()->factory();
39 $renderer = $DIC->ui()->renderer();
40 $request = $DIC->http()->request();
41 $wrapper = $DIC->http()->wrapper()->query();
42
43 $submit_flag = 'dropzone_wrapper_with_additional_input';
44 $post_url = "{$request->getUri()}&$submit_flag";
45
46 $dropzone = $factory
47 ->dropzone()->file()->wrapper(
48 'Upload your files here',
49 $post_url,
50 $factory->messageBox()->info('Drag and drop files onto me!'),
51 $factory->input()->field()->file(
53 'Your files'
54 ),
55 $factory->input()->field()->text(
56 'Additional Input',
57 'Additional input which affects all files of this upload.'
58 )
59 );
60
61 // please use ilCtrl to generate an appropriate link target
62 // and check it's command instead of this.
63 if ($wrapper->has($submit_flag)) {
64 $dropzone = $dropzone->withRequest($request);
65 $data = $dropzone->getData();
66 } else {
67 $data = 'no results yet.';
68 }
69
70 return '<pre>' . print_r($data, true) . '</pre>' .
71 $renderer->render($dropzone);
72}
$renderer
@ilCtrl_isCalledBy ilUIAsyncDemoFileUploadHandlerGUI: ilUIPluginRouterGUI
global $DIC
Definition: shib_login.php:26