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_standard_with_additional_input';
44  $post_url = "{$request->getUri()}&$submit_flag";
45 
46  $dropzone = $factory
47  ->dropzone()->file()->standard(
48  'Upload your files here',
49  'Drag files in here to upload them!',
50  $post_url,
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  )->withUploadButton(
60  $factory->button()->shy('Upload files', '#')
61  );
62 
63  // please use ilCtrl to generate an appropriate link target
64  // and check it's command instead of this.
65  if ($wrapper->has($submit_flag)) {
66  $dropzone = $dropzone->withRequest($request);
67  $data = $dropzone->getData();
68  } else {
69  $data = 'no results yet.';
70  }
71 
72  return '<pre>' . print_r($data, true) . '</pre>' .
73  $renderer->render($dropzone);
74 }
$renderer
with_additional_input()
description: > Example for rendering a standard file dropzone with additional input.
global $DIC
Definition: shib_login.php:22
ilUIAsyncDemoFileUploadHandlerGUI: ilUIPluginRouterGUI