ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 = iterator_to_array($this->type_manager->getAllowedSuffixes());
154 }
155 if (in_array(self::TYPE_VIDEO, $this->accept_types, true)) {
156 $suffixes = array_merge($suffixes, iterator_to_array($this->type_manager->getAllowedVideoSuffixes()));
157 }
158 if (in_array(self::TYPE_AUDIO, $this->accept_types, true)) {
159 $suffixes = array_merge($suffixes, iterator_to_array($this->type_manager->getAllowedAudioSuffixes()));
160 }
161 if (in_array(self::TYPE_IMAGE, $this->accept_types, true)) {
162 $suffixes = array_merge($suffixes, iterator_to_array($this->type_manager->getAllowedImageSuffixes()));
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 = iterator_to_array($this->type_manager->getAllowedMimeTypes());
175 }
176 if (in_array(self::TYPE_VIDEO, $this->accept_types)) {
177 $mimes = array_merge($mimes, iterator_to_array($this->type_manager->getAllowedVideoMimeTypes($local_only)));
178 }
179 if (in_array(self::TYPE_AUDIO, $this->accept_types)) {
180 $mimes = array_merge($mimes, iterator_to_array($this->type_manager->getAllowedAudioMimeTypes()));
181 }
182 if (in_array(self::TYPE_IMAGE, $this->accept_types)) {
183 $mimes = array_merge($mimes, iterator_to_array($this->type_manager->getAllowedImageMimeTypes()));
184 }
185 return $mimes;
186 }
187
188 public function executeCommand(): void
189 {
190 $ctrl = $this->ctrl;
191
192 $next_class = $ctrl->getNextClass($this);
193 $cmd = $ctrl->getCmd("creationSelection");
194
195 switch ($next_class) {
196 case "ilpropertyformgui":
197 $form = $this->initPoolSelection();
198 $ctrl->forwardCommand($form);
199 break;
200
201 case strtolower(ilRepoStandardUploadHandlerGUI::class):
202 $form = $this->getUploadForm();
203 $gui = $form->getRepoStandardUploadHandlerGUI("media_files");
204 $this->ctrl->forwardCommand($gui);
205 break;
206
207 default:
208 if (in_array($cmd, ["creationSelection", "uploadFile", "saveUrl", "cancel", "cancelCreate", "listPoolItems",
209 "insertFromPool", "poolSelection", "selectPool", "applyFilter", "resetFilter", "performBulkUpload",
210 "editTitlesAndDescriptions", "saveTitlesAndDescriptions"])) {
211 $this->$cmd();
212 }
213 }
214 }
215
216 protected function creationSelection(): void
217 {
218 $main_tpl = $this->main_tpl;
219
220 $acc = new \ilAccordionGUI();
221 $acc->setBehaviour(\ilAccordionGUI::FIRST_OPEN);
222 $cnt = 1;
223 $forms = [
224 $this->getUploadForm(),
225 $this->initUrlForm(),
226 $this->initPoolSelection()
227 ];
228 foreach ($forms as $form_type => $cf) {
229 $htpl = new \ilTemplate("tpl.creation_acc_head.html", true, true, "components/ILIAS/ILIASObject");
230
231 // using custom form titles (used for repository plugins)
232 $form_title = "";
233 if (method_exists($this, "getCreationFormTitle")) {
234 $form_title = $this->getCreationFormTitle($form_type);
235 }
236 if (!$form_title) {
237 $form_title = $cf->getTitle();
238 }
239
240 // move title from form to accordion
241 $htpl->setVariable("TITLE", $this->lng->txt("option") . " " . $cnt . ": " .
242 $form_title);
243 if (!($cf instanceof FormAdapterGUI)) {
244 $cf->setTitle("");
245 $cf->setTitleIcon("");
246 $cf->setTableWidth("100%");
247
248 $acc->addItem($htpl->get(), $cf->getHTML());
249 } else {
250 $acc->addItem($htpl->get(), $cf->render());
251 }
252
253 $cnt++;
254 }
255 $main_tpl->setContent($acc->getHTML());
256 }
257
258 public function getUploadForm(): FormAdapterGUI
259 {
260 // $item->setSuffixes($this->getSuffixes());
261 if (is_null($this->bulk_upload_form)) {
262 $mep_hash = uniqid();
263 $this->ctrl->setParameter($this, "mep_hash", $mep_hash);
264 $this->bulk_upload_form = $this->gui
265 ->form(self::class, 'performBulkUpload')
266 ->section("props", $this->lng->txt('mob_upload_file'))
267 ->file(
268 "media_files",
269 $this->lng->txt("files"),
270 \Closure::fromCallable([$this, 'handleUploadResult']),
271 "mep_id",
272 "",
273 20,
274 $this->getMimeTypes(true)
275 )->required();
276 // ->meta()->text()->meta()->textarea()
277 }
278 return $this->bulk_upload_form;
279 }
280
282 {
283 $ctrl = $this->ctrl;
285
286 $form = new \ilPropertyFormGUI();
287
288 //
289 $ti = new \ilTextInputGUI($lng->txt("mob_url"), "url");
290 $info = $lng->txt("mob_url_info1") . " " . implode(", ", $this->getSuffixes()) . ".";
291 if (in_array(self::TYPE_VIDEO, $this->accept_types)) {
292 $info .= " " . $lng->txt("mob_url_info_video");
293 }
294 $ti->setInfo($info);
295 $ti->setRequired(true);
296 $form->addItem($ti);
297
298 $form->addCommandButton("saveUrl", $lng->txt("save"));
299 $form->addCommandButton("cancel", $lng->txt("cancel"));
300
301 $form->setTitle($lng->txt("mob_external_url"));
302 $form->setFormAction($ctrl->getFormAction($this));
303
304 return $form;
305 }
306
308 {
309 $ctrl = $this->ctrl;
311
312 $form = new \ilPropertyFormGUI();
313
315 $lng->txt("obj_mep"),
316 "mep",
317 false,
318 $form
319 );
320 $exp = $mcst->getExplorerGUI();
321 $exp->setSelectableTypes(["mep"]);
322 $exp->setTypeWhiteList(["root", "mep", "cat", "crs", "grp", "fold"]);
323 $mcst->setRequired(true);
324 $form->addItem($mcst);
325
326 $form->addCommandButton("listPoolItems", $lng->txt("continue"));
327 $form->addCommandButton("cancel", $lng->txt("cancel"));
328
329 $form->setTitle($lng->txt("mob_choose_from_pool"));
330 $form->setFormAction($ctrl->getFormAction($this));
331
332 return $form;
333 }
334
335 /*
336 protected function uploadFile() : void
337 {
338 $form = $this->initUploadForm();
339
340 if (!$form->checkInput()) {
341 $form->setValuesByPost();
342 $this->main_tpl->setContent($form->getHTML());
343 //$this->creationSelection();
344 } else {
345 $mob = new ilObjMediaObject();
346 $mob->create();
347
348 //handle standard purpose
349 $mediaItem = new ilMediaItem();
350 $mob->addMediaItem($mediaItem);
351 $mediaItem->setPurpose("Standard");
352
353 // determine and create mob directory, move uploaded file to directory
354 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
355 if (!is_dir($mob_dir)) {
356 $mob->createDirectory();
357 }
358 $file_name = ilFileUtils::getASCIIFilename($_FILES['file']["name"]);
359 $file_name = str_replace(" ", "_", $file_name);
360
361 $file = $mob_dir . "/" . $file_name;
362 $title = $file_name;
363 $locationType = "LocalFile";
364 $location = $title;
365 ilFileUtils::moveUploadedFile($_FILES['file']['tmp_name'], $file_name, $file);
366 ilFileUtils::renameExecutables($mob_dir);
367
368 // get mime type, if not already set!
369 $format = ilObjMediaObject::getMimeType($file, false);
370
371 // set real meta and object data
372 $mediaItem->setFormat($format);
373 $mediaItem->setLocation($location);
374 $mediaItem->setLocationType($locationType);
375 $mediaItem->setHAlign("Left");
376 $mob->setTitle($title);
377
378 $mob->update();
379
380 // preview pic
381 $mob = new ilObjMediaObject($mob->getId());
382 $mob->generatePreviewPic(320, 240);
383
384 // duration
385 $med_item = $mob->getMediaItem("Standard");
386 $med_item->determineDuration();
387 $med_item->update();
388
389 //
390 // @todo: save usage
391 //
392
393 ($this->after_upload)($mob->getId());
394 }
395 }*/
396
397 protected function handleUploadResult(
398 FileUpload $upload,
399 UploadResult $result
401 $title = $result->getName();
402
403 $mob = new ilObjMediaObject();
404 $mob->setTitle($title);
405 $mob->setDescription("");
406 $mob->create();
407
408 $media_item = $mob->addMediaItemFromUpload(
409 "Standard",
410 $result,
411 $this->request->getUploadHash()
412 );
413
414 /*
415 $mob->createDirectory();
416 $media_item = new ilMediaItem();
417 $mob->addMediaItem($media_item);
418 $media_item->setPurpose("Standard");
419
420 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
421 $file_name = ilObjMediaObject::fixFilename($title);
422 $file = $mob_dir . "/" . $file_name;
423
424 $upload->moveOneFileTo(
425 $result,
426 $mob_dir,
427 Location::WEB,
428 $file_name,
429 true
430 );
431
432 // get mime type
433 $format = ilObjMediaObject::getMimeType($file);
434 $location = $file_name;
435
436 // set real meta and object data
437 $media_item->setFormat($format);
438 $media_item->setLocation($location);
439 $media_item->setLocationType("LocalFile");
440 $media_item->setUploadHash($this->request->getUploadHash());*/
441 $mob->update();
442 $item_ids[] = $mob->getId();
443
444 // duration
445 $med_item = $mob->getMediaItem("Standard");
446 $med_item->determineDuration();
447 $med_item->update();
448
449 ($this->after_upload)([$mob->getId()]);
450
451 return new BasicHandlerResult(
452 "mep_id",
453 HandlerResult::STATUS_OK,
454 $med_item->getId(),
455 ''
456 );
457 }
458
462 public function performBulkUpload(): void
463 {
464 $form = $this->getUploadForm();
465 if (!$form->isValid()) {
466 $this->main_tpl->setContent($form->render());
467 return;
468 }
469
470 $this->ctrl->setParameter($this, "mep_hash", $this->request->getUploadHash());
471 $this->ctrl->redirect($this, "editTitlesAndDescriptions");
472 }
473
474
475 protected function editTitlesAndDescriptions(): void
476 {
477 $ctrl = $this->ctrl;
479
480 $ctrl->saveParameter($this, "mep_hash");
481
482 $main_tpl = $this->main_tpl;
483
484 $media_items = ilMediaItem::getMediaItemsForUploadHash($this->request->getUploadHash());
485
486 $tb = new ilToolbarGUI();
487 $tb->setFormAction($ctrl->getFormAction($this));
488 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
489 $tb->setOpenFormTag(true);
490 $tb->setCloseFormTag(false);
491 $tb->setId("tb_top");
492
493 if (count($media_items) == 1 && $this->finish_single_upload) {
494 $mi = current($media_items);
495 ($this->finish_single_upload)($mi["mob_id"]);
496 return;
497 }
498
499 $html = $tb->getHTML();
500 foreach ($media_items as $mi) {
501 $acc = new ilAccordionGUI();
502 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
503 $acc->setId("acc_" . $mi["mob_id"]);
504
505 $mob = new ilObjMediaObject($mi["mob_id"]);
506 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
507 $acc->addItem($mob->getTitle(), $form->getHTML());
508
509 $html .= $acc->getHTML();
510 }
511
512 $html .= $tb->getHTML();
513 $tb->setOpenFormTag(false);
514 $tb->setCloseFormTag(true);
515 $tb->setId("tb_bottom");
516
517 $main_tpl->setContent($html);
518 }
519
520 public function initMediaBulkForm(string $a_id, string $a_title): ilPropertyFormGUI
521 {
523
524 $form = new ilPropertyFormGUI();
525 $form->setOpenTag(false);
526 $form->setCloseTag(false);
527
528 // title
529 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
530 $ti->setValue($a_title);
531 $form->addItem($ti);
532
533 // description
534 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
535 $form->addItem($ti);
536
537 return $form;
538 }
539
540 protected function saveTitlesAndDescriptions(): void
541 {
543 $ctrl = $this->ctrl;
544
545 $media_items = ilMediaItem::getMediaItemsForUploadHash($this->request->getUploadHash());
546
547 foreach ($media_items as $mi) {
548 $mob = new ilObjMediaObject($mi["mob_id"]);
549 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
550 $form->checkInput();
551 $title = $form->getInput("title_" . $mi["mob_id"]);
552 $desc = $form->getInput("description_" . $mi["mob_id"]);
553 if (trim($title) != "") {
554 $mob->setTitle($title);
555 }
556 $mob->setDescription($desc);
557 $mob->update();
558 ($this->on_mob_update)($mob->getId());
559 }
560 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
561 $ctrl->returnToParent($this);
562 }
563
564 protected function cancel(): void
565 {
566 $ctrl = $this->ctrl;
567 $ctrl->returnToParent($this);
568 }
569
570 protected function cancelCreate(): void
571 {
572 $ctrl = $this->ctrl;
573 $ctrl->returnToParent($this);
574 }
575
576 protected function saveUrl(): void
577 {
578 $form = $this->initUrlForm();
579
580 if (!$form->checkInput()) {
581 $form->setValuesByPost();
582 $this->main_tpl->setContent($form->getHTML());
583 } else {
584 $locationType = "Reference";
585 $url = $form->getInput("url");
586 $url_pi = pathinfo(basename($url));
587 $title = str_replace("_", " ", $url_pi["filename"]);
588
589 /*
590 * Creating the MediaObject also creates a LOM set for it,
591 * and a LOM set can not be created without a title.
592 */
593 $mob = new ilObjMediaObject();
594 $mob->setTitle($title);
595 $mob->create();
596
597 //handle standard purpose
598 $mediaItem = new ilMediaItem();
599 $mob->addMediaItem($mediaItem);
600 $mediaItem->setPurpose("Standard");
601
602 // determine and create mob directory, move uploaded file to directory
603 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
604 if (!is_dir($mob_dir)) {
605 $mob->createDirectory();
606 }
607
608 // get mime type, if not already set!
609 $format = ilObjMediaObject::getMimeType($url, true);
610 if (!in_array($format, $this->getMimeTypes())) {
611 $this->main_tpl->setOnScreenMessage(
612 "failure",
613 $this->lng->txt("mob_type_not_supported") . " " . $format
614 );
615 $form->setValuesByPost();
616 $this->main_tpl->setContent($form->getHTML());
617 return;
618 }
619 // set real meta and object data
620 $mediaItem->setFormat($format);
621 $mediaItem->setLocation($url);
622 $mediaItem->setLocationType("Reference");
623 $mediaItem->setHAlign("Left");
624 try {
625 $mob->getExternalMetadata();
626 } catch (Exception $e) {
627 $this->main_tpl->setOnScreenMessage('failure', $e->getMessage(), true);
628 $form->setValuesByPost();
629 $this->main_tpl->setContent($form->getHTML());
630 return;
631 }
632
633 $long_desc = $mob->getLongDescription();
634 $mob->update();
635
636 $mob = new ilObjMediaObject($mob->getId());
637 $mob->generatePreviewPic(320, 240);
638
639 // duration
640 $med_item = $mob->getMediaItem("Standard");
641 $med_item->determineDuration();
642 $med_item->update();
643
644 //
645 // @todo: save usage
646 //
647
648 ($this->after_url_saving)($mob->getId(), $long_desc);
649 }
650 }
651
655 public function listPoolItems(): void
656 {
657 $ctrl = $this->ctrl;
658 $access = $this->access;
660 $ui = $this->ui;
661 $main_tpl = $this->main_tpl;
662
663 $form = $this->initPoolSelection();
664 if ($this->requested_mep === 0) {
665 $this->main_tpl->setOnScreenMessage("failure", $this->lng->txt("mob_please_select_pool"));
666 $form->setValuesByPost();
667 $this->main_tpl->setContent($form->getHTML());
668 return;
669 }
670
671 if ($this->requested_mep > 0 &&
672 $access->checkAccess("write", "", $this->requested_mep)
673 && ilObject::_lookupType(ilObject::_lookupObjId($this->requested_mep)) == "mep") {
674 $tb = new ilToolbarGUI();
675
676 // button: select pool
677 $tb->addButton(
678 $lng->txt("cont_switch_to_media_pool"),
679 $ctrl->getLinkTarget($this, "poolSelection")
680 );
681
682 // view mode: pool view (folders/all media objects)
683 $f = $ui->factory();
684 $lng->loadLanguageModule("mep");
685 $ctrl->setParameter($this, "pool_view", self::POOL_VIEW_FOLDER);
686 $actions[$lng->txt("folders")] = $ctrl->getLinkTarget($this, "listPoolItems");
687 $ctrl->setParameter($this, "pool_view", self::POOL_VIEW_ALL);
688 $actions[$lng->txt("mep_all_mobs")] = $ctrl->getLinkTarget($this, "listPoolItems");
689 $ctrl->setParameter($this, "pool_view", $this->pool_view);
690 $aria_label = $lng->txt("cont_change_pool_view");
691 $view_control = $f->viewControl()->mode($actions, $aria_label)->withActive(($this->pool_view == self::POOL_VIEW_FOLDER)
692 ? $lng->txt("folders") : $lng->txt("mep_all_mobs"));
693 $tb->addSeparator();
694 $tb->addComponent($view_control);
695
696 $html = $tb->getHTML();
697
698 $pool_table = $this->getPoolTable();
699
700 $html .= $pool_table->getHTML();
701
702 $main_tpl->setContent($html);
703 }
704 }
705
706 protected function applyFilter(): void
707 {
708 $mpool_table = $this->getPoolTable();
709 $mpool_table->resetOffset();
710 $mpool_table->writeFilterToSession();
711 $this->ctrl->redirect($this, "listPoolItems");
712 }
713
714 protected function resetFilter(): void
715 {
716 $mpool_table = $this->getPoolTable();
717 $mpool_table->resetOffset();
718 $mpool_table->resetFilter();
719 $this->ctrl->redirect($this, "listPoolItems");
720 }
721
722 protected function getPoolTable(): ilMediaPoolTableGUI
723 {
724 $pool = new ilObjMediaPool($this->requested_mep);
725 $mpool_table = new ilMediaPoolTableGUI(
726 $this,
727 "listPoolItems",
728 $pool,
729 "mep_folder",
731 $this->pool_view == self::POOL_VIEW_ALL
732 );
733 $mpool_table->setFilterCommand("applyFilter");
734 $mpool_table->setResetCommand("resetFilter");
735 $mpool_table->setInsertCommand("insertFromPool");
736 return $mpool_table;
737 }
738
742 public function selectPool(): void
743 {
744 $ctrl = $this->ctrl;
745
746 $ctrl->setParameter($this, "mep", $this->request->getSelectedMediaPoolRefId());
747 $ctrl->redirect($this, "listPoolItems");
748 }
749
750 public function poolSelection(): void
751 {
752 $main_tpl = $this->main_tpl;
753 $exp = new ilPoolSelectorGUI(
754 $this,
755 "poolSelection",
756 null,
757 "selectPool",
758 "",
759 "mep_ref_id"
760 );
761 $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "mep"));
762 $exp->setClickableTypes(array('mep'));
763 if (!$exp->handleCommand()) {
764 $main_tpl->setContent($exp->getHTML());
765 }
766 }
767
771 protected function insertFromPool(): void
772 {
773 $ids = $this->request->getIds();
774 if (count($ids) == 0) {
775 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("select_one"));
776 $this->listPoolItems();
777 return;
778 }
779 $mob_ids = [];
780 foreach ($ids as $pool_entry_id) {
781 $id = ilMediaPoolItem::lookupForeignId($pool_entry_id);
782 $mob = new ilObjMediaObject((int) $id);
783 if (!in_array($mob->getMediaItem("Standard")->getFormat(), $this->getMimeTypes())) {
784 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("mob_mime_type_not_allowed") . ": " .
785 $mob->getMediaItem("Standard")->getFormat());
786 $this->listPoolItems();
787 return;
788 }
789 $mob_ids[] = $id;
790 }
791 ($this->after_pool_insert)($mob_ids);
792 }
793}
$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