ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
UploadBuilder.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
30 final class UploadBuilder
31 {
32  public function __construct(
33  private Request $request,
34  private \ilCtrlInterface $ctrl,
35  private Factory $ui_factory,
36  private \ilLanguage $language,
37  private UploadHandler $upload_handler
38  ) {
39  }
40 
41  public function getDropZone(): \Generator
42  {
43  if ($this->request->canUserUplaod()) {
44  yield $this->ui_factory->dropzone()->file()->standard(
45  $this->language->txt('upload_modal_title'),
46  $this->language->txt('msg_upload'),
47  $this->ctrl->getLinkTargetByClass(
48  \ilResourceCollectionGUI::class,
50  ),
51  $this->ui_factory->input()->field()->file(
52  $this->upload_handler,
53  $this->language->txt('upload_field_title')
54  )->withMaxFiles(100)
55  )->withUploadButton(
56  $this->ui_factory->button()->shy(
57  $this->language->txt('select_files_from_computer'),
58  '#'
59  )
60  )->withBulky(true);
61  }
62  }
63 }
__construct(private Request $request, private \ilCtrlInterface $ctrl, private Factory $ui_factory, private \ilLanguage $language, private UploadHandler $upload_handler)