ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
with_additional_input.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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
global $DIC
Definition: shib_login.php:22
ilUIAsyncDemoFileUploadHandlerGUI: ilUIPluginRouterGUI
with_additional_input()
description: > Example for rendering a file dropzone wrapper with additional input.