ILIAS  release_8 Revision v8.24
class.ilMediaCreationGUI.php
Go to the documentation of this file.
1<?php
2
20
28
34{
35 public const TYPE_VIDEO = 1;
36 public const TYPE_AUDIO = 2;
37 public const TYPE_IMAGE = 3;
38 public const TYPE_OTHER = 4;
39 public const TYPE_ALL = 5;
40 public const POOL_VIEW_FOLDER = "fold";
41 public const POOL_VIEW_ALL = "all";
42 protected \ILIAS\MediaObjects\MediaType\MediaTypeManager $type_manager;
46
47 protected array $accept_types = [1,2,3,4];
48 protected ilLanguage $lng;
49 protected ilCtrl $ctrl;
51 protected Closure $after_upload;
52 protected Closure $after_url_saving;
53 protected Closure $after_pool_insert;
54 protected Closure $finish_single_upload;
55 protected Closure $on_mob_update;
60 protected array $all_suffixes = [];
64 protected array $all_mime_types = [];
65 protected \ILIAS\DI\UIServices $ui;
66 protected int $requested_mep;
68 protected \ILIAS\FileUpload\FileUpload $upload;
69 protected ilLogger $mob_log;
70
71 public function __construct(
72 array $accept_types,
73 Closure $after_upload,
74 Closure $after_url_saving,
75 Closure $after_pool_insert,
76 Closure $finish_single_upload = null,
77 Closure $on_mob_update = null
78 ) {
79 global $DIC;
80
81 $this->lng = $DIC->language();
82 $this->lng->loadLanguageModule("mob");
83 $this->lng->loadLanguageModule("content");
84 $this->access = $DIC->access();
85
86 $this->ctrl = $DIC->ctrl();
87 $this->main_tpl = $DIC->ui()->mainTemplate();
88 $this->ui = $DIC->ui();
89 $this->upload = $DIC->upload();
90 $this->mob_log = $DIC->logger()->mob();
91
92 $this->accept_types = $accept_types;
93 $this->after_upload = $after_upload;
94 $this->after_url_saving = $after_url_saving;
95 $this->after_pool_insert = $after_pool_insert;
96 $this->finish_single_upload = $finish_single_upload;
97 $this->on_mob_update = $on_mob_update;
98 $this->type_manager = $DIC->mediaObjects()
99 ->internal()
100 ->domain()
101 ->mediaType();
102
103 $this->ctrl->saveParameter($this, ["mep", "pool_view"]);
104
105 $this->request = $DIC->mediaObjects()
106 ->internal()
107 ->gui()
108 ->creation()
109 ->request();
110
111 $this->requested_mep = $this->request->getMediaPoolId();
112 $this->ctrl->setParameter($this, "mep", $this->requested_mep);
113
114 $pv = $this->request->getPoolView();
115 $this->pool_view = (in_array($pv, [self::POOL_VIEW_FOLDER, self::POOL_VIEW_ALL]))
116 ? $pv
117 : self::POOL_VIEW_FOLDER;
118 $this->gui = $DIC->mediaObjects()->internal()->gui();
119 }
120
121 public function setAllSuffixes(
122 array $a_val
123 ): void {
124 $this->all_suffixes = $a_val;
125 }
126
127 public function getAllSuffixes(): array
128 {
129 return $this->all_suffixes;
130 }
131
132 public function setAllMimeTypes(
133 array $a_val
134 ): void {
135 $this->all_mime_types = $a_val;
136 }
137
141 public function getAllMimeTypes(): array
142 {
143 return $this->all_mime_types;
144 }
145
149 protected function getSuffixes(): array
150 {
151 $suffixes = [];
152 if (in_array(self::TYPE_ALL, $this->accept_types, true)) {
153 $suffixes = $this->getAllSuffixes();
154 }
155 if (in_array(self::TYPE_VIDEO, $this->accept_types, true)) {
156 $suffixes = array_merge($suffixes, $this->type_manager->getVideoSuffixes());
157 }
158 if (in_array(self::TYPE_AUDIO, $this->accept_types, true)) {
159 $suffixes = array_merge($suffixes, $this->type_manager->getAudioMimeTypes());
160 }
161 if (in_array(self::TYPE_IMAGE, $this->accept_types)) {
162 $suffixes = array_merge($suffixes, $this->type_manager->getImageSuffixes());
163 }
164 return $suffixes;
165 }
166
170 protected function getMimeTypes($local_only = false): array
171 {
172 $mimes = [];
173 if (in_array(self::TYPE_ALL, $this->accept_types)) {
174 $mimes = $this->getAllMimeTypes();
175 }
176 if (in_array(self::TYPE_VIDEO, $this->accept_types)) {
177 $mimes[] = "video/mp4";
178 if (!$local_only) {
179 $mimes[] = "video/vimeo";
180 $mimes[] = "video/youtube";
181 }
182 }
183 if (in_array(self::TYPE_AUDIO, $this->accept_types)) {
184 $mimes[] = "audio/mpeg";
185 }
186 if (in_array(self::TYPE_IMAGE, $this->accept_types)) {
187 $mimes[] = "image/png";
188 $mimes[] = "image/jpeg";
189 $mimes[] = "image/gif";
190 }
191 return $mimes;
192 }
193
194 public function executeCommand(): void
195 {
196 $ctrl = $this->ctrl;
197
198 $next_class = $ctrl->getNextClass($this);
199 $cmd = $ctrl->getCmd("creationSelection");
200
201 switch ($next_class) {
202
203 case "ilpropertyformgui":
204 $form = $this->initPoolSelection();
205 $ctrl->forwardCommand($form);
206 break;
207
208 case strtolower(ilRepoStandardUploadHandlerGUI::class):
209 $form = $this->getUploadForm();
210 $gui = $form->getRepoStandardUploadHandlerGUI("media_files");
211 $this->ctrl->forwardCommand($gui);
212 break;
213
214 default:
215 if (in_array($cmd, ["creationSelection", "uploadFile", "saveUrl", "cancel", "cancelCreate", "listPoolItems",
216 "insertFromPool", "poolSelection", "selectPool", "applyFilter", "resetFilter", "performBulkUpload",
217 "editTitlesAndDescriptions", "saveTitlesAndDescriptions"])) {
218 $this->$cmd();
219 }
220 }
221 }
222
223 protected function creationSelection(): void
224 {
225 $main_tpl = $this->main_tpl;
226
227 $acc = new \ilAccordionGUI();
228 $acc->setBehaviour(\ilAccordionGUI::FIRST_OPEN);
229 $cnt = 1;
230 $forms = [
231 $this->getUploadForm(),
232 $this->initUrlForm(),
233 $this->initPoolSelection()
234 ];
235 foreach ($forms as $form_type => $cf) {
236 $htpl = new \ilTemplate("tpl.creation_acc_head.html", true, true, "Services/Object");
237
238 // using custom form titles (used for repository plugins)
239 $form_title = "";
240 if (method_exists($this, "getCreationFormTitle")) {
241 $form_title = $this->getCreationFormTitle($form_type);
242 }
243 if (!$form_title) {
244 $form_title = $cf->getTitle();
245 }
246
247 // move title from form to accordion
248 $htpl->setVariable("TITLE", $this->lng->txt("option") . " " . $cnt . ": " .
249 $form_title);
250 if (!($cf instanceof FormAdapterGUI)) {
251 $cf->setTitle("");
252 $cf->setTitleIcon("");
253 $cf->setTableWidth("100%");
254
255 $acc->addItem($htpl->get(), $cf->getHTML());
256 } else {
257 $acc->addItem($htpl->get(), $cf->render());
258 }
259
260 $cnt++;
261 }
262 $main_tpl->setContent($acc->getHTML());
263 }
264
265 public function getUploadForm(): FormAdapterGUI
266 {
267 // $item->setSuffixes($this->getSuffixes());
268 if (is_null($this->bulk_upload_form)) {
269 $mep_hash = uniqid();
270 $this->ctrl->setParameter($this, "mep_hash", $mep_hash);
271 $this->bulk_upload_form = $this->gui
272 ->form(self::class, 'performBulkUpload')
273 ->section("props", $this->lng->txt('mob_upload_file'))
274 ->file(
275 "media_files",
276 $this->lng->txt("files"),
277 \Closure::fromCallable([$this, 'handleUploadResult']),
278 "mep_id",
279 "",
280 20,
281 $this->getMimeTypes(true),
282 true
283 );
284 // ->meta()->text()->meta()->textarea()
285 }
286 return $this->bulk_upload_form;
287 }
288
290 {
291 $ctrl = $this->ctrl;
293
294 $form = new \ilPropertyFormGUI();
295
296 //
297 $ti = new \ilTextInputGUI($lng->txt("mob_url"), "url");
298 $info = $lng->txt("mob_url_info1") . " " . implode(", ", $this->getSuffixes()) . ".";
299 if (in_array(self::TYPE_VIDEO, $this->accept_types)) {
300 $info.= " " . $lng->txt("mob_url_info_video");
301 }
302 $ti->setInfo($info);
303 $ti->setRequired(true);
304 $form->addItem($ti);
305
306 $form->addCommandButton("saveUrl", $lng->txt("save"));
307 $form->addCommandButton("cancel", $lng->txt("cancel"));
308
309 $form->setTitle($lng->txt("mob_external_url"));
310 $form->setFormAction($ctrl->getFormAction($this));
311
312 return $form;
313 }
314
316 {
317 $ctrl = $this->ctrl;
319
320 $form = new \ilPropertyFormGUI();
321
323 $lng->txt("obj_mep"),
324 "mep",
325 false,
326 $form
327 );
328 $exp = $mcst->getExplorerGUI();
329 $exp->setSelectableTypes(["mep"]);
330 $exp->setTypeWhiteList(["root", "mep", "cat", "crs", "grp", "fold"]);
331 $mcst->setRequired(true);
332 $form->addItem($mcst);
333
334 $form->addCommandButton("listPoolItems", $lng->txt("continue"));
335 $form->addCommandButton("cancel", $lng->txt("cancel"));
336
337 $form->setTitle($lng->txt("mob_choose_from_pool"));
338 $form->setFormAction($ctrl->getFormAction($this));
339
340 return $form;
341 }
342
343 /*
344 protected function uploadFile() : void
345 {
346 $form = $this->initUploadForm();
347
348 if (!$form->checkInput()) {
349 $form->setValuesByPost();
350 $this->main_tpl->setContent($form->getHTML());
351 //$this->creationSelection();
352 } else {
353 $mob = new ilObjMediaObject();
354 $mob->create();
355
356 //handle standard purpose
357 $mediaItem = new ilMediaItem();
358 $mob->addMediaItem($mediaItem);
359 $mediaItem->setPurpose("Standard");
360
361 // determine and create mob directory, move uploaded file to directory
362 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
363 if (!is_dir($mob_dir)) {
364 $mob->createDirectory();
365 }
366 $file_name = ilFileUtils::getASCIIFilename($_FILES['file']["name"]);
367 $file_name = str_replace(" ", "_", $file_name);
368
369 $file = $mob_dir . "/" . $file_name;
370 $title = $file_name;
371 $locationType = "LocalFile";
372 $location = $title;
373 ilFileUtils::moveUploadedFile($_FILES['file']['tmp_name'], $file_name, $file);
374 ilFileUtils::renameExecutables($mob_dir);
375
376 // get mime type, if not already set!
377 $format = ilObjMediaObject::getMimeType($file, false);
378
379 // set real meta and object data
380 $mediaItem->setFormat($format);
381 $mediaItem->setLocation($location);
382 $mediaItem->setLocationType($locationType);
383 $mediaItem->setHAlign("Left");
384 $mob->setTitle($title);
385
386 $mob->update();
387
388 // preview pic
389 $mob = new ilObjMediaObject($mob->getId());
390 $mob->generatePreviewPic(320, 240);
391
392 // duration
393 $med_item = $mob->getMediaItem("Standard");
394 $med_item->determineDuration();
395 $med_item->update();
396
397 //
398 // @todo: save usage
399 //
400
401 ($this->after_upload)($mob->getId());
402 }
403 }*/
404
405 protected function handleUploadResult(
406 FileUpload $upload,
407 UploadResult $result
409 $title = $result->getName();
410
411 $mob = new ilObjMediaObject();
412 $mob->setTitle($title);
413 $mob->setDescription("");
414 $mob->create();
415
416 $mob->createDirectory();
417 $media_item = new ilMediaItem();
418 $mob->addMediaItem($media_item);
419 $media_item->setPurpose("Standard");
420
421 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
422 $file_name = ilObjMediaObject::fixFilename($title);
423 $file = $mob_dir . "/" . $file_name;
424
425 $upload->moveOneFileTo(
426 $result,
427 $mob_dir,
428 Location::WEB,
429 $file_name,
430 true
431 );
432
433 // get mime type
435 $location = $file_name;
436
437 // set real meta and object data
438 $media_item->setFormat($format);
439 $media_item->setLocation($location);
440 $media_item->setLocationType("LocalFile");
441 $media_item->setUploadHash($this->request->getUploadHash());
442 $mob->update();
443 $item_ids[] = $mob->getId();
444
445 $mob = new ilObjMediaObject($mob->getId());
446 $mob->generatePreviewPic(320, 240);
447
448 // duration
449 $med_item = $mob->getMediaItem("Standard");
450 $med_item->determineDuration();
451 $med_item->update();
452
453 ($this->after_upload)([$mob->getId()]);
454
455 return new BasicHandlerResult(
456 "mep_id",
457 HandlerResult::STATUS_OK,
458 $med_item->getId(),
459 ''
460 );
461 }
462
466 public function performBulkUpload(): void
467 {
468 $form = $this->getUploadForm();
469 if (!$form->isValid()) {
470 $this->main_tpl->setContent($form->render());
471 return;
472 }
473
474 $this->ctrl->setParameter($this, "mep_hash", $this->request->getUploadHash());
475 $this->ctrl->redirect($this, "editTitlesAndDescriptions");
476 }
477
478
479 protected function editTitlesAndDescriptions(): void
480 {
481 $ctrl = $this->ctrl;
483
484 $ctrl->saveParameter($this, "mep_hash");
485
486 $main_tpl = $this->main_tpl;
487
488 $media_items = ilMediaItem::getMediaItemsForUploadHash($this->request->getUploadHash());
489
490 $tb = new ilToolbarGUI();
491 $tb->setFormAction($ctrl->getFormAction($this));
492 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
493 $tb->setOpenFormTag(true);
494 $tb->setCloseFormTag(false);
495 $tb->setId("tb_top");
496
497 if (count($media_items) == 1 && $this->finish_single_upload) {
498 $mi = current($media_items);
499 ($this->finish_single_upload)($mi["mob_id"]);
500 return;
501 }
502
503 $html = $tb->getHTML();
504 foreach ($media_items as $mi) {
505 $acc = new ilAccordionGUI();
506 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
507 $acc->setId("acc_" . $mi["mob_id"]);
508
509 $mob = new ilObjMediaObject($mi["mob_id"]);
510 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
511 $acc->addItem($mob->getTitle(), $form->getHTML());
512
513 $html .= $acc->getHTML();
514 }
515
516 $html .= $tb->getHTML();
517 $tb->setOpenFormTag(false);
518 $tb->setCloseFormTag(true);
519 $tb->setId("tb_bottom");
520
521 $main_tpl->setContent($html);
522 }
523
524 public function initMediaBulkForm(string $a_id, string $a_title): ilPropertyFormGUI
525 {
527
528 $form = new ilPropertyFormGUI();
529 $form->setOpenTag(false);
530 $form->setCloseTag(false);
531
532 // title
533 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
534 $ti->setValue($a_title);
535 $form->addItem($ti);
536
537 // description
538 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
539 $form->addItem($ti);
540
541 return $form;
542 }
543
544 protected function saveTitlesAndDescriptions(): void
545 {
547 $ctrl = $this->ctrl;
548
549 $media_items = ilMediaItem::getMediaItemsForUploadHash($this->request->getUploadHash());
550
551 foreach ($media_items as $mi) {
552 $mob = new ilObjMediaObject($mi["mob_id"]);
553 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
554 $form->checkInput();
555 $title = $form->getInput("title_" . $mi["mob_id"]);
556 $desc = $form->getInput("description_" . $mi["mob_id"]);
557 if (trim($title) != "") {
558 $mob->setTitle($title);
559 }
560 $mob->setDescription($desc);
561 $mob->update();
562 ($this->on_mob_update)($mob->getId());
563 }
564 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
565 $ctrl->returnToParent($this);
566 }
567
568 protected function cancel(): void
569 {
570 $ctrl = $this->ctrl;
571 $ctrl->returnToParent($this);
572 }
573
574 protected function cancelCreate(): void
575 {
576 $ctrl = $this->ctrl;
577 $ctrl->returnToParent($this);
578 }
579
580 protected function saveUrl(): void
581 {
582 $form = $this->initUrlForm();
583
584 if (!$form->checkInput()) {
585 $form->setValuesByPost();
586 $this->main_tpl->setContent($form->getHTML());
587 } else {
588 $mob = new ilObjMediaObject();
589 $mob->create();
590
591 //handle standard purpose
592 $mediaItem = new ilMediaItem();
593 $mob->addMediaItem($mediaItem);
594 $mediaItem->setPurpose("Standard");
595
596 // determine and create mob directory, move uploaded file to directory
597 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
598 if (!is_dir($mob_dir)) {
599 $mob->createDirectory();
600 }
601 $locationType = "Reference";
602 $url = $form->getInput("url");
603 $url_pi = pathinfo(basename($url));
604 $title = str_replace("_", " ", $url_pi["filename"]);
605
606 // get mime type, if not already set!
608 if (!in_array($format, $this->getMimeTypes())) {
609 $this->main_tpl->setOnScreenMessage(
610 "failure",
611 $this->lng->txt("mob_type_not_supported") . " " . $format
612 );
613 $form->setValuesByPost();
614 $this->main_tpl->setContent($form->getHTML());
615 return;
616 }
617 // set real meta and object data
618 $mediaItem->setFormat($format);
619 $mediaItem->setLocation($url);
620 $mediaItem->setLocationType("Reference");
621 $mediaItem->setHAlign("Left");
622 $mob->setTitle($title);
623 try {
624 $mob->getExternalMetadata();
625 } catch (Exception $e) {
626 $this->main_tpl->setOnScreenMessage('failure', $e->getMessage(), true);
627 $form->setValuesByPost();
628 $this->main_tpl->setContent($form->getHTML());
629 return;
630 }
631
632 $long_desc = $mob->getLongDescription();
633 $mob->update();
634
635 $mob = new ilObjMediaObject($mob->getId());
636 $mob->generatePreviewPic(320, 240);
637
638 // duration
639 $med_item = $mob->getMediaItem("Standard");
640 $med_item->determineDuration();
641 $med_item->update();
642
643 //
644 // @todo: save usage
645 //
646
647 ($this->after_url_saving)($mob->getId(), $long_desc);
648 }
649 }
650
654 public function listPoolItems(): void
655 {
656 $ctrl = $this->ctrl;
657 $access = $this->access;
659 $ui = $this->ui;
660 $main_tpl = $this->main_tpl;
661
662 $form = $this->initPoolSelection();
663 if ($this->requested_mep === 0) {
664 $this->main_tpl->setOnScreenMessage("failure", $this->lng->txt("mob_please_select_pool"));
665 $form->setValuesByPost();
666 $this->main_tpl->setContent($form->getHTML());
667 return;
668 }
669
670 if ($this->requested_mep > 0 &&
671 $access->checkAccess("write", "", $this->requested_mep)
672 && ilObject::_lookupType(ilObject::_lookupObjId($this->requested_mep)) == "mep") {
673 $tb = new ilToolbarGUI();
674
675 // button: select pool
676 $tb->addButton(
677 $lng->txt("cont_switch_to_media_pool"),
678 $ctrl->getLinkTarget($this, "poolSelection")
679 );
680
681 // view mode: pool view (folders/all media objects)
682 $f = $ui->factory();
683 $lng->loadLanguageModule("mep");
684 $ctrl->setParameter($this, "pool_view", self::POOL_VIEW_FOLDER);
685 $actions[$lng->txt("folders")] = $ctrl->getLinkTarget($this, "listPoolItems");
686 $ctrl->setParameter($this, "pool_view", self::POOL_VIEW_ALL);
687 $actions[$lng->txt("mep_all_mobs")] = $ctrl->getLinkTarget($this, "listPoolItems");
688 $ctrl->setParameter($this, "pool_view", $this->pool_view);
689 $aria_label = $lng->txt("cont_change_pool_view");
690 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == self::POOL_VIEW_FOLDER)
691 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
692 $tb->addSeparator();
693 $tb->addComponent($view_control);
694
695 $html = $tb->getHTML();
696
697 $pool_table = $this->getPoolTable();
698
699 $html .= $pool_table->getHTML();
700
701 $main_tpl->setContent($html);
702 }
703 }
704
705 protected function applyFilter(): void
706 {
707 $mpool_table = $this->getPoolTable();
708 $mpool_table->resetOffset();
709 $mpool_table->writeFilterToSession();
710 $this->ctrl->redirect($this, "listPoolItems");
711 }
712
713 protected function resetFilter(): void
714 {
715 $mpool_table = $this->getPoolTable();
716 $mpool_table->resetOffset();
717 $mpool_table->resetFilter();
718 $this->ctrl->redirect($this, "listPoolItems");
719 }
720
721 protected function getPoolTable(): ilMediaPoolTableGUI
722 {
723 $pool = new ilObjMediaPool($this->requested_mep);
724 $mpool_table = new ilMediaPoolTableGUI(
725 $this,
726 "listPoolItems",
727 $pool,
728 "mep_folder",
730 $this->pool_view == self::POOL_VIEW_ALL
731 );
732 $mpool_table->setFilterCommand("applyFilter");
733 $mpool_table->setResetCommand("resetFilter");
734 $mpool_table->setInsertCommand("insertFromPool");
735 return $mpool_table;
736 }
737
741 public function selectPool(): void
742 {
743 $ctrl = $this->ctrl;
744
745 $ctrl->setParameter($this, "mep", $this->request->getSelectedMediaPoolRefId());
746 $ctrl->redirect($this, "listPoolItems");
747 }
748
749 public function poolSelection(): void
750 {
751 $main_tpl = $this->main_tpl;
752 $exp = new ilPoolSelectorGUI(
753 $this,
754 "poolSelection",
755 null,
756 "selectPool",
757 "",
758 "mep_ref_id"
759 );
760 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
761 $exp->setClickableTypes(array('mep'));
762 if (!$exp->handleCommand()) {
763 $main_tpl->setContent($exp->getHTML());
764 }
765 }
766
770 protected function insertFromPool(): void
771 {
772 $ids = $this->request->getIds();
773 if (count($ids) == 0) {
774 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
775 $this->listPoolItems();
776 return;
777 }
778 $mob_ids = [];
779 foreach ($ids as $pool_entry_id) {
780 $id = ilMediaPoolItem::lookupForeignId($pool_entry_id);
781 $mob = new ilObjMediaObject((int) $id);
782 if (!in_array($mob->getMediaItem("Standard")->getFormat(), $this->getMimeTypes())) {
783 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("mob_mime_type_not_allowed") . ": " .
784 $mob->getMediaItem("Standard")->getFormat());
785 $this->listPoolItems();
786 return;
787 }
788 $mob_ids[] = $id;
789 }
790 ($this->after_pool_insert)($mob_ids);
791 }
792}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
returnToParent(object $a_gui_obj, string $a_anchor=null)
@inheritDoc
getNextClass($a_gui_class=null)
@inheritDoc
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
getCmd(string $fallback_command=null)
@inheritDoc
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
forwardCommand(object $a_gui_object)
@inheritDoc
language handling
Component logger with individual log levels by component id.
ilGlobalTemplateInterface $main_tpl
initMediaBulkForm(string $a_id, string $a_title)
listPoolItems()
Insert media object from pool.
getMimeTypes($local_only=false)
selectPool()
Select concrete pool.
performBulkUpload()
Save bulk upload form.
CreationGUIRequest $request
__construct(array $accept_types, Closure $after_upload, Closure $after_url_saving, Closure $after_pool_insert, Closure $finish_single_upload=null, Closure $on_mob_update=null)
ILIAS FileUpload FileUpload $upload
handleUploadResult(FileUpload $upload, UploadResult $result)
insertFromPool()
Insert media from pool.
ILIAS MediaObjects MediaType MediaTypeManager $type_manager
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getMediaItemsForUploadHash(string $a_hash)
Get media items for upload hash.
static lookupForeignId(int $a_id)
TableGUI class for recent changes in wiki.
static fixFilename(string $a_name)
Fix filename of uploaded file.
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
static _getRelativeDirectory(int $a_mob_id)
Get relative (to webspace dir) directory.
static _getDirectory(int $a_mob_id)
Get absolute directory.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
moveOneFileTo(UploadResult $uploadResult, string $destination, int $location=Location::STORAGE, string $file_name='', bool $override_existing=false)
Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResul...
Interface Location.
Definition: Location.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
$format
Definition: metadata.php:235
$url
$lng