ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
37 function base()
38 {
39  global $DIC;
40 
41  $factory = $DIC->ui()->factory();
42  $renderer = $DIC->ui()->renderer();
43  $request = $DIC->http()->request();
44  $wrapper = $DIC->http()->wrapper()->query();
45 
46  $submit_flag = 'dropzone_standard_base';
47  $post_url = "{$request->getUri()}&$submit_flag";
48 
49  $dropzone = $factory
50  ->dropzone()->file()->standard(
51  'Upload your files here',
52  'Drag files in here to upload them!',
53  $post_url,
54  $factory->input()->field()->file(
56  'your files'
57  )
58  )->withUploadButton(
59  $factory->button()->shy('Upload files', '#')
60  );
61 
62  // please use ilCtrl to generate an appropriate link target
63  // and check it's command instead of this.
64  if ($wrapper->has($submit_flag)) {
65  $dropzone = $dropzone->withRequest($request);
66  $data = $dropzone->getData();
67  } else {
68  $data = 'no results yet.';
69  }
70 
71  return '<pre>' . print_r($data, true) . '</pre>' .
72  $renderer->render($dropzone);
73 }
$renderer
global $DIC
Definition: shib_login.php:22
ilUIAsyncDemoFileUploadHandlerGUI: ilUIPluginRouterGUI
base()
description: > Example for rendering a file dropzone.
Definition: base.php:37