ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
with_additional_input.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
8 {
9  global $DIC;
10 
11  $factory = $DIC->ui()->factory();
12  $renderer = $DIC->ui()->renderer();
13  $request = $DIC->http()->request();
14  $wrapper = $DIC->http()->wrapper()->query();
15 
16  $submit_flag = 'dropzone_wrapper_with_additional_input';
17  $post_url = "{$request->getUri()}&$submit_flag";
18 
19  $dropzone = $factory
20  ->dropzone()->file()->wrapper(
21  'Upload your files here',
22  $post_url,
23  $factory->messageBox()->info('Drag and drop files onto me!'),
24  $factory->input()->field()->file(
26  'Your files'
27  ),
28  $factory->input()->field()->text(
29  'Additional Input',
30  'Additional input which affects all files of this upload.'
31  )
32  );
33 
34  // please use ilCtrl to generate an appropriate link target
35  // and check it's command instead of this.
36  if ($wrapper->has($submit_flag)) {
37  $dropzone = $dropzone->withRequest($request);
38  $data = $dropzone->getData();
39  } else {
40  $data = 'no results yet.';
41  }
42 
43  return '<pre>' . print_r($data, true) . '</pre>' .
44  $renderer->render($dropzone);
45 }
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...