ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_clear_button.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
19 {
20  global $DIC;
21 
22  $factory = $DIC->ui()->factory();
23  $renderer = $DIC->ui()->renderer();
24  $request = $DIC->http()->request();
25 
26  $submit_flag = 'dropzone_wrapper_with_clear_button';
27  $post_url = "{$request->getUri()}&$submit_flag";
28 
29  $dropzone = $factory
30  ->dropzone()->file()->wrapper(
31  'Upload your files here',
32  $post_url,
33  $factory->messageBox()->info('Drag and drop files onto me!'),
34  $factory->input()->field()->file(
36  'Your files'
37  )
38  );
39 
40  $dropzone = $dropzone->withActionButtons([
41  $factory->button()->standard('Clear files!', '#')->withOnClick($dropzone->getClearSignal())
42  ]);
43 
44  return $renderer->render($dropzone);
45 }
$renderer
with_clear_button()
description: > Example for rendering a file dropzone wrapper with clear buttons. ...
global $DIC
Definition: shib_login.php:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...