ILIAS  trunk Revision v12.0_alpha-399-g579a087ced2
class.ilMediaCreationGUI.php
Go to the documentation of this file.
1<?php
2
27
33{
34 public const TYPE_VIDEO = 1;
35 public const TYPE_AUDIO = 2;
36 public const TYPE_IMAGE = 3;
37 public const TYPE_OTHER = 4;
38 public const TYPE_ALL = 5;
39 public const POOL_VIEW_FOLDER = "fold";
40 public const POOL_VIEW_ALL = "all";
41 protected \ILIAS\MediaObjects\MediaType\MediaTypeManager $type_manager;
45
46 protected array $accept_types = [1,2,3,4];
47 protected ilLanguage $lng;
48 protected ilCtrl $ctrl;
50 protected Closure $after_upload;
51 protected Closure $after_url_saving;
52 protected Closure $after_pool_insert;
53 protected Closure $finish_single_upload;
54 protected Closure $on_mob_update;
59 protected array $all_suffixes = [];
63 protected array $all_mime_types = [];
64 protected \ILIAS\DI\UIServices $ui;
65 protected int $requested_mep;
67 protected \ILIAS\FileUpload\FileUpload $upload;
68 protected ilLogger $mob_log;
69
70 public function __construct(
71 array $accept_types,
72 Closure $after_upload,
73 Closure $after_url_saving,
74 Closure $after_pool_insert,
75 ?Closure $finish_single_upload = null,
76 ?Closure $on_mob_update = null
77 ) {
78 global $DIC;
79
80 $this->lng = $DIC->language();
81 $this->lng->loadLanguageModule("mob");
82 $this->lng->loadLanguageModule("content");
83 $this->access = $DIC->access();
84
85 $this->ctrl = $DIC->ctrl();
86 $this->main_tpl = $DIC->ui()->mainTemplate();
87 $this->ui = $DIC->ui();
88 $this->upload = $DIC->upload();
89 $this->mob_log = $DIC->logger()->mob();
90
91 $this->accept_types = $accept_types;
92 $this->after_upload = $after_upload;
93 $this->after_url_saving = $after_url_saving;
94 $this->after_pool_insert = $after_pool_insert;
95 $this->finish_single_upload = $finish_single_upload;
96 $this->on_mob_update = $on_mob_update;
97 $this->type_manager = $DIC->mediaObjects()
98 ->internal()
99 ->domain()
100 ->mediaType();
101
102 $this->ctrl->saveParameter($this, ["mep", "pool_view"]);
103
104 $this->request = $DIC->mediaObjects()
105 ->internal()
106 ->gui()
107 ->creation()
108 ->request();
109
110 $this->requested_mep = $this->request->getMediaPoolId();
111 $this->ctrl->setParameter($this, "mep", $this->requested_mep);
112
113 $pv = $this->request->getPoolView();
114 $this->pool_view = (in_array($pv, [self::POOL_VIEW_FOLDER, self::POOL_VIEW_ALL]))
115 ? $pv
116 : self::POOL_VIEW_FOLDER;
117 $this->gui = $DIC->mediaObjects()->internal()->gui();
118 }
119
120 public function setAllSuffixes(
121 array $a_val
122 ): void {
123 $this->all_suffixes = $a_val;
124 }
125
126 public function getAllSuffixes(): array
127 {
128 return $this->all_suffixes;
129 }
130
131 public function setAllMimeTypes(
132 array $a_val
133 ): void {
134 $this->all_mime_types = $a_val;
135 }
136
140 public function getAllMimeTypes(): array
141 {
142 return $this->all_mime_types;
143 }
144
148 protected function getSuffixes(): array
149 {
150 $suffixes = [];
151 if (in_array(self::TYPE_ALL, $this->accept_types, true)) {
152 $suffixes = iterator_to_array($this->type_manager->getAllowedSuffixes());
153 }
154 if (in_array(self::TYPE_VIDEO, $this->accept_types, true)) {
155 $suffixes = array_merge($suffixes, iterator_to_array($this->type_manager->getAllowedVideoSuffixes()));
156 }
157 if (in_array(self::TYPE_AUDIO, $this->accept_types, true)) {
158 $suffixes = array_merge($suffixes, iterator_to_array($this->type_manager->getAllowedAudioSuffixes()));
159 }
160 if (in_array(self::TYPE_IMAGE, $this->accept_types, true)) {
161 $suffixes = array_merge($suffixes, iterator_to_array($this->type_manager->getAllowedImageSuffixes()));
162 }
163 return $suffixes;
164 }
165
169 protected function getMimeTypes($local_only = false): array
170 {
171 $mimes = [];
172 if (in_array(self::TYPE_ALL, $this->accept_types)) {
173 $mimes = iterator_to_array($this->type_manager->getAllowedMimeTypes());
174 }
175 if (in_array(self::TYPE_VIDEO, $this->accept_types)) {
176 $mimes = array_merge($mimes, iterator_to_array($this->type_manager->getAllowedVideoMimeTypes($local_only)));
177 }
178 if (in_array(self::TYPE_AUDIO, $this->accept_types)) {
179 $mimes = array_merge($mimes, iterator_to_array($this->type_manager->getAllowedAudioMimeTypes()));
180 }
181 if (in_array(self::TYPE_IMAGE, $this->accept_types)) {
182 $mimes = array_merge($mimes, iterator_to_array($this->type_manager->getAllowedImageMimeTypes()));
183 }
184 return $mimes;
185 }
186
187 public function executeCommand(): void
188 {
189 $ctrl = $this->ctrl;
190
191 $next_class = $ctrl->getNextClass($this);
192 $cmd = $ctrl->getCmd("creationSelection");
193
194 switch ($next_class) {
195 case "ilpropertyformgui":
196 $form = $this->initPoolSelection();
197 $ctrl->forwardCommand($form);
198 break;
199
200 case strtolower(ilRepoStandardUploadHandlerGUI::class):
201 $form = $this->getUploadForm();
202 $gui = $form->getRepoStandardUploadHandlerGUI("media_files");
203 $this->ctrl->forwardCommand($gui);
204 break;
205
206 default:
207 if (in_array($cmd, ["creationSelection", "uploadFile", "saveUrl", "cancel", "cancelCreate", "listPoolItems",
208 "insertFromPool", "poolSelection", "selectPool", "applyFilter", "resetFilter", "performBulkUpload",
209 "editTitlesAndDescriptions", "saveTitlesAndDescriptions"])) {
210 $this->$cmd();
211 }
212 }
213 }
214
215 protected function creationSelection(): void
216 {
217 $main_tpl = $this->main_tpl;
218
219 $acc = new \ilAccordionGUI();
220 $acc->setBehaviour(\ilAccordionGUI::FIRST_OPEN);
221 $cnt = 1;
222 $forms = [
223 $this->getUploadForm(),
224 $this->initUrlForm(),
225 $this->initPoolSelection()
226 ];
227 foreach ($forms as $form_type => $cf) {
228 $htpl = new \ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
229
230 // using custom form titles (used for repository plugins)
231 $form_title = "";
232 if (method_exists($this, "getCreationFormTitle")) {
233 $form_title = $this->getCreationFormTitle($form_type);
234 }
235 if (!$form_title) {
236 $form_title = $cf->getTitle();
237 }
238
239 // move title from form to accordion
240 $htpl->setVariable("TITLE", $this->lng->txt("option") . " " . $cnt . ": " .
241 $form_title);
242 if (!($cf instanceof FormAdapterGUI)) {
243 $cf->setTitle("");
244 $cf->setTitleIcon("");
245 $cf->setTableWidth("100%");
246
247 $acc->addItem($htpl->get(), $cf->getHTML());
248 } else {
249 $acc->addItem($htpl->get(), $cf->render());
250 }
251
252 $cnt++;
253 }
254 $main_tpl->setContent($acc->getHTML());
255 }
256
257 public function getUploadForm(): FormAdapterGUI
258 {
259 // $item->setSuffixes($this->getSuffixes());
260 if (is_null($this->bulk_upload_form)) {
261 $mep_hash = uniqid();
262 $this->ctrl->setParameter($this, "mep_hash", $mep_hash);
263 $this->bulk_upload_form = $this->gui
264 ->form([self::class], 'performBulkUpload')
265 ->section("props", $this->lng->txt('mob_upload_file'))
266 ->file(
267 "media_files",
268 $this->lng->txt("files"),
269 \Closure::fromCallable([$this, 'handleUploadResult']),
270 "mep_id",
271 "",
272 20,
273 $this->getMimeTypes(true)
274 )->required();
275 // ->meta()->text()->meta()->textarea()
276 }
277 return $this->bulk_upload_form;
278 }
279
281 {
282 $ctrl = $this->ctrl;
284
285 $form = new \ilPropertyFormGUI();
286
287 //
288 $ti = new \ilTextInputGUI($lng->txt("mob_url"), "url");
289 $info = $lng->txt("mob_url_info1") . " " . implode(", ", $this->getSuffixes()) . ".";
290 if (in_array(self::TYPE_VIDEO, $this->accept_types)) {
291 $info .= " " . $lng->txt("mob_url_info_video");
292 }
293 $ti->setInfo($info);
294 $ti->setRequired(true);
295 $form->addItem($ti);
296
297 $form->addCommandButton("saveUrl", $lng->txt("save"));
298 $form->addCommandButton("cancel", $lng->txt("cancel"));
299
300 $form->setTitle($lng->txt("mob_external_url"));
301 $form->setFormAction($ctrl->getFormAction($this));
302
303 return $form;
304 }
305
307 {
308 $ctrl = $this->ctrl;
310
311 $form = new \ilPropertyFormGUI();
312
314 $lng->txt("obj_mep"),
315 "mep",
316 false,
317 $form
318 );
319 $exp = $mcst->getExplorerGUI();
320 $exp->setSelectableTypes(["mep"]);
321 $exp->setTypeWhiteList(["root", "mep", "cat", "crs", "grp", "fold"]);
322 $mcst->setRequired(true);
323 $form->addItem($mcst);
324
325 $form->addCommandButton("listPoolItems", $lng->txt("continue"));
326 $form->addCommandButton("cancel", $lng->txt("cancel"));
327
328 $form->setTitle($lng->txt("mob_choose_from_pool"));
329 $form->setFormAction($ctrl->getFormAction($this));
330
331 return $form;
332 }
333
334 /*
335 protected function uploadFile() : void
336 {
337 $form = $this->initUploadForm();
338
339 if (!$form->checkInput()) {
340 $form->setValuesByPost();
341 $this->main_tpl->setContent($form->getHTML());
342 //$this->creationSelection();
343 } else {
344 $mob = new ilObjMediaObject();
345 $mob->create();
346
347 //handle standard purpose
348 $mediaItem = new ilMediaItem();
349 $mob->addMediaItem($mediaItem);
350 $mediaItem->setPurpose("Standard");
351
352 // determine and create mob directory, move uploaded file to directory
353 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
354 if (!is_dir($mob_dir)) {
355 $mob->createDirectory();
356 }
357 $file_name = ilFileUtils::getASCIIFilename($_FILES['file']["name"]);
358 $file_name = str_replace(" ", "_", $file_name);
359
360 $file = $mob_dir . "/" . $file_name;
361 $title = $file_name;
362 $locationType = "LocalFile";
363 $location = $title;
364 ilFileUtils::moveUploadedFile($_FILES['file']['tmp_name'], $file_name, $file);
365 ilFileUtils::renameExecutables($mob_dir);
366
367 // get mime type, if not already set!
368 $format = ilObjMediaObject::getMimeType($file, false);
369
370 // set real meta and object data
371 $mediaItem->setFormat($format);
372 $mediaItem->setLocation($location);
373 $mediaItem->setLocationType($locationType);
374 $mediaItem->setHAlign("Left");
375 $mob->setTitle($title);
376
377 $mob->update();
378
379 // preview pic
380 $mob = new ilObjMediaObject($mob->getId());
381 $mob->generatePreviewPic(320, 240);
382
383 // duration
384 $med_item = $mob->getMediaItem("Standard");
385 $med_item->determineDuration();
386 $med_item->update();
387
388 //
389 // @todo: save usage
390 //
391
392 ($this->after_upload)($mob->getId());
393 }
394 }*/
395
396 protected function handleUploadResult(
397 FileUpload $upload,
398 UploadResult $result
400 $title = $result->getName();
401
402 $mob = new ilObjMediaObject();
403 $mob->setTitle($title);
404 $mob->setDescription("");
405 $mob->create();
406
407 $media_item = $mob->addMediaItemFromUpload(
408 "Standard",
409 $result,
410 $this->request->getUploadHash()
411 );
412
413 /*
414 $mob->createDirectory();
415 $media_item = new ilMediaItem();
416 $mob->addMediaItem($media_item);
417 $media_item->setPurpose("Standard");
418
419 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
420 $file_name = ilObjMediaObject::fixFilename($title);
421 $file = $mob_dir . "/" . $file_name;
422
423 $upload->moveOneFileTo(
424 $result,
425 $mob_dir,
426 Location::WEB,
427 $file_name,
428 true
429 );
430
431 // get mime type
432 $format = ilObjMediaObject::getMimeType($file);
433 $location = $file_name;
434
435 // set real meta and object data
436 $media_item->setFormat($format);
437 $media_item->setLocation($location);
438 $media_item->setLocationType("LocalFile");
439 $media_item->setUploadHash($this->request->getUploadHash());*/
440 $mob->update();
441 $item_ids[] = $mob->getId();
442
443 // duration
444 $med_item = $mob->getMediaItem("Standard");
445 $med_item->determineDuration();
446 $med_item->update();
447
448 ($this->after_upload)([$mob->getId()]);
449
450 return new BasicHandlerResult(
451 "mep_id",
452 HandlerResult::STATUS_OK,
453 $med_item->getId(),
454 ''
455 );
456 }
457
461 public function performBulkUpload(): void
462 {
463 $form = $this->getUploadForm();
464 if (!$form->isValid()) {
465 $this->main_tpl->setContent($form->render());
466 return;
467 }
468
469 $this->ctrl->setParameter($this, "mep_hash", $this->request->getUploadHash());
470 $this->ctrl->redirect($this, "editTitlesAndDescriptions");
471 }
472
473
474 protected function editTitlesAndDescriptions(): void
475 {
476 $ctrl = $this->ctrl;
478
479 $ctrl->saveParameter($this, "mep_hash");
480
481 $main_tpl = $this->main_tpl;
482
483 $media_items = ilMediaItem::getMediaItemsForUploadHash($this->request->getUploadHash());
484
485 $tb = new ilToolbarGUI();
486 $tb->setFormAction($ctrl->getFormAction($this));
487 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
488 $tb->setOpenFormTag(true);
489 $tb->setCloseFormTag(false);
490 $tb->setId("tb_top");
491
492 if (count($media_items) == 1 && $this->finish_single_upload) {
493 $mi = current($media_items);
494 ($this->finish_single_upload)($mi["mob_id"]);
495 return;
496 }
497
498 $html = $tb->getHTML();
499 foreach ($media_items as $mi) {
500 $acc = new ilAccordionGUI();
501 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
502 $acc->setId("acc_" . $mi["mob_id"]);
503
504 $mob = new ilObjMediaObject($mi["mob_id"]);
505 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
506 $acc->addItem($mob->getTitle(), $form->getHTML());
507
508 $html .= $acc->getHTML();
509 }
510
511 $html .= $tb->getHTML();
512 $tb->setOpenFormTag(false);
513 $tb->setCloseFormTag(true);
514 $tb->setId("tb_bottom");
515
516 $main_tpl->setContent($html);
517 }
518
519 public function initMediaBulkForm(string $a_id, string $a_title): ilPropertyFormGUI
520 {
522
523 $form = new ilPropertyFormGUI();
524 $form->setOpenTag(false);
525 $form->setCloseTag(false);
526
527 // title
528 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
529 $ti->setValue($a_title);
530 $form->addItem($ti);
531
532 // description
533 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
534 $form->addItem($ti);
535
536 return $form;
537 }
538
539 protected function saveTitlesAndDescriptions(): void
540 {
542 $ctrl = $this->ctrl;
543
544 $media_items = ilMediaItem::getMediaItemsForUploadHash($this->request->getUploadHash());
545
546 foreach ($media_items as $mi) {
547 $mob = new ilObjMediaObject($mi["mob_id"]);
548 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
549 $form->checkInput();
550 $title = $form->getInput("title_" . $mi["mob_id"]);
551 $desc = $form->getInput("description_" . $mi["mob_id"]);
552 if (trim($title) != "") {
553 $mob->setTitle($title);
554 }
555 $mob->setDescription($desc);
556 $mob->update();
557 ($this->on_mob_update)($mob->getId());
558 }
559 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
560 $ctrl->returnToParent($this);
561 }
562
563 protected function cancel(): void
564 {
565 $ctrl = $this->ctrl;
566 $ctrl->returnToParent($this);
567 }
568
569 protected function cancelCreate(): void
570 {
571 $ctrl = $this->ctrl;
572 $ctrl->returnToParent($this);
573 }
574
575 protected function saveUrl(): void
576 {
577 $form = $this->initUrlForm();
578
579 if (!$form->checkInput()) {
580 $form->setValuesByPost();
581 $this->main_tpl->setContent($form->getHTML());
582 } else {
583 $locationType = "Reference";
584 $url = $form->getInput("url");
585 $url_pi = pathinfo(basename($url));
586 $title = str_replace("_", " ", $url_pi["filename"]);
587
588 /*
589 * Creating the MediaObject also creates a LOM set for it,
590 * and a LOM set can not be created without a title.
591 */
592 $mob = new ilObjMediaObject();
593 $mob->setTitle($title);
594 $mob->create();
595
596 //handle standard purpose
597 $mediaItem = new ilMediaItem();
598 $mob->addMediaItem($mediaItem);
599 $mediaItem->setPurpose("Standard");
600
601 // determine and create mob directory, move uploaded file to directory
602 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
603 if (!is_dir($mob_dir)) {
604 $mob->createDirectory();
605 }
606
607 // get mime type, if not already set!
608 $format = ilObjMediaObject::getMimeType($url, true);
609 if (!in_array($format, $this->getMimeTypes())) {
610 $this->main_tpl->setOnScreenMessage(
611 "failure",
612 $this->lng->txt("mob_type_not_supported") . " " . $format
613 );
614 $form->setValuesByPost();
615 $this->main_tpl->setContent($form->getHTML());
616 return;
617 }
618 // set real meta and object data
619 $mediaItem->setFormat($format);
620 $mediaItem->setLocation($url);
621 $mediaItem->setLocationType("Reference");
622 $mediaItem->setHAlign("Left");
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
getNextClass($a_gui_class=null)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
returnToParent(object $a_gui_obj, ?string $a_anchor=null)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
forwardCommand(object $a_gui_object)
@inheritDoc
getCmd(?string $fallback_command=null)
@inheritDoc
language handling
Component logger with individual log levels by component id.
ilGlobalTemplateInterface $main_tpl
initMediaBulkForm(string $a_id, string $a_title)
__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)
listPoolItems()
Insert media object from pool.
getMimeTypes($local_only=false)
selectPool()
Select concrete pool.
performBulkUpload()
Save bulk upload form.
CreationGUIRequest $request
ILIAS FileUpload FileUpload $upload
handleUploadResult(FileUpload $upload, UploadResult $result)
insertFromPool()
Insert media from pool.
ILIAS MediaObjects MediaType MediaTypeManager $type_manager
Class ilMediaItem Media Item, component of a media object (file or reference)
static getMediaItemsForUploadHash(string $a_hash)
Get media items for upload hash.
static lookupForeignId(int $a_id)
TableGUI class for recent changes in wiki.
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
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 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...
$info
Definition: entry_point.php:21
Interface Location.
Definition: Location.php:33
setContent(string $a_html)
Sets content for standard template.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
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)
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26
$url
Definition: shib_logout.php:68